diff options
author | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2021-08-06 19:35:24 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-09-17 09:35:53 -0400 |
commit | 4564f00fdeb5e072e8f91fec72a6393f0e3f0703 (patch) | |
tree | 9cbbc1791aac4c6cf07c08abf1c1c0f05f457e96 /testsuite | |
parent | 885f17c89919d21815365da71eb7f9c489e5bfa3 (diff) | |
download | haskell-4564f00fdeb5e072e8f91fec72a6393f0e3f0703.tar.gz |
Improve pretty-printer defaulting logic (#19361)
When determining whether to default a RuntimeRep or Multiplicity
variable, use isMetaTyVar to distinguish between metavariables
(which can be hidden) and skolems (which cannot).
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/linear/should_fail/T19361.hs | 9 | ||||
-rw-r--r-- | testsuite/tests/linear/should_fail/T19361.stderr | 10 | ||||
-rw-r--r-- | testsuite/tests/linear/should_fail/all.T | 1 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T15883b.stderr | 9 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T15883c.stderr | 9 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T15883d.stderr | 10 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T15883e.stderr | 10 |
7 files changed, 42 insertions, 16 deletions
diff --git a/testsuite/tests/linear/should_fail/T19361.hs b/testsuite/tests/linear/should_fail/T19361.hs new file mode 100644 index 0000000000..503b299a0b --- /dev/null +++ b/testsuite/tests/linear/should_fail/T19361.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE LinearTypes #-} + +module T19361 where + +f :: a %m -> a +f x = g x + +g :: a -> a +g x = x diff --git a/testsuite/tests/linear/should_fail/T19361.stderr b/testsuite/tests/linear/should_fail/T19361.stderr new file mode 100644 index 0000000000..1d7746786a --- /dev/null +++ b/testsuite/tests/linear/should_fail/T19361.stderr @@ -0,0 +1,10 @@ + +T19361.hs:6:3: error: + • Couldn't match type ‘m’ with ‘'Many’ + arising from multiplicity of ‘x’ + ‘m’ is a rigid type variable bound by + the type signature for: + f :: forall a. a -> a + at T19361.hs:5:1-14 + • In an equation for ‘f’: f x = g x + • Relevant bindings include f :: a %m -> a (bound at T19361.hs:6:1) diff --git a/testsuite/tests/linear/should_fail/all.T b/testsuite/tests/linear/should_fail/all.T index 89363cba85..4d8eec398e 100644 --- a/testsuite/tests/linear/should_fail/all.T +++ b/testsuite/tests/linear/should_fail/all.T @@ -39,3 +39,4 @@ test('T18888', normal, compile_fail, ['']) test('T18888_datakinds', normal, compile_fail, ['']) test('T19120', normal, compile_fail, ['']) test('T20083', normal, compile_fail, ['-XLinearTypes']) +test('T19361', normal, compile_fail, ['']) diff --git a/testsuite/tests/typecheck/should_fail/T15883b.stderr b/testsuite/tests/typecheck/should_fail/T15883b.stderr index 21b9305315..b3efbc1b41 100644 --- a/testsuite/tests/typecheck/should_fail/T15883b.stderr +++ b/testsuite/tests/typecheck/should_fail/T15883b.stderr @@ -1,6 +1,7 @@ -T15883b.hs:14:1: - Can't make a derived instance of + +T15883b.hs:14:1: error: + • Can't make a derived instance of ‘Eq (Foo ('BoxedRep 'Lifted))’ with the stock strategy: - Don't know how to derive ‘Eq’ for type ‘forall a. a’ - In the stand-alone deriving instance for + Don't know how to derive ‘Eq’ for type ‘forall (a :: TYPE rep). a’ + • In the stand-alone deriving instance for ‘Eq (Foo (BoxedRep Lifted))’ diff --git a/testsuite/tests/typecheck/should_fail/T15883c.stderr b/testsuite/tests/typecheck/should_fail/T15883c.stderr index 60678c4fcb..2aa1049fa5 100644 --- a/testsuite/tests/typecheck/should_fail/T15883c.stderr +++ b/testsuite/tests/typecheck/should_fail/T15883c.stderr @@ -1,6 +1,7 @@ -T15883c.hs:14:1: - Can't make a derived instance of + +T15883c.hs:14:1: error: + • Can't make a derived instance of ‘Ord (Foo ('BoxedRep 'Lifted))’ with the stock strategy: - Don't know how to derive ‘Ord’ for type ‘forall a. a’ - In the stand-alone deriving instance for + Don't know how to derive ‘Ord’ for type ‘forall (a :: TYPE rep). a’ + • In the stand-alone deriving instance for ‘Ord (Foo (BoxedRep Lifted))’ diff --git a/testsuite/tests/typecheck/should_fail/T15883d.stderr b/testsuite/tests/typecheck/should_fail/T15883d.stderr index 162b31072e..96a294bc9e 100644 --- a/testsuite/tests/typecheck/should_fail/T15883d.stderr +++ b/testsuite/tests/typecheck/should_fail/T15883d.stderr @@ -1,6 +1,8 @@ -T15883d.hs:14:1: - Can't make a derived instance of + +T15883d.hs:14:1: error: + • Can't make a derived instance of ‘Show (Foo ('BoxedRep 'Lifted))’ with the stock strategy: - Don't know how to derive ‘Show’ for type ‘forall a. a’ - In the stand-alone deriving instance for + Don't know how to derive ‘Show’ + for type ‘forall (a :: TYPE rep). a’ + • In the stand-alone deriving instance for ‘Show (Foo (BoxedRep Lifted))’ diff --git a/testsuite/tests/typecheck/should_fail/T15883e.stderr b/testsuite/tests/typecheck/should_fail/T15883e.stderr index a20b3f5d43..c7006fb790 100644 --- a/testsuite/tests/typecheck/should_fail/T15883e.stderr +++ b/testsuite/tests/typecheck/should_fail/T15883e.stderr @@ -1,6 +1,8 @@ -T15883e.hs:16:1: - Can't make a derived instance of + +T15883e.hs:16:1: error: + • Can't make a derived instance of ‘Data (Foo ('BoxedRep 'Lifted))’ with the stock strategy: - Don't know how to derive ‘Data’ for type ‘forall a. a’ - In the stand-alone deriving instance for + Don't know how to derive ‘Data’ + for type ‘forall (a :: TYPE rep). a’ + • In the stand-alone deriving instance for ‘Data (Foo (BoxedRep Lifted))’ |