diff options
author | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2023-05-08 18:48:33 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-05-11 04:12:44 -0400 |
commit | bd0b056ea56643bcca1a23b78f72576f9459ce1b (patch) | |
tree | 80f367d3e3a93df079897335c238834b15c1c6ff /testsuite | |
parent | c17bb82f1cc66cb819acbfc7727a6b366097a323 (diff) | |
download | haskell-bd0b056ea56643bcca1a23b78f72576f9459ce1b.tar.gz |
Add a test for #17284
Since !10123 we now reject this program.
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T17284.hs | 9 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T17284.stderr | 4 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/all.T | 1 |
3 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T17284.hs b/testsuite/tests/typecheck/should_fail/T17284.hs new file mode 100644 index 0000000000..d32dce2ba0 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T17284.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE MonomorphismRestriction #-} +{-# LANGUAGE PartialTypeSignatures #-} + +module MonoPoly where + +f :: Num a => a -> _ +f x = x + y + +y = f 1 diff --git a/testsuite/tests/typecheck/should_fail/T17284.stderr b/testsuite/tests/typecheck/should_fail/T17284.stderr new file mode 100644 index 0000000000..992f147089 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T17284.stderr @@ -0,0 +1,4 @@ + +T17284.hs:6:1: error: [GHC-16675] + Overloaded signature conflicts with monomorphism restriction + [partial signature] f :: Num a => a -> _ diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index f13dd45b08..f62ee5e355 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -681,3 +681,4 @@ test('LazyFieldsDisabled', normal, compile_fail, ['']) test('TyfamsDisabled', normal, compile_fail, ['']) test('CommonFieldResultTypeMismatch', normal, compile_fail, ['']) test('CommonFieldTypeMismatch', normal, compile_fail, ['']) +test('T17284', normal, compile_fail, ['']) |