Skip to content

nullary patterns in function heads cause syntax errors #123

@BrianHicks

Description

@BrianHicks

Hello! I've got something a little weird. I'm making some tools with tree-sitter-elm and found that nullary patterns in function heads will cause a syntax error in tree-sitter-elm, but be accepted by Elm proper. Here's a SSCCE:

module Main exposing (..)


type Foo
    = Bar


fooToString : Foo -> String
fooToString Bar =
    "Bar"

Tree-sitter-elm will say there's a syntax error on line 9, column 13 (the Bar in fooToString Bar.) Changing Bar to _ resolves the problem.

Here it is in an Ellie, being compiled by Elm: https://ellie-app.com/hST6r7VtQjKa1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions