[project @ 2001-07-12 16:21:22 by simonpj]
--------------------------------------------
Fix another bug in the squash-newtypes story.
--------------------------------------------
[This one was spotted by Marcin, and is now enshrined in test tc130.]
The desugarer straddles the boundary between the type checker and
Core, so it sometimes needs to look through newtypes/implicit parameters
and sometimes not. This is really a bit painful, but I can't think of
a better way to do it.
The only simple way to fix things was to pass a bit more type
information in the HsExpr type, from the type checker to the desugarer.
That led to the non-local changes you can see.
On the way I fixed one other thing. In various HsSyn constructors
there is a Type that is bogus (bottom) before the type checker, and
filled in with a real type by the type checker. In one place it was
a (Maybe Type) which was Nothing before, and (Just ty) afterwards.
I've defined a type synonym HsTypes.PostTcType for this, and a named
bottom value HsTypes.placeHolderType to use when you want the bottom
value.
27 files changed: