#5458: Phantom types confuse SpecConstr
---------------------------------+------------------------------------------
    Reporter:  simonpj           |        Owner:              
        Type:  bug               |       Status:  new         
    Priority:  normal            |    Milestone:              
   Component:  Compiler          |      Version:  7.2.1       
    Keywords:                    |     Testcase:              
   Blockedby:                    |   Difficulty:              
          Os:  Unknown/Multiple  |     Blocking:              
Architecture:  Unknown/Multiple  |      Failure:  None/Unknown
---------------------------------+------------------------------------------
 This program
 {{{
 type T a = Int

 f :: T a -> Bool -> [Int]
 f x b = case b of
                True  -> f x b
                False -> x : f x (x > 19)
 }}}
 gave a Lint error in `SpecConstr` (use -O2).  Reason: the specialised
 function was abstracted over `x`, but x's type mentions a phantom type
 variable `a`, and that ''wasn't'' being abstracted over.

 Phantom type variables are a nuisance.  A simple fix is to de-synonym the
 type of the abstracted variables.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5458>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to