Compiler: Fix empty return compound codegen
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -85,7 +85,7 @@ GetRandomUnblockedP :: (m: *Map): V2I
|
||||
return p
|
||||
|
||||
Assert(false, "Invalid codepath")
|
||||
r: V2I; return r
|
||||
return {}
|
||||
|
||||
Init :: ()
|
||||
CurrentMap.x = WinX / RectX
|
||||
|
||||
Reference in New Issue
Block a user