import Unify ( coreRefineTys )
import Bag
import Literal ( literalType )
-import DataCon ( dataConRepType, isVanillaDataCon, dataConTyCon, dataConResTy )
+import DataCon ( dataConRepType, isVanillaDataCon, dataConTyCon, dataConResTy, dataConWorkId )
+import TysWiredIn ( tupleCon )
import Var ( Var, Id, TyVar, idType, tyVarKind, mustHaveLocalBinding )
import VarSet
import Name ( getSrcLoc )
TvSubst, TvSubstEnv, setTvSubstEnv, substTy,
extendTvSubst, isInScope )
import TyCon ( isPrimTyCon )
-import BasicTypes ( RecFlag(..), isNonRec )
+import BasicTypes ( RecFlag(..), Boxity(..), isNonRec )
import CmdLineOpts
import Outputable
\begin{code}
checkIdInScope :: Var -> LintM ()
checkIdInScope id
- = checkInScope (ptext SLIT("is out of scope")) id
+ = do { checkL (not (id == oneTupleDataConId))
+ (ptext SLIT("Illegal one-tuple"))
+ ; checkInScope (ptext SLIT("is out of scope")) id }
+
+oneTupleDataConId :: Id -- Should not happen
+oneTupleDataConId = dataConWorkId (tupleCon Boxed 1)
checkBndrIdInScope :: Var -> Var -> LintM ()
checkBndrIdInScope binder id