Improve unboxing of strict fields
authorsimonpj@microsoft.com <unknown>
Wed, 4 Oct 2006 15:27:05 +0000 (15:27 +0000)
committersimonpj@microsoft.com <unknown>
Wed, 4 Oct 2006 15:27:05 +0000 (15:27 +0000)
commit08a681f1f95b465867c362faf8eb1b40f7bd19dd
tree1ceff4381e644ac8cfd7f4beff236d09674973ca
parent365ab3dad0f9a77e01758a14bf3817dea0ee2a31
Improve unboxing of strict fields

Note [Recursive unboxing]
~~~~~~~~~~~~~~~~~~~~~~~~~
Be careful not to try to unbox this!
data T = MkT !T Int
But it's the *argument* type that matters. This is fine:
data S = MkS S !Int
because Int is non-recursive.

Before this patch, we were only doing the unboxing if the *parent*
data type was non-recursive (eg that meant S was not unboxed), but
that is over-conservative.

This showed up with indexed data types (thanks to Roman for finding it)
because indexed data types are conservatively regarded as always recursive.
compiler/typecheck/TcTyClsDecls.lhs