summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorRichard Eisenberg <eir@cis.upenn.edu>2015-09-20 16:15:13 -0400
committerRichard Eisenberg <eir@cis.upenn.edu>2015-09-21 10:53:40 -0400
commit8e8b9ed9849ba21e454e6204b368f8e993feaf7b (patch)
tree217ed768a77b90a35654279e609e472094fea916 /testsuite
parente27b267f3675180c03a75282dd952b8a59339a1f (diff)
downloadhaskell-8e8b9ed9849ba21e454e6204b368f8e993feaf7b.tar.gz
Run simplifier only when the env is clean.
This fixes #10896. In the indexed-types/should_fail/BadSock test, there is a bad type definition. This gets type-checked, an error gets reported, but then **GHC keeps going**. Later, when running the simplifier to do an ambiguity check, the bad type environment causes GHC to fall over. My solution: only run the simplifier in a clean, error-free type environment. A downside of this is that fewer error messages are reported. This makes me a bit sad, but I'm not sure how to avoid the problem. Suggestions welcome.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/typecheck/should_fail/T5300.stderr21
-rw-r--r--testsuite/tests/typecheck/should_fail/T8030.stderr15
2 files changed, 4 insertions, 32 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T5300.stderr b/testsuite/tests/typecheck/should_fail/T5300.stderr
index 851d017035..7e06b620d2 100644
--- a/testsuite/tests/typecheck/should_fail/T5300.stderr
+++ b/testsuite/tests/typecheck/should_fail/T5300.stderr
@@ -1,25 +1,10 @@
-T5300.hs:11:7:
- Could not deduce (C1 a b c0)
- from the context: (Monad m, C1 a b c)
- bound by the type signature for:
- f1 :: (Monad m, C1 a b c) => a -> StateT (T b) m a
- at T5300.hs:11:7-50
- The type variable ‘c0’ is ambiguous
- In the ambiguity check for the type signature for ‘f1’:
- f1 :: forall a b (m :: * -> *) c.
- (Monad m, C1 a b c) =>
- a -> StateT (T b) m a
- To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
- In the type signature for ‘f1’:
- f1 :: (Monad m, C1 a b c) => a -> StateT (T b) m a
-
-T5300.hs:14:7:
+T5300.hs:14:7: error:
Could not deduce (C2 a2 b2 c20)
from the context: (Monad m, C1 a1 b1 c1, C2 a2 b2 c2)
bound by the type signature for:
- f2 :: (Monad m, C1 a1 b1 c1, C2 a2 b2 c2) =>
- a1 -> StateT (T b2) m a2
+ f2 :: (Monad m, C1 a1 b1 c1, C2 a2 b2 c2) =>
+ a1 -> StateT (T b2) m a2
at T5300.hs:14:7-69
The type variable ‘c20’ is ambiguous
In the ambiguity check for the type signature for ‘f2’:
diff --git a/testsuite/tests/typecheck/should_fail/T8030.stderr b/testsuite/tests/typecheck/should_fail/T8030.stderr
index 8dd752ee42..831cf42edd 100644
--- a/testsuite/tests/typecheck/should_fail/T8030.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8030.stderr
@@ -1,5 +1,5 @@
-T8030.hs:9:3:
+T8030.hs:9:3: error:
Couldn't match expected type ‘Pr a’ with actual type ‘Pr a0’
NB: ‘Pr’ is a type function, and may not be injective
The type variable ‘a0’ is ambiguous
@@ -9,16 +9,3 @@ T8030.hs:9:3:
When checking the class method:
op1 :: forall (k :: BOX) (a :: k). C a => Pr a
In the class declaration for ‘C’
-
-T8030.hs:10:3:
- Couldn't match type ‘Pr a0’ with ‘Pr a’
- NB: ‘Pr’ is a type function, and may not be injective
- The type variable ‘a0’ is ambiguous
- Expected type: Pr a -> Pr a -> Pr a
- Actual type: Pr a0 -> Pr a0 -> Pr a0
- In the ambiguity check for the type signature for ‘op2’:
- op2 :: forall (k :: BOX) (a :: k). C a => Pr a -> Pr a -> Pr a
- To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
- When checking the class method:
- op2 :: forall (k :: BOX) (a :: k). C a => Pr a -> Pr a -> Pr a
- In the class declaration for ‘C’