Skip to content

Type checker compiler crash #1326

@folkertdev

Description

@folkertdev

I'm working with this snippet

points : List a -> List ((a, List a))
points elems = 
    case elems of
        [] -> 
            []
        (x::xs) -> 
            (x, xs) :: (List.map (\(b, bs) -> (b, x::bs)) xs)

Compiling this code result in a compiler crash:

-- TYPE MISMATCH ---------------------------------------------- DecisionTree.elm

The type annotation for `points` does not match its definition.

142│ points : List a -> List ((a, List a))
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The type annotation is saying:

    List a -> List ( a, List a )

But I am inferring that the definition has this type:

    elm-make: type applications should start with a type atom

checked with elm-make v0.16.0 and elm-lang.org/try

(as an aside: elm-lang.org/try gives no value when the compiler crashes. This may be a conscious decision (maybe security concerns), but I'd rather see what went wrong on the backend)

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