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_fail/T10615.stderr | |
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_fail/T10615.stderr')
-rw-r--r-- | testsuite/tests/partial-sigs/should_fail/T10615.stderr | 68 |
1 files changed, 32 insertions, 36 deletions
diff --git a/testsuite/tests/partial-sigs/should_fail/T10615.stderr b/testsuite/tests/partial-sigs/should_fail/T10615.stderr index 842b2eb10a..9e46dd20d1 100644 --- a/testsuite/tests/partial-sigs/should_fail/T10615.stderr +++ b/testsuite/tests/partial-sigs/should_fail/T10615.stderr @@ -1,36 +1,32 @@ - -T10615.hs:4:7: error: - • Found type wildcard ‘_’ standing for ‘a1’ - Where: ‘a1’ is an ambiguous type variable - To use the inferred type, enable PartialTypeSignatures - • In the type signature: - f1 :: _ -> f - • Relevant bindings include f1 :: a1 -> f (bound at T10615.hs:5:1) - -T10615.hs:5:6: error: - • Couldn't match type ‘f’ with ‘b1 -> a1’ - ‘f’ is a rigid type variable bound by - the inferred type of f1 :: a1 -> f at T10615.hs:4:7 - Expected type: a1 -> f - Actual type: a1 -> b1 -> a1 - • In the expression: const - In an equation for ‘f1’: f1 = const - • Relevant bindings include f1 :: a1 -> f (bound at T10615.hs:5:1) - -T10615.hs:7:7: error: - • Found type wildcard ‘_’ standing for ‘a0’ - Where: ‘a0’ is an ambiguous type variable - To use the inferred type, enable PartialTypeSignatures - • In the type signature: - f2 :: _ -> _f - • Relevant bindings include f2 :: a0 -> _f (bound at T10615.hs:8:1) - -T10615.hs:8:6: error: - • Couldn't match type ‘_f’ with ‘b0 -> a0’ - ‘_f’ is a rigid type variable bound by - the inferred type of f2 :: a0 -> _f at T10615.hs:7:7 - Expected type: a0 -> _f - Actual type: a0 -> b0 -> a0 - • In the expression: const - In an equation for ‘f2’: f2 = const - • Relevant bindings include f2 :: a0 -> _f (bound at T10615.hs:8:1) +
+T10615.hs:4:7: error:
+ • Found type wildcard ‘_’ standing for ‘a1’
+ Where: ‘a1’ is an ambiguous type variable
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: f1 :: _ -> f
+
+T10615.hs:5:6: error:
+ • Couldn't match type ‘f’ with ‘b1 -> a1’
+ ‘f’ is a rigid type variable bound by
+ the inferred type of f1 :: a1 -> f at T10615.hs:5:1-10
+ Expected type: a1 -> f
+ Actual type: a1 -> b1 -> a1
+ • In the expression: const
+ In an equation for ‘f1’: f1 = const
+ • Relevant bindings include f1 :: a1 -> f (bound at T10615.hs:5:1)
+
+T10615.hs:7:7: error:
+ • Found type wildcard ‘_’ standing for ‘a0’
+ Where: ‘a0’ is an ambiguous type variable
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: f2 :: _ -> _f
+
+T10615.hs:8:6: error:
+ • Couldn't match type ‘_f’ with ‘b0 -> a0’
+ ‘_f’ is a rigid type variable bound by
+ the inferred type of f2 :: a0 -> _f at T10615.hs:8:1-10
+ Expected type: a0 -> _f
+ Actual type: a0 -> b0 -> a0
+ • In the expression: const
+ In an equation for ‘f2’: f2 = const
+ • Relevant bindings include f2 :: a0 -> _f (bound at T10615.hs:8:1)
|