diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2014-05-13 13:15:45 +0100 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2014-07-02 12:17:37 -0500 |
commit | 0fe1f41ed7f351e6a8b6e8f7e4f6b5b859e7d06c (patch) | |
tree | 43a143bbf88f4b230193d2a01f461bc63c56ac13 | |
parent | 4ca496c5c4aa565e945f4c25b8d278317d5ee4da (diff) | |
download | haskell-0fe1f41ed7f351e6a8b6e8f7e4f6b5b859e7d06c.tar.gz |
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)
-rw-r--r-- | compiler/coreSyn/CoreLint.lhs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/coreSyn/CoreLint.lhs b/compiler/coreSyn/CoreLint.lhs index b5c79855f2..3d3deab839 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) |