Lint should check that TyConAppCo doesn't have a synonym in the tycon position
authorSimon Peyton Jones <simonpj@microsoft.com>
Tue, 13 May 2014 12:15:45 +0000 (13:15 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Tue, 13 May 2014 12:17:31 +0000 (13:17 +0100)
That is why Lint didn't nail Trac #9102

compiler/coreSyn/CoreLint.lhs

index b5c7985..3d3deab 100644 (file)
@@ -856,6 +856,9 @@ lintCoercion co@(TyConAppCo r tc cos)
        ; checkRole co2 r r2
        ; return (rk, mkFunTy s1 s2, mkFunTy t1 t2, r) }
 
+  | isSynTyCon tc
+  = failWithL (ptext (sLit "Synonym in TyConAppCo:") <+> ppr co)
+
   | otherwise
   = do { (ks,ss,ts,rs) <- mapAndUnzip4M lintCoercion cos
        ; rk <- lint_co_app co (tyConKind tc) (ss `zip` ks)