Opened 3 years ago

Closed 3 years ago

#10254 closed bug (fixed)

parser : the API annotation on opt_sig is being discarded

Reported by: alanz Owned by: alanz
Priority: normal Milestone: 7.10.2
Component: Compiler (Parser) Version: 7.10.1
Keywords: ApiAnnotations Cc: mpickering
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s): Phab:D822
Wiki Page:

Description

The opt_sig production is defined as

opt_sig :: { ([AddAnn],Maybe (LHsType RdrName)) }
        : {- empty -}                   { ([],Nothing) }
        | '::' sigtype                  { ([mj AnnDcolon $1],Just $2) }

It is used in the alt and decl_no_th productions, but neither of them add the returned annotations.

Change History (4)

comment:1 Changed 3 years ago by alanz

Differential Rev(s): Phab:D822

comment:2 Changed 3 years ago by alanz

Status: newpatch

comment:3 Changed 3 years ago by Austin Seipp <austin@…>

In 919b51174163907d2bc3bb41aadf56aa8bb42e9b/ghc:

parser : the API annotation on opt_sig is being discarded

The opt_sig production is defined as

  opt_sig :: { ([AddAnn],Maybe (LHsType RdrName)) }
          : {- empty -}                   { ([],Nothing) }
          | '::' sigtype                  { ([mj AnnDcolon $1],Just $2) }

It is used in the alt and decl_no_th productions, but neither of them
add the returned annotations.

This commit captures the annotations in the calling productions.

Reviewed By: austin

Differential Revision: https://phabricator.haskell.org/D822

GHC Trac Issues: #10254

comment:4 Changed 3 years ago by thoughtpolice

Resolution: fixed
Status: patchclosed

Merged to ghc-7.10.

Note: See TracTickets for help on using tickets.