Opened 3 years ago

Closed 3 years ago

#10299 closed bug (fixed)

Inconsistent parsing of lifted list constructor

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

Description

The notes for HsType explain that '[] should parse as a HsExplicitListTy but it currently parses as a HsTyVar.

I think this shift-reduce conflict might be to blame?

state 432 contains 1 shift/reduce conflicts.

        atype -> SIMPLEQUOTE '[' . comma_types0 ']'         (rule 318) 
        sysdcon -> '[' . ']'                                (rule 613) 

    Conflict: ']' (empty comma_types0 reudes)

TODO: Why? 

Change History (5)

comment:1 Changed 3 years ago by mpickering

Differential Rev(s): D840
Status: newpatch

comment:2 Changed 3 years ago by mpickering

Milestone: 7.10.2

comment:3 Changed 3 years ago by alanz

Differential Rev(s): D840Phab:D840

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

In caeae1a33e28745b51d952b034e253d3e51e0605/ghc:

Correct parsing of lifted empty list constructor

See #10299

Previously `'[]` was parsed to a `HsTyVar` rather than a
`HsExplicitListTy`. This patch fixes the
shift-reduce conflict which caused this problem.

Reviewed By: alanz, austin

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

comment:5 Changed 3 years ago by thoughtpolice

Resolution: fixed
Status: patchclosed

Merged to ghc-7.10.

Note: See TracTickets for help on using tickets.