summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghci/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/ghci/scripts')
-rwxr-xr-xtestsuite/tests/ghci/scripts/Defer02.script14
-rw-r--r--testsuite/tests/ghci/scripts/Defer02.stderr92
-rw-r--r--testsuite/tests/ghci/scripts/T3263.stderr8
-rw-r--r--testsuite/tests/ghci/scripts/T5130.stderr2
-rwxr-xr-x[-rw-r--r--]testsuite/tests/ghci/scripts/all.T1
-rw-r--r--testsuite/tests/ghci/scripts/ghci031.stderr4
-rw-r--r--testsuite/tests/ghci/scripts/ghci047.stderr4
-rw-r--r--testsuite/tests/ghci/scripts/ghci050.stderr17
-rw-r--r--testsuite/tests/ghci/scripts/ghci051.stderr4
9 files changed, 130 insertions, 16 deletions
diff --git a/testsuite/tests/ghci/scripts/Defer02.script b/testsuite/tests/ghci/scripts/Defer02.script
new file mode 100755
index 0000000000..3fc6aff5b0
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/Defer02.script
@@ -0,0 +1,14 @@
+-- Test -fwarn-type-errors
+-- This test shows how each error is printed at runtime
+:l ../../typecheck/should_run/Defer01
+t5624
+print a
+print (b B)
+print (c (C2 True))
+print (d ())
+print f
+print (h ())
+print (i ())
+print j
+print (k 2)
+l \ No newline at end of file
diff --git a/testsuite/tests/ghci/scripts/Defer02.stderr b/testsuite/tests/ghci/scripts/Defer02.stderr
new file mode 100644
index 0000000000..4a17b34d19
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/Defer02.stderr
@@ -0,0 +1,92 @@
+
+../../typecheck/should_run/Defer01.hs:11:40: Warning:
+ Couldn't match type `Char' with `[Char]'
+ Expected type: String
+ Actual type: Char
+ In the first argument of `putStr', namely ','
+ In the second argument of `(>>)', namely putStr ','
+ In the expression: putStr "Hello World" >> putStr ','
+
+../../typecheck/should_run/Defer01.hs:14:5: Warning:
+ Couldn't match expected type `Int' with actual type `Char'
+ In the expression: 'p'
+ In an equation for `a': a = 'p'
+
+../../typecheck/should_run/Defer01.hs:18:9: Warning:
+ No instance for (Eq B)
+ arising from a use of `=='
+ Possible fix: add an instance declaration for (Eq B)
+ In the expression: x == x
+ In an equation for `b': b x = x == x
+
+../../typecheck/should_run/Defer01.hs:28:5: Warning:
+ No instance for (Num (a -> a))
+ arising from the literal `1'
+ Possible fix: add an instance declaration for (Num (a -> a))
+ In the expression: 1
+ In an equation for `d': d = 1
+
+../../typecheck/should_run/Defer01.hs:31:5: Warning:
+ Couldn't match expected type `Char -> t' with actual type `Char'
+ The function `e' is applied to one argument,
+ but its type `Char' has none
+ In the expression: e 'q'
+ In an equation for `f': f = e 'q'
+
+../../typecheck/should_run/Defer01.hs:34:8: Warning:
+ Couldn't match expected type `a' with actual type `Char'
+ `a' is a rigid type variable bound by
+ the type signature for h :: a -> (Char, Char)
+ at ../../typecheck/should_run/Defer01.hs:34:1
+ In the expression: x
+ In the expression: (x, 'c')
+ In an equation for `h': h x = (x, 'c')
+
+../../typecheck/should_run/Defer01.hs:39:17: Warning:
+ Couldn't match expected type `Bool' with actual type `T a'
+ In the return type of a call of `K'
+ In the first argument of `not', namely `(K a)'
+ In the first argument of `seq', namely `(not (K a))'
+
+../../typecheck/should_run/Defer01.hs:43:5: Warning:
+ No instance for (MyClass a1)
+ arising from a use of `myOp'
+ The type variable `a1' is ambiguous
+ Possible fix: add a type signature that fixes these type variable(s)
+ In the expression: myOp 23
+ In an equation for `j': j = myOp 23
+
+../../typecheck/should_run/Defer01.hs:43:10: Warning:
+ No instance for (Num a1)
+ arising from the literal `23'
+ The type variable `a1' is ambiguous
+ Possible fix: add a type signature that fixes these type variable(s)
+ In the first argument of `myOp', namely `23'
+ In the expression: myOp 23
+ In an equation for `j': j = myOp 23
+
+../../typecheck/should_run/Defer01.hs:46:7: Warning:
+ Couldn't match expected type `Bool' with actual type `Int'
+ In the expression: x
+ In an equation for `k': k x = x
+
+../../typecheck/should_run/Defer01.hs:49:5: Warning:
+ Couldn't match expected type `IO a0'
+ with actual type `Char -> IO ()'
+ In the first argument of `(>>)', namely `putChar'
+ In the expression: putChar >> putChar 'p'
+ In an equation for `l': l = putChar >> putChar 'p'
+
+<interactive>:8:11:
+ Couldn't match type `Bool' with `Int'
+ Expected type: C Int
+ Actual type: C Bool
+ In the return type of a call of `C2'
+ In the first argument of `c', namely `(C2 True)'
+ In the first argument of `print', namely `(c (C2 True))'
+
+<interactive>:14:8:
+ Couldn't match expected type `Bool' with actual type `Int'
+ In the first argument of `print', namely `(k 2)'
+ In the expression: print (k 2)
+ In an equation for `it': it = print (k 2)
diff --git a/testsuite/tests/ghci/scripts/T3263.stderr b/testsuite/tests/ghci/scripts/T3263.stderr
index a7924e4b7f..b8c47887e4 100644
--- a/testsuite/tests/ghci/scripts/T3263.stderr
+++ b/testsuite/tests/ghci/scripts/T3263.stderr
@@ -1,5 +1,5 @@
-T3263.hs:8:12:
- Warning: A do-notation statement discarded a result of type Char.
- Suppress this warning by saying "_ <- getChar",
- or by using the flag -fno-warn-unused-do-bind
+T3263.hs:8:12: Warning:
+ A do-notation statement discarded a result of type Char.
+ Suppress this warning by saying "_ <- getChar",
+ or by using the flag -fno-warn-unused-do-bind
diff --git a/testsuite/tests/ghci/scripts/T5130.stderr b/testsuite/tests/ghci/scripts/T5130.stderr
index b68777e594..3c31593991 100644
--- a/testsuite/tests/ghci/scripts/T5130.stderr
+++ b/testsuite/tests/ghci/scripts/T5130.stderr
@@ -1,6 +1,6 @@
<interactive>:3:27:
- Couldn't match type `a' with `[Char]'
+ Couldn't match expected type `a' with actual type `[Char]'
In the expression: "hi"
In the expression: [x, "hi"]
In the expression: (\ (x :: a, y :: a) -> [x, "hi"])
diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T
index d8c1501915..b559dcf099 100644..100755
--- a/testsuite/tests/ghci/scripts/all.T
+++ b/testsuite/tests/ghci/scripts/all.T
@@ -108,3 +108,4 @@ test('T5557', normal, ghci_script, ['T5557.script'])
test('T5566', normal, ghci_script, ['T5566.script'])
test('GhciKinds', normal, ghci_script, ['GhciKinds.script'])
test('T5564', normal, ghci_script, ['T5564.script'])
+test('Defer02', normal, ghci_script, ['Defer02.script']) \ No newline at end of file
diff --git a/testsuite/tests/ghci/scripts/ghci031.stderr b/testsuite/tests/ghci/scripts/ghci031.stderr
index 8e4256c7f4..6f72f603e1 100644
--- a/testsuite/tests/ghci/scripts/ghci031.stderr
+++ b/testsuite/tests/ghci/scripts/ghci031.stderr
@@ -1,3 +1,3 @@
-ghci031.hs:1:14:
- Warning: -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language.
+ghci031.hs:1:14: Warning:
+ -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language.
diff --git a/testsuite/tests/ghci/scripts/ghci047.stderr b/testsuite/tests/ghci/scripts/ghci047.stderr
index 1807dcb866..0051710378 100644
--- a/testsuite/tests/ghci/scripts/ghci047.stderr
+++ b/testsuite/tests/ghci/scripts/ghci047.stderr
@@ -1,12 +1,16 @@
<interactive>:38:1:
Couldn't match type `HFalse' with `HTrue'
+ Expected type: HTrue
+ Actual type: Or HFalse HFalse
In the expression: f
In the expression: f $ Baz 'a'
In an equation for `it': it = f $ Baz 'a'
<interactive>:39:1:
Couldn't match type `HFalse' with `HTrue'
+ Expected type: HTrue
+ Actual type: Or HFalse HFalse
In the expression: f
In the expression: f $ Quz
In an equation for `it': it = f $ Quz
diff --git a/testsuite/tests/ghci/scripts/ghci050.stderr b/testsuite/tests/ghci/scripts/ghci050.stderr
index 6f0e2c2ff2..74dc9a9b94 100644
--- a/testsuite/tests/ghci/scripts/ghci050.stderr
+++ b/testsuite/tests/ghci/scripts/ghci050.stderr
@@ -1,8 +1,9 @@
-
-<interactive>:6:49:
- Couldn't match type `a' with `ListableElem (a, a)'
- `a' is a rigid type variable bound by
- the instance declaration at <interactive>:6:20
- In the expression: a
- In the expression: [a, b]
- In an equation for `asList': asList (a, b) = [a, b]
+
+<interactive>:6:49:
+ Couldn't match expected type `a'
+ with actual type `ListableElem (a, a)'
+ `a' is a rigid type variable bound by
+ the instance declaration at <interactive>:6:20
+ In the expression: a
+ In the expression: [a, b]
+ In an equation for `asList': asList (a, b) = [a, b]
diff --git a/testsuite/tests/ghci/scripts/ghci051.stderr b/testsuite/tests/ghci/scripts/ghci051.stderr
index 3a78849813..130d0012a2 100644
--- a/testsuite/tests/ghci/scripts/ghci051.stderr
+++ b/testsuite/tests/ghci/scripts/ghci051.stderr
@@ -1,5 +1,7 @@
<interactive>:7:9:
- Couldn't match expected type T' with actual type `T'
+ Couldn't match type `T' with `main::Interactive.T'
+ Expected type: T'
+ Actual type: T
In the expression: C :: T'
In an equation for `c': c = C :: T'