No inlining in the presence of non-instantiated phantom type
Consider the following code:
data U a = U
g :: [U a]
g = [U]
f :: [Int]
f = map (\U -> 2) g
Compiled with -O1, g
does not get inlined, and f
stays unchanged. Inline pragmas don't seem to help. However, if we change the type signature of g
to instantiate the phantom type parameter, such as with g :: [U ()]
, then f
is nicely optimised to become [2]
. I believe this is a bug, and we'd like f
to be simplified even when g
has its most general type signature.
Trac metadata
Trac field | Value |
---|---|
Version | 7.4.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |