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 = "use_after_move"
|
||||
Version = "0.1.0"
|
||||
Type = "bin"
|
||||
|
||||
[Build]
|
||||
Output = "Bin"
|
||||
@@ -0,0 +1,7 @@
|
||||
error: type errors in project
|
||||
error: use of moved value 'a'
|
||||
--> FILE:10:25
|
||||
|
|
||||
10 | let c: own String = a;
|
||||
| ^
|
||||
= help: the value was moved; clone it or restructure ownership
|
||||
@@ -0,0 +1,12 @@
|
||||
@[Checked]
|
||||
func Take(s: own String) -> own String {
|
||||
return s;
|
||||
}
|
||||
|
||||
@[Checked]
|
||||
func Main() -> int {
|
||||
let a: own String = "hello";
|
||||
let b: own String = Take(a);
|
||||
let c: own String = a;
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user