summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2018-11-05 13:48:27 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2018-11-15 09:05:23 +0000
commitfe0576426d3ef07d7743c65e34c8b04ce0616426 (patch)
tree24a024f6e60bd8afd58d99ed2721bec736ab16aa
parenteb46345d37ee61575e6fed04da718c1b7ee0bb99 (diff)
downloadhaskell-fe0576426d3ef07d7743c65e34c8b04ce0616426.tar.gz
Comments only, about polykinded TyConApps
See Trac #15704 comment:8ff
-rw-r--r--compiler/types/Unify.hs14
1 files changed, 13 insertions, 1 deletions
diff --git a/compiler/types/Unify.hs b/compiler/types/Unify.hs
index 951a3f9f93..62d53dc60a 100644
--- a/compiler/types/Unify.hs
+++ b/compiler/types/Unify.hs
@@ -888,6 +888,17 @@ Note that
* One better way is to ensure that type patterns (the template
in the matching process) have no casts. See Trac #14119.
+Note [Polykinded tycon applications]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Suppose T :: forall k. Type -> K
+and we are unifying
+ ty1: T @Type Int :: Type
+ ty2: T @(Type->Type) Int Int :: Type
+
+These two TyConApps have the same TyCon at the front but they
+(legitimately) have different numbers of arguments. They
+are surelyApart, so we can report that without looking any
+further (see Trac #15704).
-}
-------------- unify_ty: the main workhorse -----------
@@ -1025,7 +1036,8 @@ unify_tys env orig_xs orig_ys
= do { unify_ty env x y (mkNomReflCo $ typeKind x)
; go xs ys }
go _ _ = surelyApart
- -- Possibly different saturations of a polykinded tycon (See Trac #15704)
+ -- Possibly different saturations of a polykinded tycon
+ -- See Note [Polykinded tycon applications]
---------------------------------
uVar :: UMEnv