diff options
author | Richard Eisenberg <rae@cs.brynmawr.edu> | 2018-04-02 09:39:19 -0400 |
---|---|---|
committer | Richard Eisenberg <rae@cs.brynmawr.edu> | 2018-04-02 09:42:48 -0400 |
commit | 07abff7192dcc9ce667d3c5cdb3f34ca8c87f2fb (patch) | |
tree | 0186be6bc578235b1cc2f3bed0a0649bd763844a | |
parent | 1845d1bce2e4edea4f5cc9de0d46631369268212 (diff) | |
download | haskell-07abff7192dcc9ce667d3c5cdb3f34ca8c87f2fb.tar.gz |
Test #14884, #14969
These were fixed by faec8d358985e5d0bf363bd96f23fe76c9e281f7
test cases: typecheck/should_fail/T14884
ghci/scripts/T14969
-rw-r--r-- | testsuite/tests/ghci/scripts/T14969.script | 1 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/T14969.stderr | 7 | ||||
-rwxr-xr-x | testsuite/tests/ghci/scripts/all.T | 1 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T14884.hs | 4 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T14884.stderr | 44 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/all.T | 1 |
6 files changed, 58 insertions, 0 deletions
diff --git a/testsuite/tests/ghci/scripts/T14969.script b/testsuite/tests/ghci/scripts/T14969.script new file mode 100644 index 0000000000..ab6af53c6b --- /dev/null +++ b/testsuite/tests/ghci/scripts/T14969.script @@ -0,0 +1 @@ +3 _ 4 diff --git a/testsuite/tests/ghci/scripts/T14969.stderr b/testsuite/tests/ghci/scripts/T14969.stderr new file mode 100644 index 0000000000..b581657d3c --- /dev/null +++ b/testsuite/tests/ghci/scripts/T14969.stderr @@ -0,0 +1,7 @@ + +<interactive>:1:1: error: + • Non type-variable argument + in the constraint: Num (t2 -> t1 -> t3) + (Use FlexibleContexts to permit this) + • When checking the inferred type + it :: forall t1 t2 t3. (Num t1, Num (t2 -> t1 -> t3)) => t3 diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index f0d90b66ac..06f1ec4875 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -264,3 +264,4 @@ test('T14342', [extra_hc_opts("-XOverloadedStrings -XRebindableSyntax")], ghci_script, ['T14342.script']) test('T14676', extra_files(['../prog002']), ghci_script, ['T14676.script']) test('T14796', normal, ghci_script, ['T14796.script']) +test('T14969', normal, ghci_script, ['T14969.script']) diff --git a/testsuite/tests/typecheck/should_fail/T14884.hs b/testsuite/tests/typecheck/should_fail/T14884.hs new file mode 100644 index 0000000000..d5d1545fe0 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T14884.hs @@ -0,0 +1,4 @@ +module T14884 where + +x :: IO () +x = _ print "abc" diff --git a/testsuite/tests/typecheck/should_fail/T14884.stderr b/testsuite/tests/typecheck/should_fail/T14884.stderr new file mode 100644 index 0000000000..5134d85c28 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T14884.stderr @@ -0,0 +1,44 @@ + +T14884.hs:4:5: error: + • Found hole: _ :: (a0 -> IO ()) -> [Char] -> IO () + Where: ‘a0’ is an ambiguous type variable + • In the expression: _ + In the expression: _ print "abc" + In an equation for ‘x’: x = _ print "abc" + • Relevant bindings include x :: IO () (bound at T14884.hs:4:1) + Valid substitutions include + foldMap :: forall (t :: * -> *). + Foldable t => + forall m a. Monoid m => (a -> m) -> t a -> m + (imported from ‘Prelude’ at T14884.hs:1:8-13 + (and originally defined in ‘Data.Foldable’)) + mapM_ :: forall (t :: * -> *) (m :: * -> *) a b. + (Foldable t, Monad m) => + (a -> m b) -> t a -> m () + (imported from ‘Prelude’ at T14884.hs:1:8-13 + (and originally defined in ‘Data.Foldable’)) + ($) :: forall a b. (a -> b) -> a -> b + (imported from ‘Prelude’ at T14884.hs:1:8-13 + (and originally defined in ‘GHC.Base’)) + ($!) :: forall a b. (a -> b) -> a -> b + (imported from ‘Prelude’ at T14884.hs:1:8-13 + (and originally defined in ‘GHC.Base’)) + id :: forall a. a -> a + (imported from ‘Prelude’ at T14884.hs:1:8-13 + (and originally defined in ‘GHC.Base’)) + +T14884.hs:4:7: error: + • Ambiguous type variable ‘a0’ arising from a use of ‘print’ + prevents the constraint ‘(Show a0)’ from being solved. + Probable fix: use a type annotation to specify what ‘a0’ should be. + These potential instances exist: + instance (Show a, Show b) => Show (Either a b) + -- Defined in ‘Data.Either’ + instance Show Ordering -- Defined in ‘GHC.Show’ + instance Show Integer -- Defined in ‘GHC.Show’ + ...plus 23 others + ...plus 64 instances involving out-of-scope types + (use -fprint-potential-instances to see them all) + • In the first argument of ‘_’, namely ‘print’ + In the expression: _ print "abc" + In an equation for ‘x’: x = _ print "abc" diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 3f791a763f..16fd5de56d 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -470,3 +470,4 @@ test('T14607', normal, compile_fail, ['']) test('T14605', normal, compile_fail, ['']) test('T14761a', normal, compile_fail, ['']) test('T14761b', normal, compile_fail, ['']) +test('T14884', normal, compile_fail, ['']) |