Add testcase for #9177 and adjust test output
authorJoachim Breitner <mail@joachim-breitner.de>
Fri, 6 Jun 2014 10:28:55 +0000 (12:28 +0200)
committerJoachim Breitner <mail@joachim-breitner.de>
Fri, 6 Jun 2014 11:16:48 +0000 (13:16 +0200)
testsuite/tests/module/mod132.stderr
testsuite/tests/module/mod134.stderr
testsuite/tests/module/mod73.stderr
testsuite/tests/rename/should_fail/T9177.hs [new file with mode: 0644]
testsuite/tests/rename/should_fail/T9177.stderr [new file with mode: 0644]
testsuite/tests/rename/should_fail/all.T
testsuite/tests/typecheck/should_fail/tcfail062.stderr

index 2735a73..0a9d25c 100644 (file)
@@ -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)
index e2171a8..d6e6f0e 100644 (file)
@@ -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)
index 432f61b..d19a032 100644 (file)
@@ -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 (file)
index 0000000..9fbb940
--- /dev/null
@@ -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 (file)
index 0000000..f87ec73
--- /dev/null
@@ -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)
index f4c3570..0f60ff6 100644 (file)
@@ -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, [''])
index 1396b53..ff4915d 100644 (file)
@@ -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)