summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghci
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2020-02-03 21:17:11 +0100
committerKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2020-02-12 23:58:52 +0100
commitdf08468113ab46832b7ac0a7311b608d1b418c4d (patch)
treede3a0ed40b58162976e4831625471b5702b2121f /testsuite/tests/ghci
parent6c2585e0816cb49487fa6a2be5b8e3f191cf3438 (diff)
downloadhaskell-df08468113ab46832b7ac0a7311b608d1b418c4d.tar.gz
Always display inferred variables using braces
We now always show "forall {a}. T" for inferred variables, previously this was controlled by -fprint-explicit-foralls. This implements part 1 of https://github.com/ghc-proposals/ghc-proposals/pull/179. Part of GHC ticket #16320. Furthermore, when printing a levity restriction error, we now display the HsWrap of the expression. This lets users see the full elaboration with -fprint-typechecker-elaboration (see also #17670)
Diffstat (limited to 'testsuite/tests/ghci')
-rw-r--r--testsuite/tests/ghci/scripts/T13202a.stderr2
-rw-r--r--testsuite/tests/ghci/scripts/T14969.stderr2
-rw-r--r--testsuite/tests/ghci/scripts/T16030.stdout16
-rw-r--r--testsuite/tests/ghci/scripts/T16804.stdout24
-rw-r--r--testsuite/tests/ghci/scripts/T6018ghcifail.stderr4
-rw-r--r--testsuite/tests/ghci/scripts/T7730.stdout4
-rw-r--r--testsuite/tests/ghci/scripts/T7873.stdout2
-rw-r--r--testsuite/tests/ghci/scripts/T7939.stdout8
-rw-r--r--testsuite/tests/ghci/should_run/T12549.stdout2
9 files changed, 32 insertions, 32 deletions
diff --git a/testsuite/tests/ghci/scripts/T13202a.stderr b/testsuite/tests/ghci/scripts/T13202a.stderr
index 93bc2bb3ef..8b1851f175 100644
--- a/testsuite/tests/ghci/scripts/T13202a.stderr
+++ b/testsuite/tests/ghci/scripts/T13202a.stderr
@@ -3,4 +3,4 @@
• Non type-variable argument in the constraint: HasField "name" r a
(Use FlexibleContexts to permit this)
• When checking the inferred type
- foo :: forall r a. HasField "name" r a => r -> a
+ foo :: forall {r} {a}. HasField "name" r a => r -> a
diff --git a/testsuite/tests/ghci/scripts/T14969.stderr b/testsuite/tests/ghci/scripts/T14969.stderr
index b581657d3c..13da943a3c 100644
--- a/testsuite/tests/ghci/scripts/T14969.stderr
+++ b/testsuite/tests/ghci/scripts/T14969.stderr
@@ -4,4 +4,4 @@
in the constraint: Num (t2 -> t1 -> t3)
(Use FlexibleContexts to permit this)
• When checking the inferred type
- it :: forall t1 t2 t3. (Num t1, Num (t2 -> t1 -> t3)) => t3
+ it :: forall {t1} {t2} {t3}. (Num t1, Num (t2 -> t1 -> t3)) => t3
diff --git a/testsuite/tests/ghci/scripts/T16030.stdout b/testsuite/tests/ghci/scripts/T16030.stdout
index 4efa27ce70..987453b9ea 100644
--- a/testsuite/tests/ghci/scripts/T16030.stdout
+++ b/testsuite/tests/ghci/scripts/T16030.stdout
@@ -1,28 +1,28 @@
type role Foo1 phantom
type Foo1 :: forall k. k -> *
data Foo1 a where
- MkFoo1a :: forall k (a :: k). Proxy a -> Int -> Foo1 a
- MkFoo1b :: forall k (a :: k). {a :: Proxy a, b :: Int} -> Foo1 a
+ MkFoo1a :: forall {k} (a :: k). Proxy a -> Int -> Foo1 a
+ MkFoo1b :: forall {k} (a :: k). {a :: Proxy a, b :: Int} -> Foo1 a
-- Defined at T16030.hs:8:1
type Foo2 :: forall k. k -> *
data family Foo2 a
-- Defined at T16030.hs:12:1
data instance forall k (a :: k). Foo2 a where
- MkFoo2a :: forall k (a :: k). Proxy a -> Int -> Foo2 a
- MkFoo2b :: forall k (a :: k). {c :: Proxy a, d :: Int} -> Foo2 a
+ MkFoo2a :: forall {k} (a :: k). Proxy a -> Int -> Foo2 a
+ MkFoo2b :: forall {k} (a :: k). {c :: Proxy a, d :: Int} -> Foo2 a
-- Defined at T16030.hs:13:15
type role Foo1 nominal phantom
type Foo1 :: forall k. k -> *
data Foo1 @k a where
- MkFoo1a :: forall k (a :: k). Proxy @{k} a -> Int -> Foo1 @k a
- MkFoo1b :: forall k (a :: k).
+ MkFoo1a :: forall {k} (a :: k). Proxy @{k} a -> Int -> Foo1 @k a
+ MkFoo1b :: forall {k} (a :: k).
{a :: Proxy @{k} a, b :: Int} -> Foo1 @k a
-- Defined at T16030.hs:8:1
type Foo2 :: forall k. k -> *
data family Foo2 @k a
-- Defined at T16030.hs:12:1
data instance forall k (a :: k). Foo2 @k a where
- MkFoo2a :: forall k (a :: k). Proxy @{k} a -> Int -> Foo2 @k a
- MkFoo2b :: forall k (a :: k).
+ MkFoo2a :: forall {k} (a :: k). Proxy @{k} a -> Int -> Foo2 @k a
+ MkFoo2b :: forall {k} (a :: k).
{c :: Proxy @{k} a, d :: Int} -> Foo2 @k a
-- Defined at T16030.hs:13:15
diff --git a/testsuite/tests/ghci/scripts/T16804.stdout b/testsuite/tests/ghci/scripts/T16804.stdout
index 897a42e48a..1c2d73b3c8 100644
--- a/testsuite/tests/ghci/scripts/T16804.stdout
+++ b/testsuite/tests/ghci/scripts/T16804.stdout
@@ -6,7 +6,7 @@ Collecting type info for 3 module(s) ...
% ^~~~~~^
>
% output:
-undefined :: forall a. a
+undefined :: forall {a}. a
% executing: ":uses T16804a.hs 1 8 1 14"
% file snippet:
@@ -22,7 +22,7 @@ undefined :: forall a. a
% ^~~^
>
% output:
-undefined :: forall a. a
+undefined :: forall {a}. a
% executing: ":type-at T16804a.hs 3 8 3 18 undefined"
% file snippet:
@@ -31,7 +31,7 @@ undefined :: forall a. a
% ^~~~~~~~~~^
>
% output:
-undefined :: forall a. a
+undefined :: forall {a}. a
% executing: ":type-at T16804a.hs 3 13 3 18 undefined"
% file snippet:
@@ -40,7 +40,7 @@ undefined :: forall a. a
% ^~~~~^
>
% output:
-undefined :: forall a. a
+undefined :: forall {a}. a
% executing: ":uses T16804a.hs 3 8 3 11"
% file snippet:
@@ -73,7 +73,7 @@ undefined :: forall a. a
% ^~~^
> deriving (Show)
% output:
-undefined :: forall a. a
+undefined :: forall {a}. a
% executing: ":type-at T16804a.hs 5 13 5 13 undefined"
% file snippet:
@@ -82,7 +82,7 @@ undefined :: forall a. a
% ^
> deriving (Show)
% output:
-undefined :: forall a. a
+undefined :: forall {a}. a
% executing: ":type-at T16804a.hs 5 15 5 15 undefined"
% file snippet:
@@ -91,7 +91,7 @@ undefined :: forall a. a
% ^
> deriving (Show)
% output:
-undefined :: forall a. a
+undefined :: forall {a}. a
% executing: ":type-at T16804a.hs 5 17 5 17 undefined"
% file snippet:
@@ -100,7 +100,7 @@ undefined :: forall a. a
% ^
> deriving (Show)
% output:
-undefined :: forall a. a
+undefined :: forall {a}. a
% executing: ":type-at T16804a.hs 6 13 6 16 undefined"
% file snippet:
@@ -160,7 +160,7 @@ T16804a.hs:(6,13)-(6,16)
% ^~~~~^
> mempty = A
% output:
-undefined :: forall a. a
+undefined :: forall {a}. a
% executing: ":type-at T16804a.hs 7 17 7 20 undefined"
% file snippet:
@@ -169,7 +169,7 @@ undefined :: forall a. a
% ^~~^
> mempty = A
% output:
-undefined :: forall a. a
+undefined :: forall {a}. a
% executing: ":type-at T16804a.hs 7 10 7 20 undefined"
% file snippet:
@@ -249,7 +249,7 @@ T16804a.hs:(8,3)-(8,8)
% ^~~~~~~~~~~^
> testFunction A B = True
% output:
-undefined :: forall a. a
+undefined :: forall {a}. a
% executing: ":type-at T16804a.hs 13 1 13 12 undefined"
% file snippet:
@@ -566,7 +566,7 @@ undefined :: Test
> B <> _ = B
% ^^
% output:
-undefined :: forall a. a
+undefined :: forall {a}. a
% executing: ":type-at T16804a.hs 29 8 29 8 undefined"
% file snippet:
diff --git a/testsuite/tests/ghci/scripts/T6018ghcifail.stderr b/testsuite/tests/ghci/scripts/T6018ghcifail.stderr
index bbea2d4398..30fbb0529f 100644
--- a/testsuite/tests/ghci/scripts/T6018ghcifail.stderr
+++ b/testsuite/tests/ghci/scripts/T6018ghcifail.stderr
@@ -59,7 +59,7 @@
Type family equation violates the family's injectivity annotation.
Type/kind variable ‘k’ cannot be inferred from the right-hand side.
In the type family equation:
- forall k (a :: k) (b :: k).
+ forall {k} {a :: k} {b :: k}.
Fc @k a b = Int -- Defined at <interactive>:64:15
<interactive>:68:15: error:
@@ -67,7 +67,7 @@
Type/kind variables ‘k’, ‘a’, ‘b’
cannot be inferred from the right-hand side.
In the type family equation:
- forall k (a :: k) (b :: k).
+ forall {k} {a :: k} {b :: k}.
Gc @k a b = Int -- Defined at <interactive>:68:15
<interactive>:81:15: error:
diff --git a/testsuite/tests/ghci/scripts/T7730.stdout b/testsuite/tests/ghci/scripts/T7730.stdout
index 9c3e385c71..4b0f1cea87 100644
--- a/testsuite/tests/ghci/scripts/T7730.stdout
+++ b/testsuite/tests/ghci/scripts/T7730.stdout
@@ -1,9 +1,9 @@
type role A phantom phantom
-type A :: forall k k1. k -> k1 -> *
+type A :: forall {k} {k1}. k -> k1 -> *
data A x y
-- Defined at <interactive>:2:1
A :: k1 -> k2 -> *
type role T phantom
-type T :: forall k. k -> *
+type T :: forall {k}. k -> *
data T a = forall a1. MkT a1
-- Defined at <interactive>:6:1
diff --git a/testsuite/tests/ghci/scripts/T7873.stdout b/testsuite/tests/ghci/scripts/T7873.stdout
index 4abcab8c18..4347c3b9f3 100644
--- a/testsuite/tests/ghci/scripts/T7873.stdout
+++ b/testsuite/tests/ghci/scripts/T7873.stdout
@@ -1,6 +1,6 @@
type D2 :: *
data D2
- = forall k. MkD2 (forall (p :: k -> *) (a :: k). p a -> Int)
+ = forall {k}. MkD2 (forall (p :: k -> *) (a :: k). p a -> Int)
-- Defined at <interactive>:3:1
type D3 :: *
data D3 = MkD3 (forall k (p :: k -> *) (a :: k). p a -> Int)
diff --git a/testsuite/tests/ghci/scripts/T7939.stdout b/testsuite/tests/ghci/scripts/T7939.stdout
index 1b6b04e3f9..93739d04dc 100644
--- a/testsuite/tests/ghci/scripts/T7939.stdout
+++ b/testsuite/tests/ghci/scripts/T7939.stdout
@@ -1,6 +1,6 @@
-type Foo :: forall k. k -> Constraint
+type Foo :: forall {k}. k -> Constraint
class Foo a where
- type Bar :: forall k. k -> * -> *
+ type Bar :: forall {k}. k -> * -> *
type family Bar a b
-- Defined at T7939.hs:6:4
Bar :: k -> * -> *
@@ -19,13 +19,13 @@ type family H a where
H 'False = 'True
-- Defined at T7939.hs:14:1
H :: Bool -> Bool
-type J :: forall k. [k] -> Bool
+type J :: forall {k}. [k] -> Bool
type family J a where
J '[] = 'False
forall k (h :: k) (t :: [k]). J (h : t) = 'True
-- Defined at T7939.hs:17:1
J :: [k] -> Bool
-type K :: forall a. [a] -> Maybe a
+type K :: forall {a}. [a] -> Maybe a
type family K a1 where
K '[] = 'Nothing
forall a (h :: a) (t :: [a]). K (h : t) = 'Just h
diff --git a/testsuite/tests/ghci/should_run/T12549.stdout b/testsuite/tests/ghci/should_run/T12549.stdout
index bd446f741a..8143b156c8 100644
--- a/testsuite/tests/ghci/should_run/T12549.stdout
+++ b/testsuite/tests/ghci/should_run/T12549.stdout
@@ -1,3 +1,3 @@
-f :: forall k1 k2 (a :: k1 -> k2 -> *) (b :: k1) (c :: k2).
+f :: forall {k1} {k2} {a :: k1 -> k2 -> *} {b :: k1} {c :: k2}.
C a =>
a b c