stil4m/elm-analyse

Empty record pattern matching (destructuring) causes parse error

SiriusStarr opened this issue · 0 comments

Pattern-matching on zero record fields causes elm-analyse to fail with a parse error despite being valid Elm.

Both of the following fail with Could not load file due to: Unexpected parse error but compile fine.

type Type
    = WithRecord { test : Bool }


test : Type -> Bool
test t =
    case t of
        WithRecord {} ->
            True
type alias Record =
    { test : Bool }


test2 : Record -> Bool
test2 {} =
    True

In either case, replacing {} with _ eliminates the error, of course.