patch applied (ghc): Add ad-hoc typing checks for tagToEnum#
Simon Peyton Jones
simonpj at microsoft.com
Wed Aug 16 16:46:53 EDT 2006
Wed Aug 16 13:31:56 PDT 2006 simonpj at microsoft.com
* Add ad-hoc typing checks for tagToEnum#
The problem with tagToEnum# is that it is not overloaded (in the
Haskell sense) but you are only supposed to apply it to a TyCon
that is an enumeration (isEnumerationTyCon).
The Real Way to do this is to have some special kind of type constraint
for the purpose, but that is wild overkill. So this patch adds a small
rather ad-hoc check to TcExpr.instFun. Crude, simple, but it works fine.
Fixes Trac #786
Test is tcfail164
M ./compiler/prelude/PrelRules.lhs -2 +2
M ./compiler/prelude/PrimOp.lhs +10
M ./compiler/typecheck/TcExpr.lhs -10 +55
More information about the Cvs-ghc
mailing list