diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2015-06-18 08:54:11 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2015-06-18 08:54:11 +0100 |
commit | 5879d5aab929e9959d48e03dad456b824160b3bf (patch) | |
tree | d9c9d012dc9a06f2e0c77fc487ff5a58a8130df1 /testsuite/tests/gadt | |
parent | 023a0ba938b69bbb89cb2ce48a07459b07783391 (diff) | |
download | haskell-5879d5aab929e9959d48e03dad456b824160b3bf.tar.gz |
Report arity errors correctly despite kinds
Trac #10516 pointed out that when reporting arity errors
(like "T needs 2 arguments but has been given 1"), we should
not count kind arguments, since they are implicit. If we
include kind args in the count, we get very confusing error
messages indeed.
I did a little bit of refactoring which make some
error messages wobble around. But the payload of
this fix is in TcValidity.tyConArityErr
Diffstat (limited to 'testsuite/tests/gadt')
-rw-r--r-- | testsuite/tests/gadt/T3163.stderr | 10 | ||||
-rw-r--r-- | testsuite/tests/gadt/gadt11.stderr | 12 | ||||
-rw-r--r-- | testsuite/tests/gadt/gadtSyntaxFail001.stderr | 14 | ||||
-rw-r--r-- | testsuite/tests/gadt/gadtSyntaxFail002.stderr | 14 | ||||
-rw-r--r-- | testsuite/tests/gadt/gadtSyntaxFail003.stderr | 14 | ||||
-rw-r--r-- | testsuite/tests/gadt/records-fail1.stderr | 10 |
6 files changed, 37 insertions, 37 deletions
diff --git a/testsuite/tests/gadt/T3163.stderr b/testsuite/tests/gadt/T3163.stderr index 5daca38050..095378b540 100644 --- a/testsuite/tests/gadt/T3163.stderr +++ b/testsuite/tests/gadt/T3163.stderr @@ -1,5 +1,5 @@ - -T3163.hs:8:5: - Illegal polymorphic or qualified type: forall s. s - In the definition of data constructor ‘Unreached’ - In the data declaration for ‘Taker’ +
+T3163.hs:8:5: error:
+ Illegal polymorphic or qualified type: forall s. s
+ In the definition of data constructor ‘Unreached’
+ In the data type declaration for ‘Taker’
diff --git a/testsuite/tests/gadt/gadt11.stderr b/testsuite/tests/gadt/gadt11.stderr index 016fd2bd75..1dba9b0a40 100644 --- a/testsuite/tests/gadt/gadt11.stderr +++ b/testsuite/tests/gadt/gadt11.stderr @@ -1,6 +1,6 @@ - -gadt11.hs:12:3: - Data constructor ‘L2’ returns type ‘T1 Bool’ - instead of an instance of its parent type ‘T2 a’ - In the definition of data constructor ‘L2’ - In the data declaration for ‘T2’ +
+gadt11.hs:12:3: error:
+ Data constructor ‘L2’ returns type ‘T1 Bool’
+ instead of an instance of its parent type ‘T2 a’
+ In the definition of data constructor ‘L2’
+ In the data type declaration for ‘T2’
diff --git a/testsuite/tests/gadt/gadtSyntaxFail001.stderr b/testsuite/tests/gadt/gadtSyntaxFail001.stderr index 54fa5f992b..e92272d5c2 100644 --- a/testsuite/tests/gadt/gadtSyntaxFail001.stderr +++ b/testsuite/tests/gadt/gadtSyntaxFail001.stderr @@ -1,7 +1,7 @@ - -gadtSyntaxFail001.hs:8:5: - Data constructor ‘C2’ has existential type variables, a context, or a specialised result type - C2 :: forall a. a -> Char -> Foo a Int - (Use ExistentialQuantification or GADTs to allow this) - In the definition of data constructor ‘C2’ - In the data declaration for ‘Foo’ +
+gadtSyntaxFail001.hs:8:5: error:
+ Data constructor ‘C2’ has existential type variables, a context, or a specialised result type
+ C2 :: forall a. a -> Char -> Foo a Int
+ (Use ExistentialQuantification or GADTs to allow this)
+ In the definition of data constructor ‘C2’
+ In the data type declaration for ‘Foo’
diff --git a/testsuite/tests/gadt/gadtSyntaxFail002.stderr b/testsuite/tests/gadt/gadtSyntaxFail002.stderr index 194275b528..4a969aaa49 100644 --- a/testsuite/tests/gadt/gadtSyntaxFail002.stderr +++ b/testsuite/tests/gadt/gadtSyntaxFail002.stderr @@ -1,7 +1,7 @@ - -gadtSyntaxFail002.hs:8:5: - Data constructor ‘C2’ has existential type variables, a context, or a specialised result type - C2 :: forall a. a -> Char -> Foo a a - (Use ExistentialQuantification or GADTs to allow this) - In the definition of data constructor ‘C2’ - In the data declaration for ‘Foo’ +
+gadtSyntaxFail002.hs:8:5: error:
+ Data constructor ‘C2’ has existential type variables, a context, or a specialised result type
+ C2 :: forall a. a -> Char -> Foo a a
+ (Use ExistentialQuantification or GADTs to allow this)
+ In the definition of data constructor ‘C2’
+ In the data type declaration for ‘Foo’
diff --git a/testsuite/tests/gadt/gadtSyntaxFail003.stderr b/testsuite/tests/gadt/gadtSyntaxFail003.stderr index 22f1f41ea9..f8fbeff079 100644 --- a/testsuite/tests/gadt/gadtSyntaxFail003.stderr +++ b/testsuite/tests/gadt/gadtSyntaxFail003.stderr @@ -1,7 +1,7 @@ - -gadtSyntaxFail003.hs:7:5: - Data constructor ‘C1’ has existential type variables, a context, or a specialised result type - C1 :: forall b a c. a -> Int -> c -> Foo b a - (Use ExistentialQuantification or GADTs to allow this) - In the definition of data constructor ‘C1’ - In the data declaration for ‘Foo’ +
+gadtSyntaxFail003.hs:7:5: error:
+ Data constructor ‘C1’ has existential type variables, a context, or a specialised result type
+ C1 :: forall b a c. a -> Int -> c -> Foo b a
+ (Use ExistentialQuantification or GADTs to allow this)
+ In the definition of data constructor ‘C1’
+ In the data type declaration for ‘Foo’
diff --git a/testsuite/tests/gadt/records-fail1.stderr b/testsuite/tests/gadt/records-fail1.stderr index aca4d7fea8..6fd871cbf7 100644 --- a/testsuite/tests/gadt/records-fail1.stderr +++ b/testsuite/tests/gadt/records-fail1.stderr @@ -1,5 +1,5 @@ - -records-fail1.hs:7:1: - Constructors T1 and T4 have a common field ‘x’, - but have different result types - In the data declaration for ‘T’ +
+records-fail1.hs:7:1: error:
+ Constructors T1 and T4 have a common field ‘x’,
+ but have different result types
+ In the data type declaration for ‘T’
|