Fixed some error handling for invalid if statements. Started if codegen.
This commit is contained in:
6
test/semant/float_if_cond.golden
Normal file
6
test/semant/float_if_cond.golden
Normal file
@@ -0,0 +1,6 @@
|
||||
[1;37mtest/float_if_cond.ink:0,0: [31merror: [37mType of expression in if condition has to be bool.
|
||||
[96mif 1.0
|
||||
^^^
|
||||
1.0 has type float
|
||||
|
||||
[36m[37m
|
||||
6
test/semant/if_cond_assign.golden
Normal file
6
test/semant/if_cond_assign.golden
Normal file
@@ -0,0 +1,6 @@
|
||||
[1;37mtest/if_cond_assign.ink:0,0: [31merror: [37mType of expression in if condition has to be bool.
|
||||
[96mif 0 = 100
|
||||
^^^^^^
|
||||
if 0 = 100 { has type int
|
||||
|
||||
[36m[37m
|
||||
6
test/semant/simple_if.golden
Normal file
6
test/semant/simple_if.golden
Normal file
@@ -0,0 +1,6 @@
|
||||
scope (global) [
|
||||
[vertex__vs_main] : (pos : float3) -> float4
|
||||
scope (vertex__vs_main) [
|
||||
[pos] : float3
|
||||
]
|
||||
]
|
||||
6
test/semant/simple_if_else.golden
Normal file
6
test/semant/simple_if_else.golden
Normal file
@@ -0,0 +1,6 @@
|
||||
scope (global) [
|
||||
[vertex__vs_main] : (pos : float3) -> float4
|
||||
scope (vertex__vs_main) [
|
||||
[pos] : float3
|
||||
]
|
||||
]
|
||||
@@ -7,7 +7,20 @@
|
||||
[96m color : float4 = float4(y, 1.0, 1.0, 1.0);
|
||||
^
|
||||
[97m Possible overloads:
|
||||
[96m foreign float4 :: (float, float, float, float) -> float4; (test/wrong_type_for_function.ink:78)
|
||||
[96m foreign float4 :: (float, float, float, float) -> float4; (test/wrong_type_for_function.ink:86)
|
||||
[96m foreign float4 :: (float4) -> float4; (test/wrong_type_for_function.ink:87)
|
||||
[96m foreign float4 :: (float2, float2) -> float4; (test/wrong_type_for_function.ink:88)
|
||||
[96m foreign float4 :: (float2, float, float) -> float4; (test/wrong_type_for_function.ink:89)
|
||||
[96m foreign float4 :: (float, float2, float) -> float4; (test/wrong_type_for_function.ink:90)
|
||||
[96m foreign float4 :: (float, float2, float) -> float4; (test/wrong_type_for_function.ink:90)
|
||||
[96m foreign float4 :: (float, float, float2) -> float4; (test/wrong_type_for_function.ink:91)
|
||||
[96m foreign float4 :: (float, float, float2) -> float4; (test/wrong_type_for_function.ink:91)
|
||||
[96m foreign float4 :: (float3, float) -> float4; (test/wrong_type_for_function.ink:92)
|
||||
[96m foreign float4 :: (float3, float) -> float4; (test/wrong_type_for_function.ink:92)
|
||||
[96m foreign float4 :: (float, float3) -> float4; (test/wrong_type_for_function.ink:93)
|
||||
[96m foreign float4 :: (float, float3) -> float4; (test/wrong_type_for_function.ink:93)
|
||||
[96m foreign float4 :: (float) -> float4; (test/wrong_type_for_function.ink:94)
|
||||
[96m foreign float4 :: (float) -> float4; (test/wrong_type_for_function.ink:94)
|
||||
|
||||
[36m[37m[1;37mtest/wrong_type_for_function.ink:11,24: [31merror: [37mType mismatch. Expected float got float2
|
||||
[96m found:
|
||||
|
||||
Reference in New Issue
Block a user