diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2016-06-11 23:49:27 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2016-06-13 10:57:03 +0100 |
commit | 15b9bf4ba4ab47e6809bf2b3b36ec16e502aea72 (patch) | |
tree | e2e7336c63e9b7130ba70f3551ff290d4a25184b /testsuite/tests/partial-sigs/should_compile | |
parent | d25cb61a1c2a135a2564143a332f8b2962f134bc (diff) | |
download | haskell-15b9bf4ba4ab47e6809bf2b3b36ec16e502aea72.tar.gz |
Improve typechecking of let-bindings
This major commit was initially triggered by #11339, but it spiraled
into a major review of the way in which type signatures for bindings
are handled, especially partial type signatures. On the way I fixed a
number of other bugs, namely
#12069
#12033
#11700
#11339
#11670
The main change is that I completely reorganised the way in which type
signatures in bindings are handled. The new story is in TcSigs
Note [Overview of type signatures]. Some specific:
* Changes in the data types for signatures in TcRnTypes:
TcIdSigInfo and new TcIdSigInst
* New module TcSigs deals with typechecking type signatures
and pragmas. It contains code mostly moved from TcBinds,
which is already too big
* HsTypes: I swapped the nesting of HsWildCardBndrs
and HsImplicitBndsrs, so that the wildcards are on the
oustide not the insidde in a LHsSigWcType. This is just
a matter of convenient, nothing deep.
There are a host of other changes as knock-on effects, and
it all took FAR longer than I anticipated :-). But it is
a significant improvement, I think.
Lots of error messages changed slightly, some just variants but
some modest improvements.
New tests
* typecheck/should_compile
* SigTyVars: a scoped-tyvar test
* ExPat, ExPatFail: existential pattern bindings
* T12069
* T11700
* T11339
* partial-sigs/should_compile
* T12033
* T11339a
* T11670
One thing to check:
* Small change to output from ghc-api/landmines.
Need to check with Alan Zimmerman
Diffstat (limited to 'testsuite/tests/partial-sigs/should_compile')
24 files changed, 452 insertions, 394 deletions
diff --git a/testsuite/tests/partial-sigs/should_compile/Defaulting2MROff.stderr b/testsuite/tests/partial-sigs/should_compile/Defaulting2MROff.stderr index 505e5ae659..097bb88829 100644 --- a/testsuite/tests/partial-sigs/should_compile/Defaulting2MROff.stderr +++ b/testsuite/tests/partial-sigs/should_compile/Defaulting2MROff.stderr @@ -1,7 +1,7 @@ -TYPE SIGNATURES - bravo :: forall t. Num t => t -TYPE CONSTRUCTORS -COERCION AXIOMS -Dependent modules: [] -Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0, - integer-gmp-1.0.0.1] +TYPE SIGNATURES
+ bravo :: forall w. Num w => w
+TYPE CONSTRUCTORS
+COERCION AXIOMS
+Dependent modules: []
+Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0,
+ integer-gmp-1.0.0.1]
diff --git a/testsuite/tests/partial-sigs/should_compile/Defaulting2MROn.stderr b/testsuite/tests/partial-sigs/should_compile/Defaulting2MROn.stderr index 7e40fd184b..097bb88829 100644 --- a/testsuite/tests/partial-sigs/should_compile/Defaulting2MROn.stderr +++ b/testsuite/tests/partial-sigs/should_compile/Defaulting2MROn.stderr @@ -1,7 +1,7 @@ -TYPE SIGNATURES - bravo :: forall t. Num t => t -TYPE CONSTRUCTORS -COERCION AXIOMS -Dependent modules: [] -Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0, - integer-gmp-1.0.0.0] +TYPE SIGNATURES
+ bravo :: forall w. Num w => w
+TYPE CONSTRUCTORS
+COERCION AXIOMS
+Dependent modules: []
+Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0,
+ integer-gmp-1.0.0.1]
diff --git a/testsuite/tests/partial-sigs/should_compile/Either.stderr b/testsuite/tests/partial-sigs/should_compile/Either.stderr index 53988619d9..2843775174 100644 --- a/testsuite/tests/partial-sigs/should_compile/Either.stderr +++ b/testsuite/tests/partial-sigs/should_compile/Either.stderr @@ -1,7 +1,7 @@ -TYPE SIGNATURES - barry :: forall t. t -> (Either [Char] t, Either [Char] t) -TYPE CONSTRUCTORS -COERCION AXIOMS -Dependent modules: [] -Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0, - integer-gmp-1.0.0.1] +TYPE SIGNATURES
+ barry :: forall w. w -> (Either [Char] w, Either [Char] w)
+TYPE CONSTRUCTORS
+COERCION AXIOMS
+Dependent modules: []
+Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0,
+ integer-gmp-1.0.0.1]
diff --git a/testsuite/tests/partial-sigs/should_compile/EveryNamed.stderr b/testsuite/tests/partial-sigs/should_compile/EveryNamed.stderr index 3bb47befd4..29a6506979 100644 --- a/testsuite/tests/partial-sigs/should_compile/EveryNamed.stderr +++ b/testsuite/tests/partial-sigs/should_compile/EveryNamed.stderr @@ -1,7 +1,7 @@ -TYPE SIGNATURES - every :: forall t. (t -> Bool) -> [t] -> Bool -TYPE CONSTRUCTORS -COERCION AXIOMS -Dependent modules: [] -Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0, - integer-gmp-1.0.0.1] +TYPE SIGNATURES
+ every :: forall w. (w -> Bool) -> [w] -> Bool
+TYPE CONSTRUCTORS
+COERCION AXIOMS
+Dependent modules: []
+Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0,
+ integer-gmp-1.0.0.1]
diff --git a/testsuite/tests/partial-sigs/should_compile/ExprSigLocal.stderr b/testsuite/tests/partial-sigs/should_compile/ExprSigLocal.stderr index 5a3f40f353..b94e0c5c17 100644 --- a/testsuite/tests/partial-sigs/should_compile/ExprSigLocal.stderr +++ b/testsuite/tests/partial-sigs/should_compile/ExprSigLocal.stderr @@ -1,19 +1,17 @@ - -ExprSigLocal.hs:9:35: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_’ standing for ‘a’ - Where: ‘a’ is a rigid type variable bound by - the inferred type of <expression> :: a -> a at ExprSigLocal.hs:9:27 - • In an expression type signature: forall a. a -> _ - In the expression: ((\ x -> x) :: forall a. a -> _) - In an equation for ‘y’: y = ((\ x -> x) :: forall a. a -> _) - • Relevant bindings include - y :: b -> b (bound at ExprSigLocal.hs:9:1) - -ExprSigLocal.hs:11:21: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_’ standing for ‘a’ - Where: ‘a’ is a rigid type variable bound by - the inferred type of g :: a -> a at ExprSigLocal.hs:11:13 - • In the type signature: - g :: forall a. a -> _ - • Relevant bindings include - g :: a -> a (bound at ExprSigLocal.hs:12:1) +
+ExprSigLocal.hs:9:35: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘a’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of <expression> :: a -> a
+ at ExprSigLocal.hs:9:20-35
+ • In an expression type signature: forall a. a -> _
+ In the expression: ((\ x -> x) :: forall a. a -> _)
+ In an equation for ‘y’: y = ((\ x -> x) :: forall a. a -> _)
+ • Relevant bindings include
+ y :: b -> b (bound at ExprSigLocal.hs:9:1)
+
+ExprSigLocal.hs:11:21: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘a’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of g :: a -> a at ExprSigLocal.hs:12:1-7
+ • In the type signature: g :: forall a. a -> _
diff --git a/testsuite/tests/partial-sigs/should_compile/ExtraConstraints3.stderr b/testsuite/tests/partial-sigs/should_compile/ExtraConstraints3.stderr index 60de114c99..2526f72019 100644 --- a/testsuite/tests/partial-sigs/should_compile/ExtraConstraints3.stderr +++ b/testsuite/tests/partial-sigs/should_compile/ExtraConstraints3.stderr @@ -125,12 +125,12 @@ TYPE SIGNATURES (Monad m, P.Foldable t) =>
(a -> m b) -> t a -> m ()
max :: forall a. Ord a => a -> a -> a
- maxBound :: forall t. Bounded t => t
+ maxBound :: forall w. Bounded w => w
maximum ::
forall (t :: * -> *) a. (Ord a, P.Foldable t) => t a -> a
maybe :: forall a b. b -> (a -> b) -> Maybe a -> b
min :: forall a. Ord a => a -> a -> a
- minBound :: forall t. Bounded t => t
+ minBound :: forall w. Bounded w => w
minimum ::
forall (t :: * -> *) a. (Ord a, P.Foldable t) => t a -> a
mod :: forall a. Integral a => a -> a -> a
@@ -142,7 +142,7 @@ TYPE SIGNATURES odd :: forall a. Integral a => a -> Bool
or :: forall (t :: * -> *). P.Foldable t => t Bool -> Bool
otherwise :: Bool
- pi :: forall t. Floating t => t
+ pi :: forall w. Floating w => w
pred :: forall a. Enum a => a -> a
print :: forall a. Show a => a -> IO ()
product ::
@@ -212,7 +212,7 @@ TYPE SIGNATURES toRational :: forall a. Real a => a -> Rational
truncate :: forall b a. (Integral b, RealFrac a) => a -> b
uncurry :: forall c b a. (a -> b -> c) -> (a, b) -> c
- undefined :: forall t. t
+ undefined :: forall w. w
unlines :: [String] -> String
until :: forall a. (a -> Bool) -> (a -> a) -> a -> a
unwords :: [String] -> String
diff --git a/testsuite/tests/partial-sigs/should_compile/SimpleGen.stderr b/testsuite/tests/partial-sigs/should_compile/SimpleGen.stderr index db0adb2004..1adc0b055c 100644 --- a/testsuite/tests/partial-sigs/should_compile/SimpleGen.stderr +++ b/testsuite/tests/partial-sigs/should_compile/SimpleGen.stderr @@ -1,7 +1,7 @@ -TYPE SIGNATURES - bar :: forall t. t -> Bool -TYPE CONSTRUCTORS -COERCION AXIOMS -Dependent modules: [] -Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0, - integer-gmp-1.0.0.1] +TYPE SIGNATURES
+ bar :: forall w. w -> Bool
+TYPE CONSTRUCTORS
+COERCION AXIOMS
+Dependent modules: []
+Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0,
+ integer-gmp-1.0.0.1]
diff --git a/testsuite/tests/partial-sigs/should_compile/SplicesUsed.stderr b/testsuite/tests/partial-sigs/should_compile/SplicesUsed.stderr index abc5f44138..2c84971275 100644 --- a/testsuite/tests/partial-sigs/should_compile/SplicesUsed.stderr +++ b/testsuite/tests/partial-sigs/should_compile/SplicesUsed.stderr @@ -1,100 +1,79 @@ -[1 of 2] Compiling Splices ( Splices.hs, Splices.o ) -[2 of 2] Compiling SplicesUsed ( SplicesUsed.hs, SplicesUsed.o ) - -SplicesUsed.hs:7:16: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_’ standing for ‘Maybe Bool’ - • In the type signature: - maybeBool :: _ - • Relevant bindings include - maybeBool :: Maybe Bool (bound at SplicesUsed.hs:8:1) - -SplicesUsed.hs:8:15: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_a’ standing for ‘t’ - Where: ‘t’ is a rigid type variable bound by - the inferred type of <expression> :: t -> t at SplicesUsed.hs:8:15 - • In an expression type signature: _a -> _a - In the expression: id :: _a -> _a - In the expression: (id :: _a -> _a) (Just True :: Maybe _) - • Relevant bindings include - maybeBool :: Maybe Bool (bound at SplicesUsed.hs:8:1) - -SplicesUsed.hs:8:27: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_’ standing for ‘Bool’ - • In an expression type signature: Maybe _ - In the first argument of ‘id :: _a -> _a’, namely - ‘(Just True :: Maybe _)’ - In the expression: (id :: _a -> _a) (Just True :: Maybe _) - • Relevant bindings include - maybeBool :: Maybe Bool (bound at SplicesUsed.hs:8:1) - -SplicesUsed.hs:10:17: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_’ standing for ‘(Char, a)’ - Where: ‘a’ is a rigid type variable bound by - the inferred type of charA :: a -> (Char, a) - at SplicesUsed.hs:10:10 - • In the type signature: - charA :: a -> (_) - • Relevant bindings include - charA :: a -> (Char, a) (bound at SplicesUsed.hs:11:1) - -SplicesUsed.hs:13:14: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_’ standing for ‘a -> Bool’ - Where: ‘a’ is a rigid type variable bound by - the inferred type of filter' :: (a -> Bool) -> [a] -> [a] - at SplicesUsed.hs:14:1 - • In the type signature: - filter' :: _ -> _ -> _ - • Relevant bindings include - filter' :: (a -> Bool) -> [a] -> [a] (bound at SplicesUsed.hs:14:1) - -SplicesUsed.hs:13:14: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_’ standing for ‘[a]’ - Where: ‘a’ is a rigid type variable bound by - the inferred type of filter' :: (a -> Bool) -> [a] -> [a] - at SplicesUsed.hs:14:1 - • In the type signature: - filter' :: _ -> _ -> _ - • Relevant bindings include - filter' :: (a -> Bool) -> [a] -> [a] (bound at SplicesUsed.hs:14:1) - -SplicesUsed.hs:13:14: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_’ standing for ‘[a]’ - Where: ‘a’ is a rigid type variable bound by - the inferred type of filter' :: (a -> Bool) -> [a] -> [a] - at SplicesUsed.hs:14:1 - • In the type signature: - filter' :: _ -> _ -> _ - • Relevant bindings include - filter' :: (a -> Bool) -> [a] -> [a] (bound at SplicesUsed.hs:14:1) - -SplicesUsed.hs:16:3: warning: [-Wpartial-type-signatures (in -Wdefault)] - Found constraint wildcard ‘_’ standing for ‘Eq a’ - In the type signature: - foo :: _ => _ - -SplicesUsed.hs:16:3: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_’ standing for ‘a -> a -> Bool’ - Where: ‘a’ is a rigid type variable bound by - the inferred type of foo :: Eq a => a -> a -> Bool - at SplicesUsed.hs:16:3 - • In the type signature: - foo :: _ => _ - • Relevant bindings include - foo :: a -> a -> Bool (bound at SplicesUsed.hs:16:3) - -SplicesUsed.hs:18:3: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_a’ standing for ‘Bool’ - • In the type signature: - bar :: _a -> _b -> (_a, _b) - • Relevant bindings include - bar :: Bool -> t -> (Bool, t) (bound at SplicesUsed.hs:18:3) - -SplicesUsed.hs:18:3: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_b’ standing for ‘t’ - Where: ‘t’ is a rigid type variable bound by - the inferred type of bar :: Bool -> t -> (Bool, t) - at SplicesUsed.hs:18:3 - • In the type signature: - bar :: _a -> _b -> (_a, _b) - • Relevant bindings include - bar :: Bool -> t -> (Bool, t) (bound at SplicesUsed.hs:18:3) +[1 of 2] Compiling Splices ( Splices.hs, Splices.o )
+[2 of 2] Compiling SplicesUsed ( SplicesUsed.hs, SplicesUsed.o )
+
+SplicesUsed.hs:7:16: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘Maybe Bool’
+ • In the type signature: maybeBool :: _
+
+SplicesUsed.hs:8:15: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_a’ standing for ‘w’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of <expression> :: w -> w
+ at SplicesUsed.hs:8:15-22
+ • In an expression type signature: _a -> _a
+ In the expression: id :: _a -> _a
+ In the expression: (id :: _a -> _a) (Just True :: Maybe _)
+ • Relevant bindings include
+ maybeBool :: Maybe Bool (bound at SplicesUsed.hs:8:1)
+
+SplicesUsed.hs:8:27: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘Bool’
+ • In an expression type signature: Maybe _
+ In the first argument of ‘id :: _a -> _a’, namely
+ ‘(Just True :: Maybe _)’
+ In the expression: (id :: _a -> _a) (Just True :: Maybe _)
+ • Relevant bindings include
+ maybeBool :: Maybe Bool (bound at SplicesUsed.hs:8:1)
+
+SplicesUsed.hs:10:17: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘(Char, a)’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of charA :: a -> (Char, a)
+ at SplicesUsed.hs:11:1-18
+ • In the type signature: charA :: a -> (_)
+
+SplicesUsed.hs:13:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘a -> Bool’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of filter' :: (a -> Bool) -> [a] -> [a]
+ at SplicesUsed.hs:14:1-16
+ • In the type signature: filter' :: _ -> _ -> _
+
+SplicesUsed.hs:13:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘[a]’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of filter' :: (a -> Bool) -> [a] -> [a]
+ at SplicesUsed.hs:14:1-16
+ • In the type signature: filter' :: _ -> _ -> _
+
+SplicesUsed.hs:13:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘[a]’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of filter' :: (a -> Bool) -> [a] -> [a]
+ at SplicesUsed.hs:14:1-16
+ • In the type signature: filter' :: _ -> _ -> _
+
+SplicesUsed.hs:16:3: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘Eq a’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of foo :: Eq a => a -> a -> Bool
+ at SplicesUsed.hs:16:3-10
+ • In the type signature: foo :: _ => _
+
+SplicesUsed.hs:16:3: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘a -> a -> Bool’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of foo :: Eq a => a -> a -> Bool
+ at SplicesUsed.hs:16:3-10
+ • In the type signature: foo :: _ => _
+
+SplicesUsed.hs:18:3: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_a’ standing for ‘Bool’
+ • In the type signature: bar :: _a -> _b -> (_a, _b)
+
+SplicesUsed.hs:18:3: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_b’ standing for ‘w’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of bar :: Bool -> w -> (Bool, w)
+ at SplicesUsed.hs:18:3-10
+ • In the type signature: bar :: _a -> _b -> (_a, _b)
diff --git a/testsuite/tests/partial-sigs/should_compile/SuperCls.stderr b/testsuite/tests/partial-sigs/should_compile/SuperCls.stderr index d6fda4e8f5..7811dcb854 100644 --- a/testsuite/tests/partial-sigs/should_compile/SuperCls.stderr +++ b/testsuite/tests/partial-sigs/should_compile/SuperCls.stderr @@ -1,4 +1,4 @@ - -SuperCls.hs:4:14: warning: [-Wpartial-type-signatures (in -Wdefault)] - Found constraint wildcard ‘_’ standing for ‘()’ - In the type signature: f :: (Ord a, _) => a -> Bool +
+SuperCls.hs:4:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘() :: Constraint’
+ • In the type signature: f :: (Ord a, _) => a -> Bool
diff --git a/testsuite/tests/partial-sigs/should_compile/T10403.stderr b/testsuite/tests/partial-sigs/should_compile/T10403.stderr index 320b28b621..753b983a15 100644 --- a/testsuite/tests/partial-sigs/should_compile/T10403.stderr +++ b/testsuite/tests/partial-sigs/should_compile/T10403.stderr @@ -1,81 +1,77 @@ - -T10403.hs:15:7: warning: [-Wpartial-type-signatures (in -Wdefault)] - Found constraint wildcard ‘_’ standing for ‘Functor f’ - In the type signature: - h1 :: _ => _ - -T10403.hs:15:12: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_’ standing for ‘(a -> b) -> f a -> H f’ - Where: ‘f’ is a rigid type variable bound by - the inferred type of h1 :: Functor f => (a -> b) -> f a -> H f - at T10403.hs:17:1 - ‘b’ is a rigid type variable bound by - the inferred type of h1 :: Functor f => (a -> b) -> f a -> H f - at T10403.hs:17:1 - ‘a’ is a rigid type variable bound by - the inferred type of h1 :: Functor f => (a -> b) -> f a -> H f - at T10403.hs:17:1 - • In the type signature: - h1 :: _ => _ - • Relevant bindings include - h1 :: (a -> b) -> f a -> H f (bound at T10403.hs:17:1) - -T10403.hs:19:7: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_’ standing for ‘(a -> b) -> f0 a -> H f0’ - Where: ‘f0’ is an ambiguous type variable - ‘b’ is a rigid type variable bound by - the inferred type of h2 :: (a -> b) -> f0 a -> H f0 - at T10403.hs:22:1 - ‘a’ is a rigid type variable bound by - the inferred type of h2 :: (a -> b) -> f0 a -> H f0 - at T10403.hs:22:1 - • In the type signature: - h2 :: _ - • Relevant bindings include - h2 :: (a -> b) -> f0 a -> H f0 (bound at T10403.hs:22:1) - -T10403.hs:22:15: warning: [-Wdeferred-type-errors (in -Wdefault)] - • Ambiguous type variable ‘f0’ arising from a use of ‘fmap’ - prevents the constraint ‘(Functor f0)’ from being solved. - Relevant bindings include - b :: f0 a (bound at T10403.hs:22:6) - h2 :: (a -> b) -> f0 a -> H f0 (bound at T10403.hs:22:1) - Probable fix: use a type annotation to specify what ‘f0’ should be. - These potential instances exist: - instance Functor IO -- Defined in ‘GHC.Base’ - instance Functor (B t) -- Defined at T10403.hs:10:10 - instance Functor I -- Defined at T10403.hs:6:10 - ...plus four others - (use -fprint-potential-instances to see them all) - • In the second argument of ‘(.)’, namely ‘fmap (const ())’ - In the expression: H . fmap (const ()) - In the expression: (H . fmap (const ())) (fmap f b) - -T10403.hs:28:8: warning: [-Wdeferred-type-errors (in -Wdefault)] - • Couldn't match type ‘f0’ with ‘B t’ - because type variable ‘t’ would escape its scope - This (rigid, skolem) type variable is bound by - the type signature for: - app2 :: H (B t) - at T10403.hs:27:1-15 - Expected type: H (B t) - Actual type: H f0 - • In the expression: h2 (H . I) (B ()) - In an equation for ‘app2’: app2 = h2 (H . I) (B ()) - • Relevant bindings include - app2 :: H (B t) (bound at T10403.hs:28:1) - -T10403.hs:28:20: warning: [-Wdeferred-type-errors (in -Wdefault)] - • Couldn't match type ‘f0’ with ‘B t’ - because type variable ‘t’ would escape its scope - This (rigid, skolem) type variable is bound by - the type signature for: - app2 :: H (B t) - at T10403.hs:27:1-15 - Expected type: f0 () - Actual type: B t () - • In the second argument of ‘h2’, namely ‘(B ())’ - In the expression: h2 (H . I) (B ()) - In an equation for ‘app2’: app2 = h2 (H . I) (B ()) - • Relevant bindings include - app2 :: H (B t) (bound at T10403.hs:28:1) +
+T10403.hs:15:7: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘Functor f’
+ Where: ‘f’ is a rigid type variable bound by
+ the inferred type of h1 :: Functor f => (a -> b) -> f a -> H f
+ at T10403.hs:17:1-41
+ • In the type signature: h1 :: _ => _
+
+T10403.hs:15:12: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘(a -> b) -> f a -> H f’
+ Where: ‘f’ is a rigid type variable bound by
+ the inferred type of h1 :: Functor f => (a -> b) -> f a -> H f
+ at T10403.hs:17:1-41
+ ‘b’ is a rigid type variable bound by
+ the inferred type of h1 :: Functor f => (a -> b) -> f a -> H f
+ at T10403.hs:17:1-41
+ ‘a’ is a rigid type variable bound by
+ the inferred type of h1 :: Functor f => (a -> b) -> f a -> H f
+ at T10403.hs:17:1-41
+ • In the type signature: h1 :: _ => _
+
+T10403.hs:19:7: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘(a -> b) -> f0 a -> H f0’
+ Where: ‘f0’ is an ambiguous type variable
+ ‘b’ is a rigid type variable bound by
+ the inferred type of h2 :: (a -> b) -> f0 a -> H f0
+ at T10403.hs:22:1-41
+ ‘a’ is a rigid type variable bound by
+ the inferred type of h2 :: (a -> b) -> f0 a -> H f0
+ at T10403.hs:22:1-41
+ • In the type signature: h2 :: _
+
+T10403.hs:22:15: warning: [-Wdeferred-type-errors (in -Wdefault)]
+ • Ambiguous type variable ‘f0’ arising from a use of ‘fmap’
+ prevents the constraint ‘(Functor f0)’ from being solved.
+ Relevant bindings include
+ b :: f0 a (bound at T10403.hs:22:6)
+ h2 :: (a -> b) -> f0 a -> H f0 (bound at T10403.hs:22:1)
+ Probable fix: use a type annotation to specify what ‘f0’ should be.
+ These potential instances exist:
+ instance Functor IO -- Defined in ‘GHC.Base’
+ instance Functor (B t) -- Defined at T10403.hs:10:10
+ instance Functor I -- Defined at T10403.hs:6:10
+ ...plus four others
+ (use -fprint-potential-instances to see them all)
+ • In the second argument of ‘(.)’, namely ‘fmap (const ())’
+ In the expression: H . fmap (const ())
+ In the expression: (H . fmap (const ())) (fmap f b)
+
+T10403.hs:28:8: warning: [-Wdeferred-type-errors (in -Wdefault)]
+ • Couldn't match type ‘f0’ with ‘B t’
+ because type variable ‘t’ would escape its scope
+ This (rigid, skolem) type variable is bound by
+ the type signature for:
+ app2 :: H (B t)
+ at T10403.hs:27:1-15
+ Expected type: H (B t)
+ Actual type: H f0
+ • In the expression: h2 (H . I) (B ())
+ In an equation for ‘app2’: app2 = h2 (H . I) (B ())
+ • Relevant bindings include
+ app2 :: H (B t) (bound at T10403.hs:28:1)
+
+T10403.hs:28:20: warning: [-Wdeferred-type-errors (in -Wdefault)]
+ • Couldn't match type ‘f0’ with ‘B t’
+ because type variable ‘t’ would escape its scope
+ This (rigid, skolem) type variable is bound by
+ the type signature for:
+ app2 :: H (B t)
+ at T10403.hs:27:1-15
+ Expected type: f0 ()
+ Actual type: B t ()
+ • In the second argument of ‘h2’, namely ‘(B ())’
+ In the expression: h2 (H . I) (B ())
+ In an equation for ‘app2’: app2 = h2 (H . I) (B ())
+ • Relevant bindings include
+ app2 :: H (B t) (bound at T10403.hs:28:1)
diff --git a/testsuite/tests/partial-sigs/should_compile/T10438.stderr b/testsuite/tests/partial-sigs/should_compile/T10438.stderr index 0742250be3..a3fc19f7aa 100644 --- a/testsuite/tests/partial-sigs/should_compile/T10438.stderr +++ b/testsuite/tests/partial-sigs/should_compile/T10438.stderr @@ -1,28 +1,26 @@ - -T10438.hs:7:22: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_’ standing for ‘t2’ - Where: ‘t2’ is a rigid type variable bound by - the inferred type of g :: t2 -> t2 at T10438.hs:6:9 - • In the type signature: - x :: _ - In an equation for ‘g’: - g r - = x - where - x :: _ - x = r - In an equation for ‘foo’: - foo f - = g - where - g r - = x - where - x :: _ - x = r - • Relevant bindings include - x :: t2 (bound at T10438.hs:8:17) - r :: t2 (bound at T10438.hs:6:11) - g :: t2 -> t2 (bound at T10438.hs:6:9) - f :: t1 (bound at T10438.hs:5:5) - foo :: t1 -> forall t. t -> t (bound at T10438.hs:5:1) +
+T10438.hs:7:22: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘t2’
+ Where: ‘t2’ is a rigid type variable bound by
+ the inferred type of g :: t2 -> t2 at T10438.hs:(6,9)-(8,21)
+ • In the type signature: x :: _
+ In an equation for ‘g’:
+ g r
+ = x
+ where
+ x :: _
+ x = r
+ In an equation for ‘foo’:
+ foo f
+ = g
+ where
+ g r
+ = x
+ where
+ x :: _
+ x = r
+ • Relevant bindings include
+ r :: t2 (bound at T10438.hs:6:11)
+ g :: t2 -> t2 (bound at T10438.hs:6:9)
+ f :: t1 (bound at T10438.hs:5:5)
+ foo :: t1 -> forall t. t -> t (bound at T10438.hs:5:1)
diff --git a/testsuite/tests/partial-sigs/should_compile/T10519.stderr b/testsuite/tests/partial-sigs/should_compile/T10519.stderr index ba98d7a3b0..496867bd04 100644 --- a/testsuite/tests/partial-sigs/should_compile/T10519.stderr +++ b/testsuite/tests/partial-sigs/should_compile/T10519.stderr @@ -1,5 +1,7 @@ - -T10519.hs:5:18: warning: [-Wpartial-type-signatures (in -Wdefault)] - Found constraint wildcard ‘_’ standing for ‘Eq a’ - In the type signature: - foo :: forall a. _ => a -> a -> Bool +
+T10519.hs:5:18: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘Eq a’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of foo :: Eq a => a -> a -> Bool
+ at T10519.hs:6:1-16
+ • In the type signature: foo :: forall a. _ => a -> a -> Bool
diff --git a/testsuite/tests/partial-sigs/should_compile/T11016.stderr b/testsuite/tests/partial-sigs/should_compile/T11016.stderr index 5d9ad095c1..faf2124b25 100644 --- a/testsuite/tests/partial-sigs/should_compile/T11016.stderr +++ b/testsuite/tests/partial-sigs/should_compile/T11016.stderr @@ -1,11 +1,8 @@ - -T11016.hs:5:19: warning: [-Wpartial-type-signatures (in -Wdefault)] - Found constraint wildcard ‘_’ standing for ‘()’ - In the type signature: - f1 :: (?x :: Int, _) => Int - -T11016.hs:8:22: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_’ standing for ‘Int’ - • In the type signature: - f2 :: (?x :: Int) => _ - • Relevant bindings include f2 :: Int (bound at T11016.hs:9:1) +
+T11016.hs:5:19: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘() :: Constraint’
+ • In the type signature: f1 :: (?x :: Int, _) => Int
+
+T11016.hs:8:22: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘Int’
+ • In the type signature: f2 :: (?x :: Int) => _
diff --git a/testsuite/tests/partial-sigs/should_compile/T11192.stderr b/testsuite/tests/partial-sigs/should_compile/T11192.stderr index 558097ca2b..c2a9db5a96 100644 --- a/testsuite/tests/partial-sigs/should_compile/T11192.stderr +++ b/testsuite/tests/partial-sigs/should_compile/T11192.stderr @@ -1,44 +1,38 @@ - -T11192.hs:7:14: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_’ standing for ‘Int -> t -> t’ - Where: ‘t’ is a rigid type variable bound by - the inferred type of go :: Int -> t -> t at T11192.hs:8:8 - • In the type signature: - go :: _ - In the expression: - let - go :: _ - go 0 a = a - in go (0 :: Int) undefined - In an equation for ‘fails’: - fails - = let - go :: _ - go 0 a = a - in go (0 :: Int) undefined - • Relevant bindings include - go :: Int -> t -> t (bound at T11192.hs:8:8) - fails :: a (bound at T11192.hs:6:1) - -T11192.hs:13:14: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_’ standing for ‘t1 -> t -> t’ - Where: ‘t’ is a rigid type variable bound by - the inferred type of go :: t1 -> t -> t at T11192.hs:14:8 - ‘t1’ is a rigid type variable bound by - the inferred type of go :: t1 -> t -> t at T11192.hs:14:8 - • In the type signature: - go :: _ - In the expression: - let - go :: _ - go _ a = a - in go (0 :: Int) undefined - In an equation for ‘succeeds’: - succeeds - = let - go :: _ - go _ a = a - in go (0 :: Int) undefined - • Relevant bindings include - go :: t1 -> t -> t (bound at T11192.hs:14:8) - succeeds :: a (bound at T11192.hs:12:1) +
+T11192.hs:7:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘Int -> t -> t’
+ Where: ‘t’ is a rigid type variable bound by
+ the inferred type of go :: Int -> t -> t at T11192.hs:8:8-17
+ • In the type signature: go :: _
+ In the expression:
+ let
+ go :: _
+ go 0 a = a
+ in go (0 :: Int) undefined
+ In an equation for ‘fails’:
+ fails
+ = let
+ go :: _
+ go 0 a = a
+ in go (0 :: Int) undefined
+ • Relevant bindings include fails :: a (bound at T11192.hs:6:1)
+
+T11192.hs:13:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘t1 -> t -> t’
+ Where: ‘t’ is a rigid type variable bound by
+ the inferred type of go :: t1 -> t -> t at T11192.hs:14:8-17
+ ‘t1’ is a rigid type variable bound by
+ the inferred type of go :: t1 -> t -> t at T11192.hs:14:8-17
+ • In the type signature: go :: _
+ In the expression:
+ let
+ go :: _
+ go _ a = a
+ in go (0 :: Int) undefined
+ In an equation for ‘succeeds’:
+ succeeds
+ = let
+ go :: _
+ go _ a = a
+ in go (0 :: Int) undefined
+ • Relevant bindings include succeeds :: a (bound at T11192.hs:12:1)
diff --git a/testsuite/tests/partial-sigs/should_compile/T11339a.hs b/testsuite/tests/partial-sigs/should_compile/T11339a.hs new file mode 100644 index 0000000000..de20d93d93 --- /dev/null +++ b/testsuite/tests/partial-sigs/should_compile/T11339a.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE PartialTypeSignatures #-} + +module T11399a where + +bar :: _ +(bar) = id diff --git a/testsuite/tests/partial-sigs/should_compile/T11339a.stderr b/testsuite/tests/partial-sigs/should_compile/T11339a.stderr new file mode 100644 index 0000000000..76d15ff356 --- /dev/null +++ b/testsuite/tests/partial-sigs/should_compile/T11339a.stderr @@ -0,0 +1,6 @@ +
+T11339a.hs:5:8: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘a -> a’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of bar :: a -> a at T11339a.hs:6:1-10
+ • In the type signature: bar :: _
diff --git a/testsuite/tests/partial-sigs/should_compile/T11670.hs b/testsuite/tests/partial-sigs/should_compile/T11670.hs new file mode 100644 index 0000000000..8b0611fda1 --- /dev/null +++ b/testsuite/tests/partial-sigs/should_compile/T11670.hs @@ -0,0 +1,16 @@ +{-# LANGUAGE InstanceSigs, PartialTypeSignatures #-} + +module T11670 where + +import Foreign.C.Types +import Foreign.Storable +import Foreign.Ptr + +peek :: Ptr a -> IO CLong +peek ptr = peekElemOff undefined 0 :: IO _ + +peek2 :: Ptr a -> IO CLong +peek2 ptr = peekElemOff undefined 0 :: _ => IO _ + +-- castPtr :: Ptr a -> Ptr b +-- peekElemOff :: Storable a => Ptr a -> Int -> IO a diff --git a/testsuite/tests/partial-sigs/should_compile/T11670.stderr b/testsuite/tests/partial-sigs/should_compile/T11670.stderr new file mode 100644 index 0000000000..eaa304ca42 --- /dev/null +++ b/testsuite/tests/partial-sigs/should_compile/T11670.stderr @@ -0,0 +1,36 @@ +
+T11670.hs:10:42: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘CLong’
+ • In an expression type signature: IO _
+ In the expression: peekElemOff undefined 0 :: IO _
+ In an equation for ‘T11670.peek’:
+ T11670.peek ptr = peekElemOff undefined 0 :: IO _
+ • Relevant bindings include
+ ptr :: Ptr a (bound at T11670.hs:10:6)
+ peek :: Ptr a -> IO CLong (bound at T11670.hs:10:1)
+
+T11670.hs:13:40: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘Storable w’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of <expression> :: Storable w => IO w
+ at T11670.hs:13:40-48
+ • In an expression type signature: _ => IO _
+ In the expression: peekElemOff undefined 0 :: _ => IO _
+ In an equation for ‘peek2’:
+ peek2 ptr = peekElemOff undefined 0 :: _ => IO _
+ • Relevant bindings include
+ ptr :: Ptr a (bound at T11670.hs:13:7)
+ peek2 :: Ptr a -> IO CLong (bound at T11670.hs:13:1)
+
+T11670.hs:13:48: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘w’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of <expression> :: Storable w => IO w
+ at T11670.hs:13:40-48
+ • In an expression type signature: _ => IO _
+ In the expression: peekElemOff undefined 0 :: _ => IO _
+ In an equation for ‘peek2’:
+ peek2 ptr = peekElemOff undefined 0 :: _ => IO _
+ • Relevant bindings include
+ ptr :: Ptr a (bound at T11670.hs:13:7)
+ peek2 :: Ptr a -> IO CLong (bound at T11670.hs:13:1)
diff --git a/testsuite/tests/partial-sigs/should_compile/T12033.hs b/testsuite/tests/partial-sigs/should_compile/T12033.hs new file mode 100644 index 0000000000..9d47ec6541 --- /dev/null +++ b/testsuite/tests/partial-sigs/should_compile/T12033.hs @@ -0,0 +1,13 @@ +{-# LANGUAGE TypeFamilies, PartialTypeSignatures #-} + +-- In Trac #12033 this was called HsakellBug.hs + +module T12033 where +tripleStoreToRuleSet :: v -> v +tripleStoreToRuleSet getAtom + = makeTuple getAtom + where + makeRule v = makeExpression v + makeTuple v = makeExpression v + makeExpression :: _ + makeExpression v = makeTuple getAtom diff --git a/testsuite/tests/partial-sigs/should_compile/T12033.stderr b/testsuite/tests/partial-sigs/should_compile/T12033.stderr new file mode 100644 index 0000000000..02a1233559 --- /dev/null +++ b/testsuite/tests/partial-sigs/should_compile/T12033.stderr @@ -0,0 +1,24 @@ +
+T12033.hs:12:22: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘v -> t’
+ Where: ‘t’ is a rigid type variable bound by
+ the inferred type of
+ makeTuple :: v -> t
+ makeExpression :: v -> t
+ at T12033.hs:(11,4)-(13,39)
+ ‘v’ is a rigid type variable bound by
+ the type signature for:
+ tripleStoreToRuleSet :: forall v. v -> v
+ at T12033.hs:6:1-30
+ • In the type signature: makeExpression :: _
+ In an equation for ‘tripleStoreToRuleSet’:
+ tripleStoreToRuleSet getAtom
+ = makeTuple getAtom
+ where
+ makeRule v = makeExpression v
+ makeTuple v = makeExpression v
+ makeExpression :: _
+ makeExpression v = makeTuple getAtom
+ • Relevant bindings include
+ getAtom :: v (bound at T12033.hs:7:22)
+ tripleStoreToRuleSet :: v -> v (bound at T12033.hs:7:1)
diff --git a/testsuite/tests/partial-sigs/should_compile/Uncurry.stderr b/testsuite/tests/partial-sigs/should_compile/Uncurry.stderr index be6dd3bdf0..bd9ac50bd7 100644 --- a/testsuite/tests/partial-sigs/should_compile/Uncurry.stderr +++ b/testsuite/tests/partial-sigs/should_compile/Uncurry.stderr @@ -1,5 +1,5 @@ TYPE SIGNATURES
- unc :: forall t t1 t2. (t2 -> t1 -> t) -> (t2, t1) -> t
+ unc :: forall w w1 w2. (w2 -> w1 -> w) -> (w2, w1) -> w
TYPE CONSTRUCTORS
COERCION AXIOMS
Dependent modules: []
diff --git a/testsuite/tests/partial-sigs/should_compile/UncurryNamed.stderr b/testsuite/tests/partial-sigs/should_compile/UncurryNamed.stderr index 8951f4490a..b73f5669a0 100644 --- a/testsuite/tests/partial-sigs/should_compile/UncurryNamed.stderr +++ b/testsuite/tests/partial-sigs/should_compile/UncurryNamed.stderr @@ -1,5 +1,5 @@ TYPE SIGNATURES
- unc :: forall t b a. (a -> b -> t) -> (a, b) -> t
+ unc :: forall w b a. (a -> b -> w) -> (a, b) -> w
TYPE CONSTRUCTORS
COERCION AXIOMS
Dependent modules: []
diff --git a/testsuite/tests/partial-sigs/should_compile/WarningWildcardInstantiations.stderr b/testsuite/tests/partial-sigs/should_compile/WarningWildcardInstantiations.stderr index fe80ce4b7b..60b5b11bde 100644 --- a/testsuite/tests/partial-sigs/should_compile/WarningWildcardInstantiations.stderr +++ b/testsuite/tests/partial-sigs/should_compile/WarningWildcardInstantiations.stderr @@ -1,60 +1,50 @@ -TYPE SIGNATURES - bar :: forall t t1. t1 -> (t1 -> t) -> t - foo :: forall a. (Show a, Enum a) => a -> String -TYPE CONSTRUCTORS -COERCION AXIOMS -Dependent modules: [] -Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0, - integer-gmp-1.0.0.1] - -WarningWildcardInstantiations.hs:5:14: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_a’ standing for ‘a’ - Where: ‘a’ is a rigid type variable bound by - the inferred type of foo :: (Show a, Enum a) => a -> String - at WarningWildcardInstantiations.hs:6:1 - • In the type signature: foo :: (Show _a, _) => _a -> _ - • Relevant bindings include - foo :: a -> String (bound at WarningWildcardInstantiations.hs:6:1) - -WarningWildcardInstantiations.hs:5:18: warning: [-Wpartial-type-signatures (in -Wdefault)] - Found constraint wildcard ‘_’ standing for ‘Enum a’ - In the type signature: foo :: (Show _a, _) => _a -> _ - -WarningWildcardInstantiations.hs:5:30: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_’ standing for ‘String’ - • In the type signature: foo :: (Show _a, _) => _a -> _ - • Relevant bindings include - foo :: a -> String (bound at WarningWildcardInstantiations.hs:6:1) - -WarningWildcardInstantiations.hs:8:8: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_’ standing for ‘t1’ - Where: ‘t1’ is a rigid type variable bound by - the inferred type of bar :: t1 -> (t1 -> t) -> t - at WarningWildcardInstantiations.hs:9:1 - • In the type signature: bar :: _ -> _ -> _ - • Relevant bindings include - bar :: t1 -> (t1 -> t) -> t - (bound at WarningWildcardInstantiations.hs:9:1) - -WarningWildcardInstantiations.hs:8:13: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_’ standing for ‘t1 -> t’ - Where: ‘t’ is a rigid type variable bound by - the inferred type of bar :: t1 -> (t1 -> t) -> t - at WarningWildcardInstantiations.hs:9:1 - ‘t1’ is a rigid type variable bound by - the inferred type of bar :: t1 -> (t1 -> t) -> t - at WarningWildcardInstantiations.hs:9:1 - • In the type signature: bar :: _ -> _ -> _ - • Relevant bindings include - bar :: t1 -> (t1 -> t) -> t - (bound at WarningWildcardInstantiations.hs:9:1) - -WarningWildcardInstantiations.hs:8:18: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_’ standing for ‘t’ - Where: ‘t’ is a rigid type variable bound by - the inferred type of bar :: t1 -> (t1 -> t) -> t - at WarningWildcardInstantiations.hs:9:1 - • In the type signature: bar :: _ -> _ -> _ - • Relevant bindings include - bar :: t1 -> (t1 -> t) -> t - (bound at WarningWildcardInstantiations.hs:9:1) +TYPE SIGNATURES
+ bar :: forall w t. t -> (t -> w) -> w
+ foo :: forall a. (Show a, Enum a) => a -> String
+TYPE CONSTRUCTORS
+COERCION AXIOMS
+Dependent modules: []
+Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0,
+ integer-gmp-1.0.0.1]
+
+WarningWildcardInstantiations.hs:5:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_a’ standing for ‘a’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of foo :: (Show a, Enum a) => a -> String
+ at WarningWildcardInstantiations.hs:6:1-21
+ • In the type signature: foo :: (Show _a, _) => _a -> _
+
+WarningWildcardInstantiations.hs:5:18: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘Enum a’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of foo :: (Show a, Enum a) => a -> String
+ at WarningWildcardInstantiations.hs:6:1-21
+ • In the type signature: foo :: (Show _a, _) => _a -> _
+
+WarningWildcardInstantiations.hs:5:30: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘String’
+ • In the type signature: foo :: (Show _a, _) => _a -> _
+
+WarningWildcardInstantiations.hs:8:8: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘t’
+ Where: ‘t’ is a rigid type variable bound by
+ the inferred type of bar :: t -> (t -> w) -> w
+ at WarningWildcardInstantiations.hs:9:1-13
+ • In the type signature: bar :: _ -> _ -> _
+
+WarningWildcardInstantiations.hs:8:13: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘t -> w’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of bar :: t -> (t -> w) -> w
+ at WarningWildcardInstantiations.hs:9:1-13
+ ‘t’ is a rigid type variable bound by
+ the inferred type of bar :: t -> (t -> w) -> w
+ at WarningWildcardInstantiations.hs:9:1-13
+ • In the type signature: bar :: _ -> _ -> _
+
+WarningWildcardInstantiations.hs:8:18: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘w’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of bar :: t -> (t -> w) -> w
+ at WarningWildcardInstantiations.hs:9:1-13
+ • In the type signature: bar :: _ -> _ -> _
diff --git a/testsuite/tests/partial-sigs/should_compile/all.T b/testsuite/tests/partial-sigs/should_compile/all.T index 18895ad551..262bf7e794 100644 --- a/testsuite/tests/partial-sigs/should_compile/all.T +++ b/testsuite/tests/partial-sigs/should_compile/all.T @@ -60,4 +60,7 @@ test('T10463', normal, compile, ['']) test('ExprSigLocal', normal, compile, ['']) test('T11016', normal, compile, ['']) test('T11192', normal, compile, ['']) -test('SuperCls', normal, compile, [''])
\ No newline at end of file +test('SuperCls', normal, compile, ['']) +test('T12033', normal, compile, ['']) +test('T11339a', normal, compile, ['']) +test('T11670', normal, compile, ['']) |