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

A type alias allows the same key to be defined multiple times #867

Closed
alessiosantangelo opened this Issue May 17, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@alessiosantangelo

alessiosantangelo commented May 17, 2017

Hi, we experienced an issue using Elm in production which breaks IE 11.
It seems that Elm allows the same key to be defined multiple times inside the same "piece" of model.
E.g.

type alias Save =
    { code : Id
    , totalPrice : Amount
    , hasDiscount : Bool
    , hasFranchigia : Bool
    , hasFranchigiaSoisy : Bool
    , canBeBooked : Bool
    , coverages : List Coverage
    , contractor : Contractor
    , conventionDiscount : Maybe ConventionDiscount
    , hasEarlyDiscount : Bool
    , hasPressureDiscount : Bool
    , hasFranchigia : Bool
    , colorCase : ColorCase
    }

The hasFranchigia
is used two times inside the same type.
The compilers does not throw any error or warning, but the Javascript Strict Mode doesn't allow multiple instances of the same key in the same object.

Probably this is not a problem of Elm itself, but I would share it with you.
Thanks,
Alessio

@process-bot

This comment has been minimized.

Show comment
Hide comment
@process-bot

process-bot May 17, 2017

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.

process-bot commented May 17, 2017

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.

@alessiosantangelo alessiosantangelo changed the title from Model allows the same key to be defined multiple times to A type alias allows the same key to be defined multiple times May 17, 2017

@lukewestby

This comment has been minimized.

Show comment
Hide comment
@lukewestby

lukewestby May 17, 2017

Member

Hey @alessiosantangelo,

Probably this is not a problem of Elm itself, but I would share it with you.

this looks like something that we would want to address. Since this issue has to do with the compiler
I'm going to close it here and would you mind reopening on https://github.com/elm-lang/elm-compiler? A simple copy-and-paste into an issue over there would be great.

Thanks!

Member

lukewestby commented May 17, 2017

Hey @alessiosantangelo,

Probably this is not a problem of Elm itself, but I would share it with you.

this looks like something that we would want to address. Since this issue has to do with the compiler
I'm going to close it here and would you mind reopening on https://github.com/elm-lang/elm-compiler? A simple copy-and-paste into an issue over there would be great.

Thanks!

@lukewestby lukewestby closed this May 17, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment