diff options
author | Kevin Buhr <buhr@asaurus.net> | 2019-05-09 21:46:48 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-05-29 10:38:30 -0400 |
commit | a5b14ad4764c5596331dd5a0abf0b0f6df6b0053 (patch) | |
tree | 027449363ffbd7a39238e738f6b4d03353ed3c6d /testsuite/tests | |
parent | 5bfd28f5cdf6ef41a08b7bfe2003aa9cc7914af1 (diff) | |
download | haskell-a5b14ad4764c5596331dd5a0abf0b0f6df6b0053.tar.gz |
Add test for old issue displaying unboxed tuples in error messages (#502)
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T502.hs | 10 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T502.stderr | 12 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/all.T | 1 |
3 files changed, 23 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T502.hs b/testsuite/tests/typecheck/should_fail/T502.hs new file mode 100644 index 0000000000..c73b7ac0e2 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T502.hs @@ -0,0 +1,10 @@ +{-# LANGUAGE MagicHash, UnboxedTuples #-} + +module T502 where + +-- As per #502, the following type error message should correctly +-- display the unboxed tuple type. +bar :: Int +bar = snd foo + where foo :: (# Int, Int #) + foo = undefined diff --git a/testsuite/tests/typecheck/should_fail/T502.stderr b/testsuite/tests/typecheck/should_fail/T502.stderr new file mode 100644 index 0000000000..ba5f6d157a --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T502.stderr @@ -0,0 +1,12 @@ + +T502.hs:8:11: error: + • Couldn't match expected type ‘(a0, Int)’ + with actual type ‘(# Int, Int #)’ + • In the first argument of ‘snd’, namely ‘foo’ + In the expression: snd foo + In an equation for ‘bar’: + bar + = snd foo + where + foo :: (# Int, Int #) + foo = undefined diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 5711753946..962febd640 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -515,3 +515,4 @@ test('T16204c', normal, compile_fail, ['']) test('T16394', normal, compile_fail, ['']) test('T16414', normal, compile_fail, ['']) test('T16627', normal, compile_fail, ['']) +test('T502', normal, compile_fail, ['']) |