[commit: ghc] master: Comments only (403cfc9)
git at git.haskell.org
git at git.haskell.org
Mon Jun 1 16:15:52 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/403cfc9187b9df560768bb809f4d280fb999639c/ghc
>---------------------------------------------------------------
commit 403cfc9187b9df560768bb809f4d280fb999639c
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Mon Jun 1 08:57:23 2015 +0100
Comments only
>---------------------------------------------------------------
403cfc9187b9df560768bb809f4d280fb999639c
compiler/typecheck/TcValidity.hs | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/compiler/typecheck/TcValidity.hs b/compiler/typecheck/TcValidity.hs
index 16059e6..370cad2 100644
--- a/compiler/typecheck/TcValidity.hs
+++ b/compiler/typecheck/TcValidity.hs
@@ -132,12 +132,19 @@ We call checkAmbiguity
(b) in checkValidType
Conncerning (b), you might wonder about nested foralls. What about
- f :: (forall a. Eq a => Int) -> Int
+ f :: forall b. (forall a. Eq a => b) -> b
The nested forall is ambiguous. Originally we called checkAmbiguity
-in the forall case of check_type, but that had a bad consequence:
-we got two error messages about (Eq b) in a nested forall like this:
- g :: forall a. Eq a => forall b. Eq b => a -> a
+in the forall case of check_type, but that had two bad consequences:
+ * We got two error messages about (Eq b) in a nested forall like this:
+ g :: forall a. Eq a => forall b. Eq b => a -> a
+ * If we try to check for ambiguity of an nested forall like
+ (forall a. Eq a => b), the implication constraint doesn't bind
+ all the skolems, which results in "No skolem info" in error
+ messages (see Trac #10432).
+
To avoid this, we call checkAmbiguity once, at the top, in checkValidType.
+(I'm still a bit worried about unbound skolems when the type mentions
+in-scope type variables.)
In fact, because of the co/contra-variance implemented in tcSubType,
this *does* catch function f above. too.
More information about the ghc-commits
mailing list