feat: full match expressions in bootstrap and selfhost
Lower match to if-else for literals, ranges, enum tags, and wildcards. Fix bootstrap literal arms that always matched; port real arm AST/parser and Lcx_LowerMatch to selfhost with last-expression return. Expand pattern_matching example and add parse/use-after-move/double-mut golden diagnostics. Selfhost-loop remains binary-identical.
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
[Package]
|
||||
Name = "double_mut_borrow"
|
||||
Version = "0.1.0"
|
||||
Type = "bin"
|
||||
|
||||
[Build]
|
||||
Output = "Bin"
|
||||
@@ -0,0 +1,6 @@
|
||||
error: type errors in project
|
||||
error: mutable borrow conflict: arguments 1 and 2 both borrow '&mut x'
|
||||
--> FILE:10:11
|
||||
|
|
||||
10 | TwoMut(&x, &x);
|
||||
| ^
|
||||
@@ -0,0 +1,12 @@
|
||||
@[Checked]
|
||||
func TwoMut(a: &mut int, b: &mut int) {
|
||||
*a = 1;
|
||||
*b = 2;
|
||||
}
|
||||
|
||||
@[Checked]
|
||||
func Main() -> int {
|
||||
var x: int = 0;
|
||||
TwoMut(&x, &x);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user