[commit: ghc] ghc-7.8: Lint should check that TyConAppCo doesn't have a synonym in the tycon position (0fe1f41)

git at git.haskell.org git at git.haskell.org
Wed Jul 2 17:39:33 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-7.8
Link       : http://ghc.haskell.org/trac/ghc/changeset/0fe1f41ed7f351e6a8b6e8f7e4f6b5b859e7d06c/ghc

>---------------------------------------------------------------

commit 0fe1f41ed7f351e6a8b6e8f7e4f6b5b859e7d06c
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Tue May 13 13:15:45 2014 +0100

    Lint should check that TyConAppCo doesn't have a synonym in the tycon position
    
    That is why Lint didn't nail Trac #9102
    
    (cherry picked from commit 4cfc1fae11ec9a5c4b34ac747f0ce50f52423eba)


>---------------------------------------------------------------

0fe1f41ed7f351e6a8b6e8f7e4f6b5b859e7d06c
 compiler/coreSyn/CoreLint.lhs | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/compiler/coreSyn/CoreLint.lhs b/compiler/coreSyn/CoreLint.lhs
index b5c7985..3d3deab 100644
--- a/compiler/coreSyn/CoreLint.lhs
+++ b/compiler/coreSyn/CoreLint.lhs
@@ -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)



More information about the ghc-commits mailing list