Opened 5 years ago

Closed 5 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:


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 5 years ago by mpickering

Differential Rev(s): D840
Status: newpatch

comment:2 Changed 5 years ago by mpickering

Milestone: 7.10.2

comment:3 Changed 5 years ago by alanz

Differential Rev(s): D840Phab:D840

comment:4 Changed 5 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:

comment:5 Changed 5 years ago by thoughtpolice

Resolution: fixed
Status: patchclosed

Merged to ghc-7.10.

Note: See TracTickets for help on using tickets.