Phantom types confuse SpecConstr
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.
Trac metadata
Trac field | Value |
---|---|
Version | 7.2.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |