lang: Check that set type matches actual expression
I forgot to include these two invariants which are occasionally necessary, although in most cases they're necessary to prevent incorrect code from getting past unification. In any case, they would have been caught by the engine.
This commit is contained in:
@@ -859,6 +859,7 @@ arg:
|
||||
}
|
||||
;
|
||||
bind:
|
||||
// `$s = "hey"`
|
||||
VAR_IDENTIFIER EQUALS expr
|
||||
{
|
||||
posLast(yylex, yyDollar) // our pos
|
||||
@@ -867,6 +868,8 @@ bind:
|
||||
Value: $3.expr,
|
||||
}
|
||||
}
|
||||
// `$x bool = true`
|
||||
// `$x int = if true { 42 } else { 13 }`
|
||||
| VAR_IDENTIFIER type EQUALS expr
|
||||
{
|
||||
posLast(yylex, yyDollar) // our pos
|
||||
|
||||
Reference in New Issue
Block a user