summaryrefslogtreecommitdiff
path: root/testsuite/tests/rename/should_fail
diff options
context:
space:
mode:
authorRichard Eisenberg <eir@cis.upenn.edu>2015-12-11 18:19:53 -0500
committerRichard Eisenberg <eir@cis.upenn.edu>2015-12-11 18:23:12 -0500
commit6746549772c5cc0ac66c0fce562f297f4d4b80a2 (patch)
tree96869fcfb5757651462511d64d99a3712f09e7fb /testsuite/tests/rename/should_fail
parent6e56ac58a6905197412d58e32792a04a63b94d7e (diff)
downloadhaskell-6746549772c5cc0ac66c0fce562f297f4d4b80a2.tar.gz
Add kind equalities to GHC.
This implements the ideas originally put forward in "System FC with Explicit Kind Equality" (ICFP'13). There are several noteworthy changes with this patch: * We now have casts in types. These change the kind of a type. See new constructor `CastTy`. * All types and all constructors can be promoted. This includes GADT constructors. GADT pattern matches take place in type family equations. In Core, types can now be applied to coercions via the `CoercionTy` constructor. * Coercions can now be heterogeneous, relating types of different kinds. A coercion proving `t1 :: k1 ~ t2 :: k2` proves both that `t1` and `t2` are the same and also that `k1` and `k2` are the same. * The `Coercion` type has been significantly enhanced. The documentation in `docs/core-spec/core-spec.pdf` reflects the new reality. * The type of `*` is now `*`. No more `BOX`. * Users can write explicit kind variables in their code, anywhere they can write type variables. For backward compatibility, automatic inference of kind-variable binding is still permitted. * The new extension `TypeInType` turns on the new user-facing features. * Type families and synonyms are now promoted to kinds. This causes trouble with parsing `*`, leading to the somewhat awkward new `HsAppsTy` constructor for `HsType`. This is dispatched with in the renamer, where the kind `*` can be told apart from a type-level multiplication operator. Without `-XTypeInType` the old behavior persists. With `-XTypeInType`, you need to import `Data.Kind` to get `*`, also known as `Type`. * The kind-checking algorithms in TcHsType have been significantly rewritten to allow for enhanced kinds. * The new features are still quite experimental and may be in flux. * TODO: Several open tickets: #11195, #11196, #11197, #11198, #11203. * TODO: Update user manual. Tickets addressed: #9017, #9173, #7961, #10524, #8566, #11142. Updates Haddock submodule.
Diffstat (limited to 'testsuite/tests/rename/should_fail')
-rw-r--r--testsuite/tests/rename/should_fail/T2993.stderr8
-rw-r--r--testsuite/tests/rename/should_fail/rnfail026.stderr23
-rw-r--r--testsuite/tests/rename/should_fail/rnfail055.stderr3
3 files changed, 20 insertions, 14 deletions
diff --git a/testsuite/tests/rename/should_fail/T2993.stderr b/testsuite/tests/rename/should_fail/T2993.stderr
index 44582b33dc..257e9d434b 100644
--- a/testsuite/tests/rename/should_fail/T2993.stderr
+++ b/testsuite/tests/rename/should_fail/T2993.stderr
@@ -1,4 +1,4 @@
-
-T2993.hs:7:13: error:
- Variable not in scope: (<**>) :: t1 -> (a -> a) -> t
- Perhaps you meant ‘<*>’ (imported from Prelude)
+
+T2993.hs:7:13: error:
+ Variable not in scope: (<**>) :: t -> (a -> a) -> t1
+ Perhaps you meant ‘<*>’ (imported from Prelude)
diff --git a/testsuite/tests/rename/should_fail/rnfail026.stderr b/testsuite/tests/rename/should_fail/rnfail026.stderr
index f220f81812..bc717ec163 100644
--- a/testsuite/tests/rename/should_fail/rnfail026.stderr
+++ b/testsuite/tests/rename/should_fail/rnfail026.stderr
@@ -1,9 +1,14 @@
-
-rnfail026.hs:16:27: error:
- The first argument of ‘Monad’ should have kind ‘* -> *’,
- but ‘Eq a => Set a’ has kind ‘*’
- In the instance declaration for ‘Monad (forall a. Eq a => Set a)’
-
-rnfail026.hs:19:10: error:
- Illegal polymorphic or qualified type: forall a. [a]
- In the instance declaration for ‘Eq (forall a. [a])’
+
+rnfail026.hs:16:10: error:
+ • Illegal polymorphic or qualified type: forall a1. Eq a1 => Set a1
+ • In the instance declaration for ‘Monad (forall a. Eq a => Set a)’
+
+rnfail026.hs:16:27: error:
+ • Expected kind ‘* -> *’, but ‘Set a’ has kind ‘*’
+ • In the first argument of ‘Monad’, namely
+ ‘forall a. Eq a => Set a’
+ In the instance declaration for ‘Monad (forall a. Eq a => Set a)’
+
+rnfail026.hs:19:10: error:
+ • Illegal polymorphic or qualified type: forall a1. [a1]
+ • In the instance declaration for ‘Eq (forall a. [a])’
diff --git a/testsuite/tests/rename/should_fail/rnfail055.stderr b/testsuite/tests/rename/should_fail/rnfail055.stderr
index d87054e926..e7e6a3a817 100644
--- a/testsuite/tests/rename/should_fail/rnfail055.stderr
+++ b/testsuite/tests/rename/should_fail/rnfail055.stderr
@@ -73,7 +73,8 @@ RnFail055.hs-boot:25:1: error:
Main module: type role T7 phantom
data T7 a where
T7 :: a1 -> T7 a
- Boot file: data T7 a = T7 a
+ Boot file: data T7 a where
+ T7 :: a -> T7 a
The roles do not match.
Roles on abstract types default to ‘representational’ in boot files.
The constructors do not match: The types for ‘T7’ differ