You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The point is that I can make duplicate fields by using record extension. The following code compiles without errors:
type alias A a =
{a | x : Int}
type alias B =
{x : String}
test : A B
test =
{ x = 1}
In all cases, the actual type is taken from the outermost type (A here). I think this should be a compile-time error, for the same reasons that field duplication is forbidden in other contexts.
Furthermore, having fields of the same name is also the only case that breaks a simple assumption about type aliases with record extension:
type alias T a =
{a | .... }
type alias U a =
{a | ... }
Now, T (U a) and U (T a) are exactly the same type for all a (unless there are duplicate field names).
The text was updated successfully, but these errors were encountered:
This is related to #1344 and #1323, but as the following bug is not fixed in a build made after those bugs were closed in #1374, I think it is relevant (tested against build taken from https://groups.google.com/forum/#!topic/elm-dev/c_BDwK5UXFs)
The point is that I can make duplicate fields by using record extension. The following code compiles without errors:
In all cases, the actual type is taken from the outermost type (A here). I think this should be a compile-time error, for the same reasons that field duplication is forbidden in other contexts.
Furthermore, having fields of the same name is also the only case that breaks a simple assumption about type aliases with record extension:
Now,
T (U a)
andU (T a)
are exactly the same type for all a (unless there are duplicate field names).The text was updated successfully, but these errors were encountered: