diff options
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/partial-sigs/should_fail/T11122.hs | 28 | ||||
-rw-r--r-- | testsuite/tests/partial-sigs/should_fail/T11122.stderr | 7 | ||||
-rw-r--r-- | testsuite/tests/partial-sigs/should_fail/all.T | 2 |
3 files changed, 36 insertions, 1 deletions
diff --git a/testsuite/tests/partial-sigs/should_fail/T11122.hs b/testsuite/tests/partial-sigs/should_fail/T11122.hs new file mode 100644 index 0000000000..5cf104d872 --- /dev/null +++ b/testsuite/tests/partial-sigs/should_fail/T11122.hs @@ -0,0 +1,28 @@ +{-# LANGUAGE NoMonomorphismRestriction #-} +{-# LANGUAGE PartialTypeSignatures #-} + +module T11122 where + +data Parser a + +instance Functor Parser where + fmap = undefined + +many p = undefined + +digit = undefined + +parseTest = undefined + +-------------------------------------------- + +parser :: Parser _ +--parser :: Parser Int +parser = read <$> many digit + +data Wrapper = Wrapper Int deriving Show + +wrapperParser = Wrapper <$> parser + +main :: IO () +main = parseTest wrapperParser "0" diff --git a/testsuite/tests/partial-sigs/should_fail/T11122.stderr b/testsuite/tests/partial-sigs/should_fail/T11122.stderr new file mode 100644 index 0000000000..57a74f9e58 --- /dev/null +++ b/testsuite/tests/partial-sigs/should_fail/T11122.stderr @@ -0,0 +1,7 @@ + +T11122.hs:19:18: warning: + • Found type wildcard ‘_’ standing for ‘Int’ + • In the type signature: + parser :: Parser _ + • Relevant bindings include + parser :: Parser Int (bound at T11122.hs:21:1) diff --git a/testsuite/tests/partial-sigs/should_fail/all.T b/testsuite/tests/partial-sigs/should_fail/all.T index dbbe9462db..2cb65f000b 100644 --- a/testsuite/tests/partial-sigs/should_fail/all.T +++ b/testsuite/tests/partial-sigs/should_fail/all.T @@ -60,4 +60,4 @@ test('WildcardInTypeSynonymRHS', normal, compile_fail, ['']) test('T10615', normal, compile_fail, ['']) test('T10045', normal, compile_fail, ['']) test('T10999', normal, compile_fail, ['']) - +test('T11122', normal, compile, [''])
\ No newline at end of file |