summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-11-07 17:24:47 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-11-19 11:53:55 -0500
commit08d595c026f0774c51d85cbd790518055970ff2d (patch)
tree706d776534998f69ed8cb62e3befa471bf4fdfdd /testsuite/tests/typecheck
parenta8adb5b4d782b6166160a80adbf6c59452dc964d (diff)
downloadhaskell-08d595c026f0774c51d85cbd790518055970ff2d.tar.gz
Give seq a more precise type and remove magic
`GHC.Prim.seq` previously had the rather plain type: seq :: forall a b. a -> b -> b However, it also had a special typing rule to applications where `b` is not of kind `Type`. Issue #17440 noted that levity polymorphism allows us to rather give it the more precise type: seq :: forall (r :: RuntimeRep) a (b :: TYPE r). a -> b -> b This allows us to remove the special typing rule that we previously required to allow applications on unlifted arguments. T9404 contains a non-Type application of `seq` which should verify that this works as expected. Closes #17440.
Diffstat (limited to 'testsuite/tests/typecheck')
-rw-r--r--testsuite/tests/typecheck/should_compile/T13050.stderr24
-rw-r--r--testsuite/tests/typecheck/should_compile/T14590.stderr32
-rw-r--r--testsuite/tests/typecheck/should_compile/abstract_refinement_hole_fits.stderr8
-rw-r--r--testsuite/tests/typecheck/should_compile/holes.stderr2
-rw-r--r--testsuite/tests/typecheck/should_compile/holes3.stderr2
5 files changed, 34 insertions, 34 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T13050.stderr b/testsuite/tests/typecheck/should_compile/T13050.stderr
index 36e22ae3f8..87b1312b4b 100644
--- a/testsuite/tests/typecheck/should_compile/T13050.stderr
+++ b/testsuite/tests/typecheck/should_compile/T13050.stderr
@@ -12,10 +12,6 @@ T13050.hs:4:9: warning: [-Wtyped-holes (in -Wdefault)]
f :: Int -> Int -> Int (bound at T13050.hs:4:1)
g :: Int -> Int -> Int (bound at T13050.hs:5:1)
q :: Int -> Int -> Int (bound at T13050.hs:6:1)
- seq :: forall a b. a -> b -> b
- with seq @Int @Int
- (imported from ‘Prelude’ at T13050.hs:1:8-17
- (and originally defined in ‘GHC.Prim’))
(-) :: forall a. Num a => a -> a -> a
with (-) @Int
(imported from ‘Prelude’ at T13050.hs:1:8-17
@@ -76,6 +72,10 @@ T13050.hs:4:9: warning: [-Wtyped-holes (in -Wdefault)]
with min @Int
(imported from ‘Prelude’ at T13050.hs:1:8-17
(and originally defined in ‘GHC.Classes’))
+ seq :: forall a b. a -> b -> b
+ with seq @Int @Int
+ (imported from ‘Prelude’ at T13050.hs:1:8-17
+ (and originally defined in ‘GHC.Prim’))
return :: forall (m :: * -> *) a. Monad m => a -> m a
with return @((->) Int) @Int
(imported from ‘Prelude’ at T13050.hs:1:8-17
@@ -98,10 +98,6 @@ T13050.hs:5:11: warning: [-Wtyped-holes (in -Wdefault)]
g :: Int -> Int -> Int (bound at T13050.hs:5:1)
f :: Int -> Int -> Int (defined at T13050.hs:4:1)
q :: Int -> Int -> Int (bound at T13050.hs:6:1)
- seq :: forall a b. a -> b -> b
- with seq @Int @Int
- (imported from ‘Prelude’ at T13050.hs:1:8-17
- (and originally defined in ‘GHC.Prim’))
(-) :: forall a. Num a => a -> a -> a
with (-) @Int
(imported from ‘Prelude’ at T13050.hs:1:8-17
@@ -162,6 +158,10 @@ T13050.hs:5:11: warning: [-Wtyped-holes (in -Wdefault)]
with min @Int
(imported from ‘Prelude’ at T13050.hs:1:8-17
(and originally defined in ‘GHC.Classes’))
+ seq :: forall a b. a -> b -> b
+ with seq @Int @Int
+ (imported from ‘Prelude’ at T13050.hs:1:8-17
+ (and originally defined in ‘GHC.Prim’))
return :: forall (m :: * -> *) a. Monad m => a -> m a
with return @((->) Int) @Int
(imported from ‘Prelude’ at T13050.hs:1:8-17
@@ -185,10 +185,6 @@ T13050.hs:6:11: warning: [-Wtyped-holes (in -Wdefault)]
q :: Int -> Int -> Int (bound at T13050.hs:6:1)
f :: Int -> Int -> Int (defined at T13050.hs:4:1)
g :: Int -> Int -> Int (defined at T13050.hs:5:1)
- seq :: forall a b. a -> b -> b
- with seq @Int @Int
- (imported from ‘Prelude’ at T13050.hs:1:8-17
- (and originally defined in ‘GHC.Prim’))
(-) :: forall a. Num a => a -> a -> a
with (-) @Int
(imported from ‘Prelude’ at T13050.hs:1:8-17
@@ -249,6 +245,10 @@ T13050.hs:6:11: warning: [-Wtyped-holes (in -Wdefault)]
with min @Int
(imported from ‘Prelude’ at T13050.hs:1:8-17
(and originally defined in ‘GHC.Classes’))
+ seq :: forall a b. a -> b -> b
+ with seq @Int @Int
+ (imported from ‘Prelude’ at T13050.hs:1:8-17
+ (and originally defined in ‘GHC.Prim’))
return :: forall (m :: * -> *) a. Monad m => a -> m a
with return @((->) Int) @Int
(imported from ‘Prelude’ at T13050.hs:1:8-17
diff --git a/testsuite/tests/typecheck/should_compile/T14590.stderr b/testsuite/tests/typecheck/should_compile/T14590.stderr
index 455898be1a..52ecc8335d 100644
--- a/testsuite/tests/typecheck/should_compile/T14590.stderr
+++ b/testsuite/tests/typecheck/should_compile/T14590.stderr
@@ -13,10 +13,6 @@ T14590.hs:4:13: warning: [-Wtyped-holes (in -Wdefault)]
f2 :: Int -> Int -> Int (bound at T14590.hs:5:1)
f3 :: Int -> Int -> Int (bound at T14590.hs:6:1)
f4 :: Int -> Int -> Int (bound at T14590.hs:7:1)
- seq :: forall a b. a -> b -> b
- with seq @Int @Int
- (imported from ‘Prelude’ at T14590.hs:1:8-13
- (and originally defined in ‘GHC.Prim’))
(-) :: forall a. Num a => a -> a -> a
with (-) @Int
(imported from ‘Prelude’ at T14590.hs:1:8-13
@@ -77,6 +73,10 @@ T14590.hs:4:13: warning: [-Wtyped-holes (in -Wdefault)]
with min @Int
(imported from ‘Prelude’ at T14590.hs:1:8-13
(and originally defined in ‘GHC.Classes’))
+ seq :: forall a b. a -> b -> b
+ with seq @Int @Int
+ (imported from ‘Prelude’ at T14590.hs:1:8-13
+ (and originally defined in ‘GHC.Prim’))
return :: forall (m :: * -> *) a. Monad m => a -> m a
with return @((->) Int) @Int
(imported from ‘Prelude’ at T14590.hs:1:8-13
@@ -101,10 +101,6 @@ T14590.hs:5:13: warning: [-Wtyped-holes (in -Wdefault)]
f1 :: Int -> Int -> Int (defined at T14590.hs:4:1)
f3 :: Int -> Int -> Int (bound at T14590.hs:6:1)
f4 :: Int -> Int -> Int (bound at T14590.hs:7:1)
- seq :: forall a b. a -> b -> b
- with seq @Int @Int
- (imported from ‘Prelude’ at T14590.hs:1:8-13
- (and originally defined in ‘GHC.Prim’))
(-) :: forall a. Num a => a -> a -> a
with (-) @Int
(imported from ‘Prelude’ at T14590.hs:1:8-13
@@ -165,6 +161,10 @@ T14590.hs:5:13: warning: [-Wtyped-holes (in -Wdefault)]
with min @Int
(imported from ‘Prelude’ at T14590.hs:1:8-13
(and originally defined in ‘GHC.Classes’))
+ seq :: forall a b. a -> b -> b
+ with seq @Int @Int
+ (imported from ‘Prelude’ at T14590.hs:1:8-13
+ (and originally defined in ‘GHC.Prim’))
return :: forall (m :: * -> *) a. Monad m => a -> m a
with return @((->) Int) @Int
(imported from ‘Prelude’ at T14590.hs:1:8-13
@@ -188,10 +188,6 @@ T14590.hs:6:11: warning: [-Wtyped-holes (in -Wdefault)]
f1 :: Int -> Int -> Int (defined at T14590.hs:4:1)
f2 :: Int -> Int -> Int (defined at T14590.hs:5:1)
f4 :: Int -> Int -> Int (bound at T14590.hs:7:1)
- seq :: forall a b. a -> b -> b
- with seq @Int @Int
- (imported from ‘Prelude’ at T14590.hs:1:8-13
- (and originally defined in ‘GHC.Prim’))
(-) :: forall a. Num a => a -> a -> a
with (-) @Int
(imported from ‘Prelude’ at T14590.hs:1:8-13
@@ -252,6 +248,10 @@ T14590.hs:6:11: warning: [-Wtyped-holes (in -Wdefault)]
with min @Int
(imported from ‘Prelude’ at T14590.hs:1:8-13
(and originally defined in ‘GHC.Classes’))
+ seq :: forall a b. a -> b -> b
+ with seq @Int @Int
+ (imported from ‘Prelude’ at T14590.hs:1:8-13
+ (and originally defined in ‘GHC.Prim’))
return :: forall (m :: * -> *) a. Monad m => a -> m a
with return @((->) Int) @Int
(imported from ‘Prelude’ at T14590.hs:1:8-13
@@ -276,10 +276,6 @@ T14590.hs:7:11: warning: [-Wtyped-holes (in -Wdefault)]
f1 :: Int -> Int -> Int (defined at T14590.hs:4:1)
f2 :: Int -> Int -> Int (defined at T14590.hs:5:1)
f3 :: Int -> Int -> Int (defined at T14590.hs:6:1)
- seq :: forall a b. a -> b -> b
- with seq @Int @Int
- (imported from ‘Prelude’ at T14590.hs:1:8-13
- (and originally defined in ‘GHC.Prim’))
(-) :: forall a. Num a => a -> a -> a
with (-) @Int
(imported from ‘Prelude’ at T14590.hs:1:8-13
@@ -340,6 +336,10 @@ T14590.hs:7:11: warning: [-Wtyped-holes (in -Wdefault)]
with min @Int
(imported from ‘Prelude’ at T14590.hs:1:8-13
(and originally defined in ‘GHC.Classes’))
+ seq :: forall a b. a -> b -> b
+ with seq @Int @Int
+ (imported from ‘Prelude’ at T14590.hs:1:8-13
+ (and originally defined in ‘GHC.Prim’))
return :: forall (m :: * -> *) a. Monad m => a -> m a
with return @((->) Int) @Int
(imported from ‘Prelude’ at T14590.hs:1:8-13
diff --git a/testsuite/tests/typecheck/should_compile/abstract_refinement_hole_fits.stderr b/testsuite/tests/typecheck/should_compile/abstract_refinement_hole_fits.stderr
index 227df63ecc..e422b8629e 100644
--- a/testsuite/tests/typecheck/should_compile/abstract_refinement_hole_fits.stderr
+++ b/testsuite/tests/typecheck/should_compile/abstract_refinement_hole_fits.stderr
@@ -108,10 +108,10 @@ abstract_refinement_hole_fits.hs:4:5: warning: [-Wtyped-holes (in -Wdefault)]
where fst :: forall a b. (a, b) -> a
snd (_ :: (a0, [Integer] -> Integer))
where snd :: forall a b. (a, b) -> b
- seq (_ :: a13) (_ :: [Integer] -> Integer)
- where seq :: forall a b. a -> b -> b
const (_ :: [Integer] -> Integer) (_ :: b6)
where const :: forall a b. a -> b -> a
+ seq (_ :: a13) (_ :: [Integer] -> Integer)
+ where seq :: forall a b. a -> b -> b
($) (_ :: a5 -> [Integer] -> Integer) (_ :: a5)
where ($) :: forall a b. (a -> b) -> a -> b
return (_ :: [Integer] -> Integer) (_ :: t1)
@@ -228,10 +228,10 @@ abstract_refinement_hole_fits.hs:7:5: warning: [-Wtyped-holes (in -Wdefault)]
where fst :: forall a b. (a, b) -> a
snd (_ :: (a0, Integer -> [Integer] -> Integer))
where snd :: forall a b. (a, b) -> b
- seq (_ :: a13) (_ :: Integer -> [Integer] -> Integer)
- where seq :: forall a b. a -> b -> b
const (_ :: Integer -> [Integer] -> Integer) (_ :: b6)
where const :: forall a b. a -> b -> a
+ seq (_ :: a13) (_ :: Integer -> [Integer] -> Integer)
+ where seq :: forall a b. a -> b -> b
($) (_ :: a5 -> Integer -> [Integer] -> Integer) (_ :: a5)
where ($) :: forall a b. (a -> b) -> a -> b
return (_ :: Integer -> [Integer] -> Integer) (_ :: t1)
diff --git a/testsuite/tests/typecheck/should_compile/holes.stderr b/testsuite/tests/typecheck/should_compile/holes.stderr
index 016c31372b..bcf7dc060d 100644
--- a/testsuite/tests/typecheck/should_compile/holes.stderr
+++ b/testsuite/tests/typecheck/should_compile/holes.stderr
@@ -164,7 +164,6 @@ holes.hs:11:15: warning: [-Wtyped-holes (in -Wdefault)]
quot :: forall a. Integral a => a -> a -> a
quotRem :: forall a. Integral a => a -> a -> (a, a)
rem :: forall a. Integral a => a -> a -> a
- seq :: forall a b. a -> b -> b
zip :: forall a b. [a] -> [b] -> [(a, b)]
fst :: forall a b. (a, b) -> a
snd :: forall a b. (a, b) -> b
@@ -185,6 +184,7 @@ holes.hs:11:15: warning: [-Wtyped-holes (in -Wdefault)]
a -> (b, a)
round :: forall a b. (RealFrac a, Integral b) => a -> b
truncate :: forall a b. (RealFrac a, Integral b) => a -> b
+ seq :: forall a b. a -> b -> b
($) :: forall a b. (a -> b) -> a -> b
either :: forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
curry :: forall a b c. ((a, b) -> c) -> a -> b -> c
diff --git a/testsuite/tests/typecheck/should_compile/holes3.stderr b/testsuite/tests/typecheck/should_compile/holes3.stderr
index bad5877d2e..7a8f513f25 100644
--- a/testsuite/tests/typecheck/should_compile/holes3.stderr
+++ b/testsuite/tests/typecheck/should_compile/holes3.stderr
@@ -167,7 +167,6 @@ holes3.hs:11:15: error:
quot :: forall a. Integral a => a -> a -> a
quotRem :: forall a. Integral a => a -> a -> (a, a)
rem :: forall a. Integral a => a -> a -> a
- seq :: forall a b. a -> b -> b
zip :: forall a b. [a] -> [b] -> [(a, b)]
fst :: forall a b. (a, b) -> a
snd :: forall a b. (a, b) -> b
@@ -188,6 +187,7 @@ holes3.hs:11:15: error:
a -> (b, a)
round :: forall a b. (RealFrac a, Integral b) => a -> b
truncate :: forall a b. (RealFrac a, Integral b) => a -> b
+ seq :: forall a b. a -> b -> b
($) :: forall a b. (a -> b) -> a -> b
either :: forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
curry :: forall a b c. ((a, b) -> c) -> a -> b -> c