From d6b91ea62e974969f203857deaa60f743e42513a Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Fri, 18 Dec 2015 17:22:15 +0100 Subject: [PATCH] Add test for T11122 Test Plan: validate Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1655 GHC Trac Issues: #11122 --- .../tests/partial-sigs/should_fail/T11122.hs | 28 +++++++++++++++++++ .../partial-sigs/should_fail/T11122.stderr | 7 +++++ .../tests/partial-sigs/should_fail/all.T | 2 +- 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 testsuite/tests/partial-sigs/should_fail/T11122.hs create mode 100644 testsuite/tests/partial-sigs/should_fail/T11122.stderr 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 -- GitLab