summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Breitner <mail@joachim-breitner.de>2014-06-06 12:28:55 +0200
committerJoachim Breitner <mail@joachim-breitner.de>2014-06-06 12:28:55 +0200
commitb8a1a8a2657eff72bcf9ee2c174403a424dfd3fa (patch)
tree37f3621cc3f9febcd3de522ace99b2e18aeee78e
parent03e03cebead92e7211697a2abde43fd7d8b03b78 (diff)
downloadhaskell-wip/T9177.tar.gz
Add testcase for #9177 and adjust test outputwip/T9177
-rw-r--r--testsuite/tests/module/mod132.stderr4
-rw-r--r--testsuite/tests/module/mod134.stderr2
-rw-r--r--testsuite/tests/module/mod73.stderr6
-rw-r--r--testsuite/tests/rename/should_fail/T9177.hs17
-rw-r--r--testsuite/tests/rename/should_fail/T9177.stderr20
-rw-r--r--testsuite/tests/rename/should_fail/all.T1
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail062.stderr2
7 files changed, 47 insertions, 5 deletions
diff --git a/testsuite/tests/module/mod132.stderr b/testsuite/tests/module/mod132.stderr
index 2735a73dad..0a9d25cda8 100644
--- a/testsuite/tests/module/mod132.stderr
+++ b/testsuite/tests/module/mod132.stderr
@@ -1,2 +1,4 @@
-mod132.hs:6:7: Not in scope: data constructor ‘Foo’
+mod132.hs:6:7:
+ Not in scope: data constructor ‘Foo’
+ Perhaps you meant variable ‘foo’ (line 6)
diff --git a/testsuite/tests/module/mod134.stderr b/testsuite/tests/module/mod134.stderr
index e2171a8c6d..d6e6f0e30b 100644
--- a/testsuite/tests/module/mod134.stderr
+++ b/testsuite/tests/module/mod134.stderr
@@ -4,4 +4,4 @@ mod134.hs:6:19:
Perhaps you meant one of these:
‘Prelude.read’ (imported from Prelude),
‘Prelude.reads’ (imported from Prelude),
- ‘Prelude.snd’ (imported from Prelude)
+ data constructor ‘Prelude.Left’ (imported from Prelude)
diff --git a/testsuite/tests/module/mod73.stderr b/testsuite/tests/module/mod73.stderr
index 432f61b549..d19a032cef 100644
--- a/testsuite/tests/module/mod73.stderr
+++ b/testsuite/tests/module/mod73.stderr
@@ -2,6 +2,6 @@
mod73.hs:3:7:
Not in scope: ‘Prelude.g’
Perhaps you meant one of these:
- ‘Prelude.id’ (imported from Prelude),
- ‘Prelude.log’ (imported from Prelude),
- ‘Prelude.pi’ (imported from Prelude)
+ data constructor ‘Prelude.GT’ (imported from Prelude),
+ data constructor ‘Prelude.EQ’ (imported from Prelude),
+ data constructor ‘Prelude.LT’ (imported from Prelude)
diff --git a/testsuite/tests/rename/should_fail/T9177.hs b/testsuite/tests/rename/should_fail/T9177.hs
new file mode 100644
index 0000000000..9fbb9407be
--- /dev/null
+++ b/testsuite/tests/rename/should_fail/T9177.hs
@@ -0,0 +1,17 @@
+module T9177 where
+
+-- the main use case
+type Foo = (int)
+
+-- other interesting cases
+type Foo2 = (integerr)
+
+foo3 = bar
+foo4 = Fun
+
+-- this warning is suboptimal (fun would be illegal here)
+foo5 Fun = ()
+
+-- No errors here:
+data Bar = Bar
+fun x = x
diff --git a/testsuite/tests/rename/should_fail/T9177.stderr b/testsuite/tests/rename/should_fail/T9177.stderr
new file mode 100644
index 0000000000..f87ec732af
--- /dev/null
+++ b/testsuite/tests/rename/should_fail/T9177.stderr
@@ -0,0 +1,20 @@
+
+T9177.hs:4:13:
+ Not in scope: type variable ‘int’
+ Perhaps you meant type constructor or class ‘Int’ (imported from Prelude)
+
+T9177.hs:7:14:
+ Not in scope: type variable ‘integerr’
+ Perhaps you meant type constructor or class ‘Integer’ (imported from Prelude)
+
+T9177.hs:9:8:
+ Not in scope: ‘bar’
+ Perhaps you meant data constructor ‘Bar’ (line 14)
+
+T9177.hs:10:8:
+ Not in scope: data constructor ‘Fun’
+ Perhaps you meant variable ‘fun’ (line 15)
+
+T9177.hs:11:6:
+ Not in scope: data constructor ‘Fun’
+ Perhaps you meant variable ‘fun’ (line 15)
diff --git a/testsuite/tests/rename/should_fail/all.T b/testsuite/tests/rename/should_fail/all.T
index f4c3570d3d..0f60ff6175 100644
--- a/testsuite/tests/rename/should_fail/all.T
+++ b/testsuite/tests/rename/should_fail/all.T
@@ -114,3 +114,4 @@ test('T8448', normal, compile_fail, [''])
test('T9006',
extra_clean(['T9006a.hi', 'T9006a.o']),
multimod_compile_fail, ['T9006', '-v0'])
+test('T9177', normal, compile_fail, [''])
diff --git a/testsuite/tests/typecheck/should_fail/tcfail062.stderr b/testsuite/tests/typecheck/should_fail/tcfail062.stderr
index 1396b536ee..ff4915dfd2 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail062.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail062.stderr
@@ -1,6 +1,8 @@
tcfail062.hs:34:6:
Not in scope: type variable ‘behaviouralExpression’
+ Perhaps you meant type constructor or class ‘BehaviouralExpression’ (line 25)
tcfail062.hs:34:29:
Not in scope: type variable ‘behaviouralExpression’
+ Perhaps you meant type constructor or class ‘BehaviouralExpression’ (line 25)