Fix bug with empty returns
Signed-off-by: Slendi <slendi@socopon.com>
This commit is contained in:
parent
a5fd0f24dc
commit
cb3183ba64
@ -468,6 +468,9 @@ type_check :: proc(ast: ^Node, parent_ast: ^Node) {
|
|||||||
message_create(.Error, fmt.aprintf("Return statement outside of function"), ast.range),
|
message_create(.Error, fmt.aprintf("Return statement outside of function"), ast.range),
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
if function_return_type.kind == .Integer && function_return_type.bit_size == 0 && ast.children[0] == nil {
|
||||||
|
break
|
||||||
|
}
|
||||||
type_check(ast.children[0], ast)
|
type_check(ast.children[0], ast)
|
||||||
ok, cast_required := compare_types(function_return_type, ast.children[0].return_type)
|
ok, cast_required := compare_types(function_return_type, ast.children[0].return_type)
|
||||||
if cast_required {
|
if cast_required {
|
||||||
@ -736,7 +739,6 @@ find_function_definitions :: proc(ast_: ^Node) -> (ret: [dynamic]^FunctionType)
|
|||||||
}
|
}
|
||||||
append(&ret, fn)
|
append(&ret, fn)
|
||||||
case .Struct:
|
case .Struct:
|
||||||
fmt.printf("Struct found\n")
|
|
||||||
struct_ := struct_create()
|
struct_ := struct_create()
|
||||||
should_ignore := true
|
should_ignore := true
|
||||||
for field in ast.children {
|
for field in ast.children {
|
||||||
|
@ -28,6 +28,7 @@ fn DrawRectangleWrap(x y w h: i32, c: Color) {
|
|||||||
|
|
||||||
fn DrawCircleWrap(x y: i32, r: f32, c: Color) {
|
fn DrawCircleWrap(x y: i32, r: f32, c: Color) {
|
||||||
DrawCircle x y r (ColorToRaylib c)
|
DrawCircle x y r (ColorToRaylib c)
|
||||||
|
ret
|
||||||
}
|
}
|
||||||
|
|
||||||
let white :: .Color{69 69 69 255}
|
let white :: .Color{69 69 69 255}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user