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

Identity type alias causes problems #2298

Open
Heimdell opened this issue Feb 22, 2023 · 2 comments
Open

Identity type alias causes problems #2298

Heimdell opened this issue Feb 22, 2023 · 2 comments

Comments

@Heimdell
Copy link

Quick Summary:

I entered an identity type alias, but elm refuses to unify LHS and RHS of the type alias later.

SSCCE

module Both.Msg exposing (..)

type alias Msg a = a

make : a -> Msg a
make = identity

=>

Something is off with the body of the `make` definition:

6| make = identity
          ^^^^^^^^
This `identity` value is a:

    a -> a

But the type annotation on `make` says it should be:

    a -> Msg a
  • Elm: 0.19.1
  • Browser: irrelevant
  • Operating System: irrelevant

Additional Details

Msg a and a, for all a, by definition, have to be the same type. Yet, Elm refuses to acknowledge that anything a is also Msg a.

Funny thing, the code

module Both.Msg exposing (..)

type alias Msg a = a

make : Msg a -> a
make = identity

compiles just fine.

@github-actions
Copy link

Thanks for reporting this! To set expectations:

  • Issues are reviewed in batches, so it can take some time to get a response.
  • Ask questions in a community forum. You will get an answer quicker that way!
  • If you experience something similar, open a new issue. We like duplicates.

Finally, please be patient with the core team. They are trying their best with limited resources.

@Heimdell
Copy link
Author

Duplicate of #2252

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

1 participant