summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2015-11-23 08:35:44 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2015-11-23 17:22:15 +0000
commit5955510e5f57464b1f4f42b510e3558d6e691380 (patch)
tree93ee8e103c2f09adc832eabb5178c337f2e33e95 /testsuite/tests
parent947156236aeced67bb53db7f963013594d3b7bc3 (diff)
downloadhaskell-5955510e5f57464b1f4f42b510e3558d6e691380.tar.gz
Improve constraint-used-as-type error msg
This responds to Trac #11112 by improving the error message when the kind checker discovers something of kind Constraint used when a type is expected
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/indexed-types/should_fail/SimpleFail14.stderr4
-rw-r--r--testsuite/tests/typecheck/should_fail/T11112.hs4
-rw-r--r--testsuite/tests/typecheck/should_fail/T11112.stderr4
-rw-r--r--testsuite/tests/typecheck/should_fail/T3540.stderr20
-rw-r--r--testsuite/tests/typecheck/should_fail/all.T1
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail057.stderr4
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail146.stderr4
7 files changed, 25 insertions, 16 deletions
diff --git a/testsuite/tests/indexed-types/should_fail/SimpleFail14.stderr b/testsuite/tests/indexed-types/should_fail/SimpleFail14.stderr
index 666f725ff1..59b5c138ad 100644
--- a/testsuite/tests/indexed-types/should_fail/SimpleFail14.stderr
+++ b/testsuite/tests/indexed-types/should_fail/SimpleFail14.stderr
@@ -1,6 +1,6 @@
-SimpleFail14.hs:5:15:
- Expected a type, but ‘a ~ a’ has kind ‘Constraint’
+SimpleFail14.hs:5:15: error:
+ Constraint ‘a ~ a’ used as a type
In the type ‘a ~ a’
In the definition of data constructor ‘T’
In the data declaration for ‘T’
diff --git a/testsuite/tests/typecheck/should_fail/T11112.hs b/testsuite/tests/typecheck/should_fail/T11112.hs
new file mode 100644
index 0000000000..9ebd503f11
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T11112.hs
@@ -0,0 +1,4 @@
+module T11112 where
+
+sort :: Ord s -> [s] -> [s]
+sort xs = xs
diff --git a/testsuite/tests/typecheck/should_fail/T11112.stderr b/testsuite/tests/typecheck/should_fail/T11112.stderr
new file mode 100644
index 0000000000..da0ab532a7
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T11112.stderr
@@ -0,0 +1,4 @@
+
+T11112.hs:3:9: error:
+ Constraint ‘Ord s’ used as a type
+ In the type signature for ‘sort’: sort :: Ord s -> [s] -> [s]
diff --git a/testsuite/tests/typecheck/should_fail/T3540.stderr b/testsuite/tests/typecheck/should_fail/T3540.stderr
index 3c447bb1e5..9867b7401e 100644
--- a/testsuite/tests/typecheck/should_fail/T3540.stderr
+++ b/testsuite/tests/typecheck/should_fail/T3540.stderr
@@ -1,20 +1,20 @@
-T3540.hs:4:12:
- Expected a type, but ‘a ~ Int’ has kind ‘Constraint’
+T3540.hs:4:12: error:
+ Constraint ‘a ~ Int’ used as a type
In the type signature for ‘thing’: thing :: a ~ Int
-T3540.hs:7:20:
- Expected a type, but ‘a ~ Int’ has kind ‘Constraint’
+T3540.hs:7:20: error:
+ Constraint ‘a ~ Int’ used as a type
In the type signature for ‘thing1’: thing1 :: Int -> (a ~ Int)
-T3540.hs:10:13:
- Expected a type, but ‘a ~ Int’ has kind ‘Constraint’
+T3540.hs:10:13: error:
+ Constraint ‘a ~ Int’ used as a type
In the type signature for ‘thing2’: thing2 :: (a ~ Int) -> Int
-T3540.hs:13:12:
- Expected a type, but ‘?dude :: Int’ has kind ‘Constraint’
+T3540.hs:13:12: error:
+ Constraint ‘?dude :: Int’ used as a type
In the type signature for ‘thing3’: thing3 :: (?dude :: Int) -> Int
-T3540.hs:16:11:
- Expected a type, but ‘Eq a’ has kind ‘Constraint’
+T3540.hs:16:11: error:
+ Constraint ‘Eq a’ used as a type
In the type signature for ‘thing4’: thing4 :: (Eq a) -> Int
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index 9f0434e1ae..2670ba4a5f 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -393,5 +393,6 @@ test('T10971d', extra_clean(['T10971c.hi', 'T10971c.o']), multimod_compile_fail,
test('CustomTypeErrors01', normal, compile_fail, [''])
test('CustomTypeErrors02', normal, compile_fail, [''])
test('CustomTypeErrors03', normal, compile_fail, [''])
+test('T11112', normal, compile_fail, [''])
diff --git a/testsuite/tests/typecheck/should_fail/tcfail057.stderr b/testsuite/tests/typecheck/should_fail/tcfail057.stderr
index d581207afa..9323ae7579 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail057.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail057.stderr
@@ -1,4 +1,4 @@
-tcfail057.hs:5:7:
- Expected a type, but ‘RealFrac a’ has kind ‘Constraint’
+tcfail057.hs:5:7: error:
+ Constraint ‘RealFrac a’ used as a type
In the type signature for ‘f’: f :: (RealFrac a) -> a -> a
diff --git a/testsuite/tests/typecheck/should_fail/tcfail146.stderr b/testsuite/tests/typecheck/should_fail/tcfail146.stderr
index 6d8cb0e5e6..c1cce251a9 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail146.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail146.stderr
@@ -1,6 +1,6 @@
-tcfail146.hs:7:22:
- Expected a type, but ‘SClass a’ has kind ‘Constraint’
+tcfail146.hs:7:22: error:
+ Constraint ‘SClass a’ used as a type
In the type ‘SClass a’
In the definition of data constructor ‘SCon’
In the data declaration for ‘SData’