Skip to content

Inconsistent error report comparing with elm - TOO MANY ARGS #113

@decioferreira

Description

@decioferreira

Describe the bug
Inconsistent error report comparing with elm

To Reproduce

module Example exposing (..)


type alias Record =
    { name : String
    , age : Int
    }


main =
    Record "John" 20 21

Expected behavior

% elm make src/Example.elm        
Detected problems in 1 module.
-- TOO MANY ARGS ----------------------------------------------- src/Example.elm

The `Record` constructor expects 2 arguments, but it got 3 instead.

11|     Record "John" 20 21
        ^^^^^^
Are there any missing commas? Or missing parentheses?

Actual behavior / error output

% guida make src/Example.elm
Detected problems in 1 module.
-- TYPE MISMATCH ----------------------------------------------- src/Example.elm

This expression is being used in an unexpected way:

11|     Record "John" 20 21
        ^^^^^^
This `Record` value is a:

    String -> Int -> Record

But you are trying to use it as:

    String -> Int -> number -> a

Hint: It looks like it takes too few arguments. I was expecting 1 more.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions