Compiler: Fix empty return compound codegen

This commit is contained in:
Krzosa Karol
2023-04-21 09:06:48 +02:00
parent 3207a390c8
commit 1e12f51451
5 changed files with 16 additions and 7 deletions

View File

@@ -9,11 +9,7 @@ Pop :: (a: *Array($T)): T
if a.len > 0
a.len -= 1
return a.data[a.len]
// @reproduction: c compile error, probably because of compound expression (Array){}
// return {}
result: T
return result
return {}
Contains :: (a: *Array($T), item: *T): bool
result := item >= a.data && item < a.data + a.len

View File

@@ -1,4 +1,10 @@
/*@language_refactor: Remove tuples and simplify, Make var unpacking general*/
/*@language_todo: make polymorphism checking more robust*/
/*@language_todo: labeled block
It acts just like a scope in C.

View File

@@ -85,7 +85,7 @@ GetRandomUnblockedP :: (m: *Map): V2I
return p
Assert(false, "Invalid codepath")
r: V2I; return r
return {}
Init :: ()
CurrentMap.x = WinX / RectX