Skip to content
Snippets Groups Projects
Commit 605869c7 authored by Vladislav Zavialov's avatar Vladislav Zavialov Committed by Ben Gamari
Browse files

Fix optSemi type in Parser.y

The definition of 'optSemi' claimed it had type

([Located a],Bool)

Note that its production actually returns ([Located Token],Bool):

  : ';' { ([$1],True) }   -- $1 :: Located Token

Due to an infelicity in the implementation of 'happy -c', it effectively
resulted in 'unsafeCoerce :: Token -> a'.
See https://github.com/simonmar/happy/pull/134

If any consumer of 'optSemi' tried to instantiate 'a' to something not
representationally equal to 'Token', they would experience a segfault.

In addition to that, this definition made it impossible to compile Parser.y
without the -c flag (as it's reliant on this bug to cast 'Token' to 'forall
a. a').
parent 334dd6da
4 merge requests!1923Fix #14690 - :steplocal panics after break-on-error. Backport to 8.8.2,!1318GHC 8.8 merges,!1187Combined merge for 8.8,!940Backport 071bef18 to ghc-8.8
Pipeline #6402 passed with warnings
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment