[commit: ghc] master: Add some commentary re: fix to #11203 (3910d3e)

git at git.haskell.org git at git.haskell.org
Fri Dec 15 19:30:39 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/3910d3e2f8b3084f6f6de3d9aeb8d8ed20670245/ghc

>---------------------------------------------------------------

commit 3910d3e2f8b3084f6f6de3d9aeb8d8ed20670245
Author: Richard Eisenberg <rae at cs.brynmawr.edu>
Date:   Fri Dec 15 14:27:47 2017 -0500

    Add some commentary re: fix to #11203
    
    The fix for #11203 prohibits duplicate SigTvs in non-CUSK kind
    signatures by checking for duplicates after type inference is
    done. This works well. GHC also checks for duplicate SigTvs
    after working with partial type signatures (another place where
    SigTvs arise). However, neither fix eliminates this whole class
    of problems (because doing so would be heavier than we would
    like). So, this comment adds a warning to users of newSigTyVar
    to be aware of problems with duplicates.


>---------------------------------------------------------------

3910d3e2f8b3084f6f6de3d9aeb8d8ed20670245
 compiler/typecheck/TcMType.hs | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/compiler/typecheck/TcMType.hs b/compiler/typecheck/TcMType.hs
index 7f2f92a..3d45129 100644
--- a/compiler/typecheck/TcMType.hs
+++ b/compiler/typecheck/TcMType.hs
@@ -583,6 +583,13 @@ instead of the buggous
 ************************************************************************
 -}
 
+-- a SigTv can unify with type *variables* only, including other SigTvs
+-- and skolems. Sometimes, they can unify with type variables that the
+-- user would rather keep distinct; see #11203 for an example.
+-- So, any client of this
+-- function needs to either allow the SigTvs to unify with each other
+-- (say, for pattern-bound scoped type variables), or check that they
+-- don't (say, with a call to findDubSigTvs).
 newSigTyVar :: Name -> Kind -> TcM TcTyVar
 newSigTyVar name kind
   = do { details <- newMetaDetails SigTv



More information about the ghc-commits mailing list