diff options
author | David Terei <code@davidterei.com> | 2014-08-04 17:41:54 -0400 |
---|---|---|
committer | David Terei <code@davidterei.com> | 2014-11-06 11:12:39 -0800 |
commit | c96a613c98d07fab4facc77bdd0701b7a17d332a (patch) | |
tree | e9fd30270158a763e7c535df343a45c4f5b2a981 /testsuite/tests/safeHaskell/safeInfered | |
parent | 91c15d65187c98bf7be5e71a247501f97611867a (diff) | |
download | haskell-c96a613c98d07fab4facc77bdd0701b7a17d332a.tar.gz |
Add in Incoherent Instances test for Safe Haskell.
Diffstat (limited to 'testsuite/tests/safeHaskell/safeInfered')
3 files changed, 20 insertions, 0 deletions
diff --git a/testsuite/tests/safeHaskell/safeInfered/UnsafeInfered17.hs b/testsuite/tests/safeHaskell/safeInfered/UnsafeInfered17.hs new file mode 100644 index 0000000000..04591b5f77 --- /dev/null +++ b/testsuite/tests/safeHaskell/safeInfered/UnsafeInfered17.hs @@ -0,0 +1,10 @@ +{-# OPTIONS_GHC -fwarn-unsafe -Werror #-} +{-# LANGUAGE FlexibleInstances #-} +module UnsafeInfered15 where + +class C a where + f :: a -> String + +instance {-# INCOHERENT #-} C a where + f _ = "a" + diff --git a/testsuite/tests/safeHaskell/safeInfered/UnsafeInfered17.stderr b/testsuite/tests/safeHaskell/safeInfered/UnsafeInfered17.stderr new file mode 100644 index 0000000000..415e9a1f37 --- /dev/null +++ b/testsuite/tests/safeHaskell/safeInfered/UnsafeInfered17.stderr @@ -0,0 +1,9 @@ + +UnsafeInfered17.hs:1:16: Warning: + ‘UnsafeInfered15’ has been inferred as unsafe! + Reason: + UnsafeInfered17.hs:8:29: + [incoherent] overlap mode isn't allowed in Safe Haskell + +<no location info>: +Failing due to -Werror. diff --git a/testsuite/tests/safeHaskell/safeInfered/all.T b/testsuite/tests/safeHaskell/safeInfered/all.T index a9600fa1c2..4fc9fcecb8 100644 --- a/testsuite/tests/safeHaskell/safeInfered/all.T +++ b/testsuite/tests/safeHaskell/safeInfered/all.T @@ -64,6 +64,7 @@ test('UnsafeInfered13', normal, compile_fail, ['']) test('UnsafeInfered14', normal, compile_fail, ['']) test('UnsafeInfered15', normal, compile_fail, ['']) test('UnsafeInfered16', normal, compile_fail, ['']) +test('UnsafeInfered17', normal, compile_fail, ['']) # Mixed tests test('Mixed01', normal, compile_fail, ['']) |