[project @ 2001-07-12 16:21:22 by simonpj]
authorsimonpj <unknown>
Thu, 12 Jul 2001 16:21:24 +0000 (16:21 +0000)
committersimonpj <unknown>
Thu, 12 Jul 2001 16:21:24 +0000 (16:21 +0000)
commitab46fd8e68f10b6162e77cfc0b216510d9b1d933
treec8dba665940e3a6d303446a0059f13b6a13b8542
parent6d1815b09469c68c9d15b253745876403c7fb084
[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:
ghc/compiler/deSugar/Check.lhs
ghc/compiler/deSugar/DsCCall.lhs
ghc/compiler/deSugar/DsExpr.lhs
ghc/compiler/deSugar/DsForeign.lhs
ghc/compiler/deSugar/DsGRHSs.lhs
ghc/compiler/deSugar/DsHsSyn.lhs
ghc/compiler/deSugar/DsListComp.lhs
ghc/compiler/deSugar/DsMonad.lhs
ghc/compiler/deSugar/DsUtils.lhs
ghc/compiler/deSugar/Match.lhs
ghc/compiler/deSugar/MatchCon.lhs
ghc/compiler/deSugar/MatchLit.lhs
ghc/compiler/hsSyn/HsExpr.lhs
ghc/compiler/hsSyn/HsLit.lhs
ghc/compiler/hsSyn/HsTypes.lhs
ghc/compiler/main/HscMain.lhs
ghc/compiler/parser/ParseUtil.lhs
ghc/compiler/parser/Parser.y
ghc/compiler/rename/RnExpr.lhs
ghc/compiler/typecheck/TcClassDcl.lhs
ghc/compiler/typecheck/TcExpr.lhs
ghc/compiler/typecheck/TcGenDeriv.lhs
ghc/compiler/typecheck/TcHsSyn.lhs
ghc/compiler/typecheck/TcMatches.lhs
ghc/compiler/typecheck/TcModule.lhs
ghc/compiler/typecheck/TcSimplify.lhs
ghc/compiler/types/Generics.lhs