Consider a more aggressive bound in topNormaliseTypeX
@simonpj writes:
Consider this (from typecheck/should_fail/TcCoercibleFail.hs) newtype VoidBad a = VoidBad (VoidBad (a,a)) If we start with VoidBad (), we'll step to VoidBad ((),()), and then to VoidBad (((),()), ((),())), and so on. This type gets exponentially big.
There is no need to be so aggressive, so we could stop after one layer of unwrapping (of the same newtype, that is).
If you perform this change (setting the bound in topNormaliseTypeX
to 1 then the EmptyCase002
test fails because it thinks the type is recursive (it's not actually).