Skip to content

Parse error on unparenthesized nested foralls #209

@int-index

Description

@int-index

Test case:

incu :: () -> forall a. Num a => a -> a
incu _ x = x + 1

main = print (incu () 41)

Expected behavior (ghc used as reference)

$ runhaskell Test.hs  
42

Actual behavior (mhs)

$ ./bin/mhs -r Test.hs

mhs: uncaught exception: error: "Test.hs": line 1, col 15:
  found:    forall
  expected: LQIdent ( UQIdent [ literal

Adding parentheses results in #208, but it seems to be a separate issue from the parse error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions