diff options
author | Kirill Zaborsky <qrilka@gmail.com> | 2018-06-15 14:12:58 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-06-15 14:13:09 -0400 |
commit | 42f3b53b5bc4674e41f16de08094821fe1aaec00 (patch) | |
tree | 2c7d4355a4c1ecb90a2bece332ebac03a3c0fc71 /compiler | |
parent | 7100850eebb1c1aec0aaabca08915bac8b90e188 (diff) | |
download | haskell-42f3b53b5bc4674e41f16de08094821fe1aaec00.tar.gz |
Fix #13833: accept type literals with no FlexibleInstances
Test Plan: ./validate
Reviewers: bgamari, simonpj
Reviewed By: bgamari, simonpj
Subscribers: simonpj, rwbarton, thomie, carter
GHC Trac Issues: #13833
Differential Revision: https://phabricator.haskell.org/D4823
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/typecheck/TcValidity.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/typecheck/TcValidity.hs b/compiler/typecheck/TcValidity.hs index 84309db598..6d866f795d 100644 --- a/compiler/typecheck/TcValidity.hs +++ b/compiler/typecheck/TcValidity.hs @@ -1121,12 +1121,13 @@ tcInstHeadTyNotSynonym ty tcInstHeadTyAppAllTyVars :: Type -> Bool -- Used in Haskell-98 mode, for the argument types of an instance head --- These must be a constructor applied to type variable arguments. +-- These must be a constructor applied to type variable arguments +-- or a type-level literal. -- But we allow kind instantiations. tcInstHeadTyAppAllTyVars ty | Just (tc, tys) <- tcSplitTyConApp_maybe (dropCasts ty) = ok (filterOutInvisibleTypes tc tys) -- avoid kinds - + | LitTy _ <- ty = True -- accept type literals (Trac #13833) | otherwise = False where |