[commit: ghc] master: Make HsIParamTy have a Located HsIPName (1a6bdca)

git at git.haskell.org git at git.haskell.org
Tue Jan 10 15:05:04 UTC 2017


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/1a6bdca01b7ac214d8aca52927e14547395697e8/ghc

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

commit 1a6bdca01b7ac214d8aca52927e14547395697e8
Author: Alan Zimmerman <alan.zimm at gmail.com>
Date:   Tue Jan 10 17:01:50 2017 +0200

    Make HsIParamTy have a Located HsIPName
    
    To simplify API Annotations.
    
    Updates haddock submodule


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

1a6bdca01b7ac214d8aca52927e14547395697e8
 compiler/hsSyn/HsTypes.hs                         | 2 +-
 compiler/parser/Parser.y                          | 8 ++++----
 compiler/typecheck/TcHsType.hs                    | 2 +-
 testsuite/tests/ghc-api/annotations/T10399.stdout | 1 -
 utils/haddock                                     | 2 +-
 5 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/compiler/hsSyn/HsTypes.hs b/compiler/hsSyn/HsTypes.hs
index 53f200f..7dc3d12 100644
--- a/compiler/hsSyn/HsTypes.hs
+++ b/compiler/hsSyn/HsTypes.hs
@@ -497,7 +497,7 @@ data HsType name
 
       -- For details on above see note [Api annotations] in ApiAnnotation
 
-  | HsIParamTy          HsIPName         -- (?x :: ty)
+  | HsIParamTy          (Located HsIPName) -- (?x :: ty)
                         (LHsType name)   -- Implicit parameters as they occur in contexts
       -- ^
       -- > (?x :: ty)
diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y
index dfb6755..fadb8e7 100644
--- a/compiler/parser/Parser.y
+++ b/compiler/parser/Parser.y
@@ -1716,8 +1716,8 @@ ctype   :: { LHsType RdrName }
                                          >> return (sLL $1 $> $
                                             HsQualTy { hst_ctxt = $1
                                                      , hst_body = $3 }) }
-        | ipvar '::' type             {% ams (sLL $1 $> (HsIParamTy (unLoc $1) $3))
-                                             [mj AnnVal $1,mu AnnDcolon $2] }
+        | ipvar '::' type             {% ams (sLL $1 $> (HsIParamTy $1 $3))
+                                             [mu AnnDcolon $2] }
         | type                        { $1 }
 
 ----------------------
@@ -1741,8 +1741,8 @@ ctypedoc :: { LHsType RdrName }
                                          >> return (sLL $1 $> $
                                             HsQualTy { hst_ctxt = $1
                                                      , hst_body = $3 }) }
-        | ipvar '::' type             {% ams (sLL $1 $> (HsIParamTy (unLoc $1) $3))
-                                             [mj AnnVal $1,mu AnnDcolon $2] }
+        | ipvar '::' type             {% ams (sLL $1 $> (HsIParamTy $1 $3))
+                                             [mu AnnDcolon $2] }
         | typedoc                     { $1 }
 
 ----------------------
diff --git a/compiler/typecheck/TcHsType.hs b/compiler/typecheck/TcHsType.hs
index 3fa6077..c69de3a 100644
--- a/compiler/typecheck/TcHsType.hs
+++ b/compiler/typecheck/TcHsType.hs
@@ -632,7 +632,7 @@ tc_hs_type mode (HsExplicitTupleTy _ tys) exp_kind
     arity = length tys
 
 --------- Constraint types
-tc_hs_type mode (HsIParamTy n ty) exp_kind
+tc_hs_type mode (HsIParamTy (L _ n) ty) exp_kind
   = do { MASSERT( isTypeLevel (mode_level mode) )
        ; ty' <- tc_lhs_type mode ty liftedTypeKind
        ; let n' = mkStrLitTy $ hsIPNameFS n
diff --git a/testsuite/tests/ghc-api/annotations/T10399.stdout b/testsuite/tests/ghc-api/annotations/T10399.stdout
index 612ecfd..0b37983 100644
--- a/testsuite/tests/ghc-api/annotations/T10399.stdout
+++ b/testsuite/tests/ghc-api/annotations/T10399.stdout
@@ -10,7 +10,6 @@
 ((Test10399.hs:10:1-35,AnnSemi), [Test10399.hs:12:1]),
 ((Test10399.hs:10:1-35,AnnType), [Test10399.hs:10:1-4]),
 ((Test10399.hs:10:12-35,AnnDcolon), [Test10399.hs:10:24-25]),
-((Test10399.hs:10:12-35,AnnVal), [Test10399.hs:10:12-22]),
 ((Test10399.hs:12:1-66,AnnEqual), [Test10399.hs:12:8]),
 ((Test10399.hs:12:1-66,AnnFunId), [Test10399.hs:12:1-6]),
 ((Test10399.hs:12:1-66,AnnSemi), [Test10399.hs:14:1]),
diff --git a/utils/haddock b/utils/haddock
index b34497c..b19ea3a 160000
--- a/utils/haddock
+++ b/utils/haddock
@@ -1 +1 @@
-Subproject commit b34497c36cd01a9c8a08ec3133ec94783642e43d
+Subproject commit b19ea3ababeb231157c4a067c43003e09b1f0185



More information about the ghc-commits mailing list