-
Notifications
You must be signed in to change notification settings - Fork 83
Open
Description
In haxe, we can use pattern matching on structures using switch statements (as documented in the Haxe Manual.
This example code from there:
var myStructure = {
name: "haxe",
rating: "awesome"
};
var value = switch (myStructure) {
case {name: "haxe", rating: "poor"}:
throw false;
case {rating: "awesome", name: n}:
n;
case _:
"no awesome language found";
}
trace(value);would return haxe back
But in polymod this isn't supported and errors with these errors, or returns null if only the first case is used:
ERROR Error while executing function WorstCParser.onCreate()#0:
Tried to access "n", but it is not a valid field or method.
ERROR Error while executing function WorstCParser.onCreate()#0:
Tried to access "_", but it is not a valid field or method.Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels