[commit: ghc] wip/orf-reboot: Add test for presence of mangled selector name in error messages (d924909)
git at git.haskell.org
git at git.haskell.org
Fri Mar 27 15:46:55 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/orf-reboot
Link : http://ghc.haskell.org/trac/ghc/changeset/d924909cd1738121e9fcf0093d40890f048e41b5/ghc
>---------------------------------------------------------------
commit d924909cd1738121e9fcf0093d40890f048e41b5
Author: Adam Gundry <adam at well-typed.com>
Date: Fri Mar 20 14:02:24 2015 +0000
Add test for presence of mangled selector name in error messages
>---------------------------------------------------------------
d924909cd1738121e9fcf0093d40890f048e41b5
testsuite/tests/overloadedrecflds/should_fail/all.T | 1 +
.../overloadedrecflds/should_fail/overloadedrecfldsfail07.hs | 9 +++++++++
.../overloadedrecflds/should_fail/overloadedrecfldsfail07.stderr | 6 ++++++
3 files changed, 16 insertions(+)
diff --git a/testsuite/tests/overloadedrecflds/should_fail/all.T b/testsuite/tests/overloadedrecflds/should_fail/all.T
index 9fb862d..a8b9308 100644
--- a/testsuite/tests/overloadedrecflds/should_fail/all.T
+++ b/testsuite/tests/overloadedrecflds/should_fail/all.T
@@ -8,3 +8,4 @@ test('overloadedrecfldsfail05', normal, compile_fail, [''])
test('overloadedrecfldsfail06',
extra_clean(['OverloadedRecFldsFail06_A.hi', 'OverloadedRecFldsFail06_A.o']),
multimod_compile_fail, ['overloadedrecfldsfail06', ''])
+test('overloadedrecfldsfail07', normal, compile_fail, [''])
diff --git a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail07.hs b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail07.hs
new file mode 100644
index 0000000..fddab62
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail07.hs
@@ -0,0 +1,9 @@
+-- Test type errors contain field names, not selector names
+
+{-# LANGUAGE OverloadedRecordFields #-}
+
+data T = MkT { x :: Int }
+
+y = x x
+
+main = return ()
\ No newline at end of file
diff --git a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail07.stderr b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail07.stderr
new file mode 100644
index 0000000..87de242
--- /dev/null
+++ b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail07.stderr
@@ -0,0 +1,6 @@
+
+overloadedrecfldsfail07.hs:7:7:
+ Couldn't match expected type ‘T’ with actual type ‘T -> Int’
+ Probable cause: ‘x’ is applied to too few arguments
+ In the first argument of ‘x’, namely ‘x’
+ In the expression: x x
More information about the ghc-commits
mailing list