-
-
Notifications
You must be signed in to change notification settings - Fork 154
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
Issue
When assigning a value the compiler seems to guess a type of value and then it type-checks the value with a state
field. This results in an error where properly defined data structure cannot be compiled.
In the code below both islands
and connections
look the same:
state puzzle : Puzzle = {
islands =
{
list = [],
fields = Map.empty()
},
connections =
{
list = [],
fields = Map.empty()
},
width = 0,
height = 0,
maxConnectionCount = 2
}
However, internally they are different in all (2) subfields:
record Connections {
list : Array(Connection),
fields : Map(Number, IndexPair)
}
record Islands {
list : Array(Island),
fields : Map(Number, Bool)
}
Expected behaviour
Since I've defined my state puzzle
to be a specific type (here Puzzle
) I would expect that to be a priority. Thus, type-check should continue the search.
Reproduction
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested