No inlining in the presence of non-instantiated phantom type
|Reported by:||dreixel||Owned by:|
|Type of failure:||None/Unknown||Difficulty:||Unknown|
|Test Case:||Blocked By:|
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 . I believe this is a bug, and we'd like f to be simplified even when g has its most general type signature.