diff options
19 files changed, 71 insertions, 7 deletions
diff --git a/testsuite/tests/deriving/should_fail/T5287.stderr b/testsuite/tests/deriving/should_fail/T5287.stderr index 479f1f84b5..f04fa0eb30 100644 --- a/testsuite/tests/deriving/should_fail/T5287.stderr +++ b/testsuite/tests/deriving/should_fail/T5287.stderr @@ -1,11 +1,15 @@ T5287.hs:7:10: error: • Could not deduce (A a oops0) + arising from a type ambiguity check for + an instance declaration from the context: A a oops bound by an instance declaration: forall a oops. A a oops => Read (D a) at T5287.hs:7:10-31 The type variable ‘oops0’ is ambiguous + These potential instance exist: + instance A Int Bool -- Defined at T5287.hs:13:10 • In the ambiguity check for an instance declaration To defer the ambiguity check to use sites, enable AllowAmbiguousTypes In the instance declaration for ‘Read (D a)’ diff --git a/testsuite/tests/partial-sigs/should_fail/NamedExtraConstraintsWildcard.stderr b/testsuite/tests/partial-sigs/should_fail/NamedExtraConstraintsWildcard.stderr index 146b0146eb..062f00acb1 100644 --- a/testsuite/tests/partial-sigs/should_fail/NamedExtraConstraintsWildcard.stderr +++ b/testsuite/tests/partial-sigs/should_fail/NamedExtraConstraintsWildcard.stderr @@ -1,6 +1,8 @@ NamedExtraConstraintsWildcard.hs:5:1: error: • Could not deduce: w0 + arising from a type ambiguity check for + the inferred type for ‘foo’ from the context: (Eq a, w) bound by the inferred type for ‘foo’: forall a {w :: Constraint}. (Eq a, w) => a -> a diff --git a/testsuite/tests/partial-sigs/should_fail/NamedWildcardsNotInMonotype.stderr b/testsuite/tests/partial-sigs/should_fail/NamedWildcardsNotInMonotype.stderr index 423fe1b040..bcc2fb018f 100644 --- a/testsuite/tests/partial-sigs/should_fail/NamedWildcardsNotInMonotype.stderr +++ b/testsuite/tests/partial-sigs/should_fail/NamedWildcardsNotInMonotype.stderr @@ -1,11 +1,20 @@ NamedWildcardsNotInMonotype.hs:5:1: error: • Could not deduce (Eq w0) + arising from a type ambiguity check for + the inferred type for ‘foo’ from the context: (Show a, Eq w, Eq a) bound by the inferred type for ‘foo’: forall {a} {w}. (Show a, Eq w, Eq a) => a -> a -> String at NamedWildcardsNotInMonotype.hs:5:1-33 The type variable ‘w0’ is ambiguous + These potential instances exist: + instance Eq Ordering -- Defined in ‘GHC.Classes’ + instance Eq a => Eq (Maybe a) -- Defined in ‘GHC.Maybe’ + instance Eq Integer -- Defined in ‘GHC.Num.Integer’ + ...plus 23 others + ...plus six instances involving out-of-scope types + (use -fprint-potential-instances to see them all) • In the ambiguity check for the inferred type for ‘foo’ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes When checking the inferred type diff --git a/testsuite/tests/typecheck/should_compile/InstanceGivenOverlap2.stderr b/testsuite/tests/typecheck/should_compile/InstanceGivenOverlap2.stderr index 4f125f6715..6e2a125982 100644 --- a/testsuite/tests/typecheck/should_compile/InstanceGivenOverlap2.stderr +++ b/testsuite/tests/typecheck/should_compile/InstanceGivenOverlap2.stderr @@ -1,6 +1,6 @@ InstanceGivenOverlap2.hs:40:1: error: - • Could not deduce (P a) + • Could not deduce (P a) arising from GHC Bug #20076 from the context: Q (F (Tagged t a)) bound by the inferred type for ‘g’: forall (t :: Bool) a. Q (F (Tagged t a)) => Proxy t -> [a] -> Int diff --git a/testsuite/tests/typecheck/should_compile/T13651.stderr b/testsuite/tests/typecheck/should_compile/T13651.stderr index 99d57d1c96..4902b8f9a4 100644 --- a/testsuite/tests/typecheck/should_compile/T13651.stderr +++ b/testsuite/tests/typecheck/should_compile/T13651.stderr @@ -1,6 +1,8 @@ T13651.hs:12:8: error: • Could not deduce: F cr (Bar h (Foo u)) ~ Bar h (Bar r u) + arising from a type ambiguity check for + the type signature for ‘foo’ from the context: (F cr cu ~ Bar h (Bar r u), F cu cs ~ Bar (Foo h) (Bar u s)) bound by the type signature for: @@ -8,12 +10,6 @@ T13651.hs:12:8: error: (F cr cu ~ Bar h (Bar r u), F cu cs ~ Bar (Foo h) (Bar u s)) => Bar h (Bar r u) -> Bar (Foo h) (Bar u s) -> Foo (cr -> cs) at T13651.hs:(12,8)-(14,65) - Expected: forall cr cu h r u cs s. - (F cr cu ~ Bar h (Bar r u), F cu cs ~ Bar (Foo h) (Bar u s)) => - Bar h (Bar r u) -> Bar (Foo h) (Bar u s) -> Foo (cr -> cs) - Actual: forall cr cu h r u cs s. - (F cr cu ~ Bar h (Bar r u), F cu cs ~ Bar (Foo h) (Bar u s)) => - Bar h (Bar r u) -> Bar (Foo h) (Bar u s) -> Foo (cr -> cs) • In the ambiguity check for ‘foo’ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes In the type signature: diff --git a/testsuite/tests/typecheck/should_compile/tc168.stderr b/testsuite/tests/typecheck/should_compile/tc168.stderr index 762f666153..632a334bad 100644 --- a/testsuite/tests/typecheck/should_compile/tc168.stderr +++ b/testsuite/tests/typecheck/should_compile/tc168.stderr @@ -1,6 +1,8 @@ tc168.hs:17:1: error: • Could not deduce (C a (a1, b0)) + arising from a type ambiguity check for + the inferred type for ‘g’ from the context: C a (a1, b) bound by the inferred type for ‘g’: forall {a} {a1} {b}. C a (a1, b) => a -> a1 diff --git a/testsuite/tests/typecheck/should_fail/ClassOperator.stderr b/testsuite/tests/typecheck/should_fail/ClassOperator.stderr index 78017f22ba..06d32d81aa 100644 --- a/testsuite/tests/typecheck/should_fail/ClassOperator.stderr +++ b/testsuite/tests/typecheck/should_fail/ClassOperator.stderr @@ -1,6 +1,8 @@ ClassOperator.hs:14:3: error: • Could not deduce (a ><> b0) + arising from a type ambiguity check for + the type signature for ‘**>’ from the context: a ><> b bound by the type signature for: (**>) :: forall a b. (a ><> b) => a -> a -> () @@ -14,6 +16,8 @@ ClassOperator.hs:14:3: error: ClassOperator.hs:14:3: error: • Could not deduce (a ><> b0) + arising from a type ambiguity check for + the type signature for ‘**<’ from the context: a ><> b bound by the type signature for: (**<) :: forall a b. (a ><> b) => a -> a -> () @@ -27,6 +31,8 @@ ClassOperator.hs:14:3: error: ClassOperator.hs:14:3: error: • Could not deduce (a ><> b0) + arising from a type ambiguity check for + the type signature for ‘>**’ from the context: a ><> b bound by the type signature for: (>**) :: forall a b. (a ><> b) => a -> a -> () @@ -40,6 +46,8 @@ ClassOperator.hs:14:3: error: ClassOperator.hs:14:3: error: • Could not deduce (a ><> b0) + arising from a type ambiguity check for + the type signature for ‘<**’ from the context: a ><> b bound by the type signature for: (<**) :: forall a b. (a ><> b) => a -> a -> () diff --git a/testsuite/tests/typecheck/should_fail/T11947a.stderr b/testsuite/tests/typecheck/should_fail/T11947a.stderr index 9ca1da0ee0..75b557fbb9 100644 --- a/testsuite/tests/typecheck/should_fail/T11947a.stderr +++ b/testsuite/tests/typecheck/should_fail/T11947a.stderr @@ -1,11 +1,16 @@ T11947a.hs:4:19: error: • Could not deduce (RealFloat a0) + arising from a type ambiguity check for + the type signature for ‘theFloatDigits’ from the context: RealFloat a bound by the type signature for: theFloatDigits :: forall a. RealFloat a => Int at T11947a.hs:4:19-46 The type variable ‘a0’ is ambiguous + These potential instances exist: + instance RealFloat Double -- Defined in ‘GHC.Float’ + instance RealFloat Float -- Defined in ‘GHC.Float’ • In the ambiguity check for ‘theFloatDigits’ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes In the type signature: diff --git a/testsuite/tests/typecheck/should_fail/T12151.stderr b/testsuite/tests/typecheck/should_fail/T12151.stderr index 8a4831c535..5b8a033d46 100644 --- a/testsuite/tests/typecheck/should_fail/T12151.stderr +++ b/testsuite/tests/typecheck/should_fail/T12151.stderr @@ -7,6 +7,8 @@ T12151.hs:9:13: error: T12151.hs:9:13: error: • Could not deduce (Put a0) + arising from a type ambiguity check for + the type signature for ‘put’ from the context: Put a bound by the type signature for: put :: forall a t. Put a => t diff --git a/testsuite/tests/typecheck/should_fail/T12918b.stderr b/testsuite/tests/typecheck/should_fail/T12918b.stderr index 3492ca6415..bbace81497 100644 --- a/testsuite/tests/typecheck/should_fail/T12918b.stderr +++ b/testsuite/tests/typecheck/should_fail/T12918b.stderr @@ -15,6 +15,8 @@ T12918b.hs:12:11: error: T12918b.hs:12:11: error: • Could not deduce (Foo1 a0) + arising from a type ambiguity check for + the type signature for ‘bar2’ from the context: Foo1 a bound by the type signature for: bar2 :: forall a x. Foo1 a => x diff --git a/testsuite/tests/typecheck/should_fail/T1897a.stderr b/testsuite/tests/typecheck/should_fail/T1897a.stderr index 2be4c938bb..e3219c103d 100644 --- a/testsuite/tests/typecheck/should_fail/T1897a.stderr +++ b/testsuite/tests/typecheck/should_fail/T1897a.stderr @@ -1,6 +1,8 @@ T1897a.hs:9:1: error: • Could not deduce (Wob a0 b) + arising from a type ambiguity check for + the inferred type for ‘foo’ from the context: Wob a b bound by the inferred type for ‘foo’: forall {a} {b}. Wob a b => b -> [b] diff --git a/testsuite/tests/typecheck/should_fail/T5300.stderr b/testsuite/tests/typecheck/should_fail/T5300.stderr index 06d870dff3..a0b24cea46 100644 --- a/testsuite/tests/typecheck/should_fail/T5300.stderr +++ b/testsuite/tests/typecheck/should_fail/T5300.stderr @@ -1,6 +1,8 @@ T5300.hs:12:7: error: • Could not deduce (C1 a b c0) + arising from a type ambiguity check for + the type signature for ‘f1’ from the context: (Monad m, C1 a b c) bound by the type signature for: f1 :: forall (m :: * -> *) a b c. @@ -15,6 +17,8 @@ T5300.hs:12:7: error: T5300.hs:15:7: error: • Could not deduce (C1 a1 b1 c10) + arising from a type ambiguity check for + the type signature for ‘f2’ from the context: (Monad m, C1 a1 b1 c1, C2 a2 b2 c2) bound by the type signature for: f2 :: forall (m :: * -> *) a1 b1 c1 a2 b2 c2. diff --git a/testsuite/tests/typecheck/should_fail/T7279.stderr b/testsuite/tests/typecheck/should_fail/T7279.stderr index eed8878170..4b0f27a24f 100644 --- a/testsuite/tests/typecheck/should_fail/T7279.stderr +++ b/testsuite/tests/typecheck/should_fail/T7279.stderr @@ -1,11 +1,20 @@ T7279.hs:6:10: error: • Could not deduce (Show b0) + arising from a type ambiguity check for + an instance declaration from the context: (Eq a, Show b) bound by an instance declaration: forall a b. (Eq a, Show b) => Eq (T a) at T7279.hs:6:10-35 The type variable ‘b0’ is ambiguous + These potential instances exist: + instance Show Ordering -- Defined in ‘GHC.Show’ + instance Show a => Show (Maybe a) -- Defined in ‘GHC.Show’ + instance Show Integer -- Defined in ‘GHC.Show’ + ...plus 23 others + ...plus 13 instances involving out-of-scope types + (use -fprint-potential-instances to see them all) • In the ambiguity check for an instance declaration To defer the ambiguity check to use sites, enable AllowAmbiguousTypes In the instance declaration for ‘Eq (T a)’ diff --git a/testsuite/tests/typecheck/should_fail/T7437.stderr b/testsuite/tests/typecheck/should_fail/T7437.stderr index 9b75781411..0f5e72041f 100644 --- a/testsuite/tests/typecheck/should_fail/T7437.stderr +++ b/testsuite/tests/typecheck/should_fail/T7437.stderr @@ -9,6 +9,8 @@ T7437.hs:14:13: error: T7437.hs:14:13: error: • Could not deduce (Put a0) + arising from a type ambiguity check for + the type signature for ‘put’ from the context: (Put a, Generic t, GPut (Rep t)) bound by the type signature for: put :: forall a t. (Put a, Generic t, GPut (Rep t)) => t -> [()] diff --git a/testsuite/tests/typecheck/should_fail/tcfail080.stderr b/testsuite/tests/typecheck/should_fail/tcfail080.stderr index c6d7fc5c90..c546cde0c9 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail080.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail080.stderr @@ -1,6 +1,8 @@ tcfail080.hs:27:1: error: • Could not deduce (Collection c0 a) + arising from a type ambiguity check for + the inferred type for ‘q’ from the context: Collection c a bound by the inferred type for ‘q’: forall {c :: * -> *} {a}. Collection c a => a -> Bool diff --git a/testsuite/tests/typecheck/should_fail/tcfail097.stderr b/testsuite/tests/typecheck/should_fail/tcfail097.stderr index bc8d9a0cf1..3af133a762 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail097.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail097.stderr @@ -1,11 +1,20 @@ tcfail097.hs:5:6: error: • Could not deduce (Eq a0) + arising from a type ambiguity check for + the type signature for ‘f’ from the context: Eq a bound by the type signature for: f :: forall a. Eq a => Int -> Int at tcfail097.hs:5:6-23 The type variable ‘a0’ is ambiguous + These potential instances exist: + instance Eq Ordering -- Defined in ‘GHC.Classes’ + instance Eq () -- Defined in ‘GHC.Classes’ + instance (Eq a, Eq b) => Eq (a, b) -- Defined in ‘GHC.Classes’ + ...plus 21 others + ...plus four instances involving out-of-scope types + (use -fprint-potential-instances to see them all) • In the ambiguity check for ‘f’ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes In the type signature: f :: Eq a => Int -> Int diff --git a/testsuite/tests/typecheck/should_fail/tcfail098.stderr b/testsuite/tests/typecheck/should_fail/tcfail098.stderr index a0c2735c26..98c8974c28 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail098.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail098.stderr @@ -1,6 +1,8 @@ tcfail098.hs:13:10: error: • Could not deduce (Bar a0) + arising from a type ambiguity check for + an instance declaration from the context: Bar a bound by an instance declaration: forall a. Bar a => Bar Bool diff --git a/testsuite/tests/typecheck/should_fail/tcfail116.stderr b/testsuite/tests/typecheck/should_fail/tcfail116.stderr index 83a76daf30..c525171295 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail116.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail116.stderr @@ -1,6 +1,8 @@ tcfail116.hs:7:5: error: • Could not deduce (Foo a0) + arising from a type ambiguity check for + the type signature for ‘bug’ from the context: Foo a bound by the type signature for: bug :: forall a. Foo a => () diff --git a/testsuite/tests/typecheck/should_fail/tcfail142.stderr b/testsuite/tests/typecheck/should_fail/tcfail142.stderr index ecb22021f3..dd2ee7733b 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail142.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail142.stderr @@ -1,6 +1,8 @@ tcfail142.hs:19:8: error: • Could not deduce (Bar a0 r) + arising from a type ambiguity check for + the type signature for ‘bar’ from the context: Bar a r bound by the type signature for: bar :: forall a r. Bar a r => r -> () |