Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leaving type parameters out of type annotation compiles when it shouldn't #1542

Closed
naddeoa opened this issue Dec 24, 2016 · 5 comments
Closed

Comments

@naddeoa
Copy link

naddeoa commented Dec 24, 2016

We were talking about some weirdness in the general chat today and user alon came up with a simple example to showcase it. The following code compiles.

type SomeUnion a b c
    = SomeType a
    | SomeOtherType b c


myFunction : SomeUnion a -> String
myFunction atype =
    "hmm but why?"

SomeUnion takes three type parameters but only one is supplied. No one will be able to call this function because no one can make a SomeUnion a obviously, so I suppose the damage is as minimal as it gets.

This was tested on Elm 0.18.0 on Ubuntu 16.04.

@process-bot
Copy link

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

@mgold
Copy link
Contributor

mgold commented Dec 25, 2016

Seems to be part of "no kind checking", #1373. Thanks for the report!

@evancz evancz mentioned this issue Dec 27, 2016
4 tasks
@rtfeldman
Copy link
Member

Added to the No Kind Checking section of #1373 - thanks again!

@evancz
Copy link
Member

evancz commented Mar 7, 2018

In the development build, I am getting:

- TOO FEW ARGS ------------------------------------------------------- temp.elm

The `SomeUnion` type was given 1 argument:

14| myFunction : SomeUnion a -> String
                 ^^^^^^^^^^^
But it needs 3 arguments. What is missing? Are some parentheses misplaced?

Because we now rule this out in the canonicalization phase. Thanks for the report!

@naddeoa
Copy link
Author

naddeoa commented Mar 7, 2018

Nice, thank a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants