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/indexed-types/should_fail/T4093b.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/indexed-types/should_fail/T4093b.stderr')
-rw-r--r-- | testsuite/tests/indexed-types/should_fail/T4093b.stderr | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/testsuite/tests/indexed-types/should_fail/T4093b.stderr b/testsuite/tests/indexed-types/should_fail/T4093b.stderr index 0950de8c66..92530d58bf 100644 --- a/testsuite/tests/indexed-types/should_fail/T4093b.stderr +++ b/testsuite/tests/indexed-types/should_fail/T4093b.stderr @@ -1,42 +1,42 @@ - -T4093b.hs:31:13: error: - • Could not deduce: e ~ C - from the context: (EitherCO e (A C O n) (A O O n) ~ A e O n, - EitherCO x (A C C n) (A C O n) ~ A C x n) - bound by the type signature for: - blockToNodeList :: (EitherCO e (A C O n) (A O O n) ~ A e O n, - EitherCO x (A C C n) (A C O n) ~ A C x n) => - Block n e x -> A e x n - at T4093b.hs:(19,1)-(22,26) - ‘e’ is a rigid type variable bound by - the type signature for: - blockToNodeList :: forall (n :: * -> * -> *) e x. - (EitherCO e (A C O n) (A O O n) ~ A e O n, - EitherCO x (A C C n) (A C O n) ~ A C x n) => - Block n e x -> A e x n - at T4093b.hs:20:12 - Expected type: EitherCO e (A C O n) (A O O n) - Actual type: (MaybeC C (n C O), MaybeC O (n O C)) - • In the expression: (JustC n, NothingC) - In an equation for ‘f’: f n _ = (JustC n, NothingC) - In an equation for ‘blockToNodeList’: - blockToNodeList b - = foldBlockNodesF (f, l) b z - where - z :: - EitherCO e (EitherCO e (A C O n) (A O O n)) (EitherCO e (A C O n) (A O O n)) - z = undefined - f :: - n C O - -> EitherCO e (A C O n) (A O O n) -> EitherCO e (A C O n) (A O O n) - f n _ = (JustC n, NothingC) - .... - • Relevant bindings include - f :: n C O - -> EitherCO e (A C O n) (A O O n) -> EitherCO e (A C O n) (A O O n) - (bound at T4093b.hs:31:5) - l :: n O C - -> EitherCO e (A C O n) (A O O n) -> EitherCO e (A C C n) (A O C n) - (bound at T4093b.hs:34:5) - b :: Block n e x (bound at T4093b.hs:25:17) - blockToNodeList :: Block n e x -> A e x n (bound at T4093b.hs:25:1) +
+T4093b.hs:31:13: error:
+ • Could not deduce: e ~ C
+ from the context: (EitherCO e (A C O n) (A O O n) ~ A e O n,
+ EitherCO x (A C C n) (A C O n) ~ A C x n)
+ bound by the type signature for:
+ blockToNodeList :: (EitherCO e (A C O n) (A O O n) ~ A e O n,
+ EitherCO x (A C C n) (A C O n) ~ A C x n) =>
+ Block n e x -> A e x n
+ at T4093b.hs:(19,1)-(22,26)
+ ‘e’ is a rigid type variable bound by
+ the type signature for:
+ blockToNodeList :: forall (n :: * -> * -> *) e x.
+ (EitherCO e (A C O n) (A O O n) ~ A e O n,
+ EitherCO x (A C C n) (A C O n) ~ A C x n) =>
+ Block n e x -> A e x n
+ at T4093b.hs:(19,1)-(22,26)
+ Expected type: EitherCO e (A C O n) (A O O n)
+ Actual type: (MaybeC C (n C O), MaybeC O (n O C))
+ • In the expression: (JustC n, NothingC)
+ In an equation for ‘f’: f n _ = (JustC n, NothingC)
+ In an equation for ‘blockToNodeList’:
+ blockToNodeList b
+ = foldBlockNodesF (f, l) b z
+ where
+ z ::
+ EitherCO e (EitherCO e (A C O n) (A O O n)) (EitherCO e (A C O n) (A O O n))
+ z = undefined
+ f ::
+ n C O
+ -> EitherCO e (A C O n) (A O O n) -> EitherCO e (A C O n) (A O O n)
+ f n _ = (JustC n, NothingC)
+ ....
+ • Relevant bindings include
+ f :: n C O
+ -> EitherCO e (A C O n) (A O O n) -> EitherCO e (A C O n) (A O O n)
+ (bound at T4093b.hs:31:5)
+ l :: n O C
+ -> EitherCO e (A C O n) (A O O n) -> EitherCO e (A C C n) (A O C n)
+ (bound at T4093b.hs:34:5)
+ b :: Block n e x (bound at T4093b.hs:25:17)
+ blockToNodeList :: Block n e x -> A e x n (bound at T4093b.hs:25:1)
|