diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2019-05-07 08:56:30 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-05-08 02:01:54 -0400 |
commit | 0eeb4cfad732d0b9b278c2274cb6db9633f9d3b5 (patch) | |
tree | b1a99dee78788fe2537f5c82570a4240196845fa /testsuite | |
parent | 786e665b8dac5430c02089b39f7cb7572a5254d8 (diff) | |
download | haskell-0eeb4cfad732d0b9b278c2274cb6db9633f9d3b5.tar.gz |
Fix #16632 by using the correct SrcSpan in checkTyClHdr
`checkTyClHdr`'s case for `HsTyVar` was grabbing the wrong `SrcSpan`,
which lead to error messages pointing to the wrong location. Easily
fixed.
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/indexed-types/should_compile/T16632.hs | 5 | ||||
-rw-r--r-- | testsuite/tests/indexed-types/should_compile/T16632.stderr | 6 | ||||
-rw-r--r-- | testsuite/tests/indexed-types/should_compile/all.T | 1 |
3 files changed, 12 insertions, 0 deletions
diff --git a/testsuite/tests/indexed-types/should_compile/T16632.hs b/testsuite/tests/indexed-types/should_compile/T16632.hs new file mode 100644 index 0000000000..ab4f8dc7ed --- /dev/null +++ b/testsuite/tests/indexed-types/should_compile/T16632.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE TypeFamilies #-} +module T16632 where + +type family F a b c +type instance F Char b Int = () diff --git a/testsuite/tests/indexed-types/should_compile/T16632.stderr b/testsuite/tests/indexed-types/should_compile/T16632.stderr new file mode 100644 index 0000000000..d2eab5c6b5 --- /dev/null +++ b/testsuite/tests/indexed-types/should_compile/T16632.stderr @@ -0,0 +1,6 @@ + +T16632.hs:5:22: warning: [-Wunused-type-patterns] + Defined but not used on the right hand side: type variable ‘b’ + | +5 | type instance F Char b Int = () + | ^ diff --git a/testsuite/tests/indexed-types/should_compile/all.T b/testsuite/tests/indexed-types/should_compile/all.T index bc0b509e05..c268f2638d 100644 --- a/testsuite/tests/indexed-types/should_compile/all.T +++ b/testsuite/tests/indexed-types/should_compile/all.T @@ -286,3 +286,4 @@ test('T15711', normal, compile, ['-ddump-types']) test('T15852', normal, compile, ['-ddump-types']) test('T15764a', normal, compile, ['']) test('T15740a', normal, compile, ['']) +test('T16632', normal, compile, ['-Wunused-type-patterns -fdiagnostics-show-caret']) |