Skip to content

parser: opt_kind_sig has incorrect SrcSpan

The production for opt_kind_sig is

opt_kind_sig :: { Located (Maybe (LHsKind RdrName)) }
        :                             { noLoc Nothing }
        | '::' kind                   {% ajl (sLL $1 $> (Just $2)) AnnDcolon (gl $1) }

The outer Location is used only to get the full span for the enclosing declration, and is then stripped. The inner LHsKind then has a SrcSpan that does not include the '::'

Extend the SrcSpan on $2 to include $1

Trac metadata
Trac field Value
Version 7.10.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Parser)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC mpickering
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information