Fixed some error handling for invalid if statements. Started if codegen.

This commit is contained in:
2025-01-18 22:22:16 +01:00
parent b4d119230b
commit 45ea54cf93
23 changed files with 344 additions and 11 deletions

View File

@@ -0,0 +1,10 @@
vertex main :: (pos : float3 @position) -> float4 @position {
if 0 > 100 {
} else {
} else if 0 > 200 {
}
return float4(0.0);
}

6
test/if_cond_assign.ink Normal file
View File

@@ -0,0 +1,6 @@
vertex main :: (pos : float3 @position) -> float4 @position {
if 0 = 100 {
return float4(pos, 1.0);
}
return float4(0.0);
}

6
test/if_if_if.ink Normal file
View File

@@ -0,0 +1,6 @@
vertex main :: (pos : float3 @position) -> float4 @position {
if if if 0 > 100 {
return float4(pos, 1.0);
}
return float4(0.0);
}

View File

@@ -0,0 +1,39 @@
{kind = TOKEN_VERTEX; ; index = 0 ; length = 6 line = 1 ; column = 0 ; value ='vertex'; }
{kind = TOKEN_IDENTIFIER; ; index = 7 ; length = 4 line = 1 ; column = 7 ; value ='main'; }
{kind = TOKEN_DOUBLECOLON; ; index = 12 ; length = 2 line = 1 ; column = 12 ; value ='::'; }
{kind = TOKEN_LEFTPAREN; ; index = 15 ; length = 1 line = 1 ; column = 15 ; value ='('; }
{kind = TOKEN_IDENTIFIER; ; index = 16 ; length = 3 line = 1 ; column = 16 ; value ='pos'; }
{kind = TOKEN_COLON; ; index = 20 ; length = 1 line = 1 ; column = 20 ; value =':'; }
{kind = TOKEN_IDENTIFIER; ; index = 22 ; length = 6 line = 1 ; column = 22 ; value ='float3'; }
{kind = TOKEN_AT; ; index = 29 ; length = 1 line = 1 ; column = 29 ; value ='@'; }
{kind = TOKEN_IDENTIFIER; ; index = 30 ; length = 8 line = 1 ; column = 30 ; value ='position'; }
{kind = TOKEN_RIGHTPAREN; ; index = 38 ; length = 1 line = 1 ; column = 38 ; value =')'; }
{kind = TOKEN_ARROW; ; index = 40 ; length = 2 line = 1 ; column = 40 ; value ='->'; }
{kind = TOKEN_IDENTIFIER; ; index = 43 ; length = 6 line = 1 ; column = 43 ; value ='float4'; }
{kind = TOKEN_AT; ; index = 50 ; length = 1 line = 1 ; column = 50 ; value ='@'; }
{kind = TOKEN_IDENTIFIER; ; index = 51 ; length = 8 line = 1 ; column = 51 ; value ='position'; }
{kind = TOKEN_LEFTBRACE; ; index = 60 ; length = 1 line = 1 ; column = 60 ; value ='{'; }
{kind = TOKEN_IF; ; index = 64 ; length = 2 line = 2 ; column = 0 ; value ='if'; }
{kind = TOKEN_INTLITERAL; ; index = 67 ; length = 1 line = 2 ; column = 3 ; value ='0'; }
{kind = TOKEN_GREATER; ; index = 69 ; length = 1 line = 2 ; column = 5 ; value ='>'; }
{kind = TOKEN_INTLITERAL; ; index = 71 ; length = 3 line = 2 ; column = 7 ; value ='100'; }
{kind = TOKEN_LEFTBRACE; ; index = 75 ; length = 1 line = 2 ; column = 11 ; value ='{'; }
{kind = TOKEN_RIGHTBRACE; ; index = 83 ; length = 1 line = 4 ; column = 0 ; value ='}'; }
{kind = TOKEN_ELSE; ; index = 85 ; length = 4 line = 4 ; column = 2 ; value ='else'; }
{kind = TOKEN_LEFTBRACE; ; index = 90 ; length = 1 line = 4 ; column = 7 ; value ='{'; }
{kind = TOKEN_RIGHTBRACE; ; index = 99 ; length = 1 line = 6 ; column = 4 ; value ='}'; }
{kind = TOKEN_ELSE; ; index = 101 ; length = 4 line = 6 ; column = 6 ; value ='else'; }
{kind = TOKEN_IF; ; index = 106 ; length = 2 line = 6 ; column = 11 ; value ='if'; }
{kind = TOKEN_INTLITERAL; ; index = 109 ; length = 1 line = 6 ; column = 14 ; value ='0'; }
{kind = TOKEN_GREATER; ; index = 111 ; length = 1 line = 6 ; column = 16 ; value ='>'; }
{kind = TOKEN_INTLITERAL; ; index = 113 ; length = 3 line = 6 ; column = 18 ; value ='200'; }
{kind = TOKEN_LEFTBRACE; ; index = 117 ; length = 1 line = 6 ; column = 22 ; value ='{'; }
{kind = TOKEN_RIGHTBRACE; ; index = 123 ; length = 1 line = 8 ; column = 0 ; value ='}'; }
{kind = TOKEN_RETURN; ; index = 127 ; length = 6 line = 9 ; column = 0 ; value ='return'; }
{kind = TOKEN_IDENTIFIER; ; index = 134 ; length = 6 line = 9 ; column = 7 ; value ='float4'; }
{kind = TOKEN_LEFTPAREN; ; index = 140 ; length = 1 line = 9 ; column = 13 ; value ='('; }
{kind = TOKEN_FLOATLITERAL; ; index = 141 ; length = 3 line = 9 ; column = 14 ; value ='0'; }
{kind = TOKEN_RIGHTPAREN; ; index = 144 ; length = 1 line = 9 ; column = 17 ; value =')'; }
{kind = TOKEN_SEMICOLON; ; index = 145 ; length = 1 line = 9 ; column = 18 ; value =';'; }
{kind = TOKEN_RIGHTBRACE; ; index = 148 ; length = 1 line = 10 ; column = 0 ; value ='}'; }
{kind = TOKEN_EOF; ; index = 151 ; length = 0 line = 11 ; column = 0 ; value =''; }

View File

@@ -0,0 +1,35 @@
{kind = TOKEN_VERTEX; ; index = 0 ; length = 6 line = 1 ; column = 0 ; value ='vertex'; }
{kind = TOKEN_IDENTIFIER; ; index = 7 ; length = 4 line = 1 ; column = 7 ; value ='main'; }
{kind = TOKEN_DOUBLECOLON; ; index = 12 ; length = 2 line = 1 ; column = 12 ; value ='::'; }
{kind = TOKEN_LEFTPAREN; ; index = 15 ; length = 1 line = 1 ; column = 15 ; value ='('; }
{kind = TOKEN_IDENTIFIER; ; index = 16 ; length = 3 line = 1 ; column = 16 ; value ='pos'; }
{kind = TOKEN_COLON; ; index = 20 ; length = 1 line = 1 ; column = 20 ; value =':'; }
{kind = TOKEN_IDENTIFIER; ; index = 22 ; length = 6 line = 1 ; column = 22 ; value ='float3'; }
{kind = TOKEN_AT; ; index = 29 ; length = 1 line = 1 ; column = 29 ; value ='@'; }
{kind = TOKEN_IDENTIFIER; ; index = 30 ; length = 8 line = 1 ; column = 30 ; value ='position'; }
{kind = TOKEN_RIGHTPAREN; ; index = 38 ; length = 1 line = 1 ; column = 38 ; value =')'; }
{kind = TOKEN_ARROW; ; index = 40 ; length = 2 line = 1 ; column = 40 ; value ='->'; }
{kind = TOKEN_IDENTIFIER; ; index = 43 ; length = 6 line = 1 ; column = 43 ; value ='float4'; }
{kind = TOKEN_AT; ; index = 50 ; length = 1 line = 1 ; column = 50 ; value ='@'; }
{kind = TOKEN_IDENTIFIER; ; index = 51 ; length = 8 line = 1 ; column = 51 ; value ='position'; }
{kind = TOKEN_LEFTBRACE; ; index = 60 ; length = 1 line = 1 ; column = 60 ; value ='{'; }
{kind = TOKEN_IF; ; index = 64 ; length = 2 line = 2 ; column = 0 ; value ='if'; }
{kind = TOKEN_FLOATLITERAL; ; index = 67 ; length = 3 line = 2 ; column = 3 ; value ='1'; }
{kind = TOKEN_LEFTBRACE; ; index = 71 ; length = 1 line = 2 ; column = 7 ; value ='{'; }
{kind = TOKEN_RETURN; ; index = 76 ; length = 6 line = 3 ; column = 0 ; value ='return'; }
{kind = TOKEN_IDENTIFIER; ; index = 83 ; length = 6 line = 3 ; column = 7 ; value ='float4'; }
{kind = TOKEN_LEFTPAREN; ; index = 89 ; length = 1 line = 3 ; column = 13 ; value ='('; }
{kind = TOKEN_IDENTIFIER; ; index = 90 ; length = 3 line = 3 ; column = 14 ; value ='pos'; }
{kind = TOKEN_COMMA; ; index = 93 ; length = 1 line = 3 ; column = 17 ; value =','; }
{kind = TOKEN_FLOATLITERAL; ; index = 95 ; length = 3 line = 3 ; column = 19 ; value ='1'; }
{kind = TOKEN_RIGHTPAREN; ; index = 98 ; length = 1 line = 3 ; column = 22 ; value =')'; }
{kind = TOKEN_SEMICOLON; ; index = 99 ; length = 1 line = 3 ; column = 23 ; value =';'; }
{kind = TOKEN_RIGHTBRACE; ; index = 103 ; length = 1 line = 4 ; column = 0 ; value ='}'; }
{kind = TOKEN_RETURN; ; index = 107 ; length = 6 line = 5 ; column = 0 ; value ='return'; }
{kind = TOKEN_IDENTIFIER; ; index = 114 ; length = 6 line = 5 ; column = 7 ; value ='float4'; }
{kind = TOKEN_LEFTPAREN; ; index = 120 ; length = 1 line = 5 ; column = 13 ; value ='('; }
{kind = TOKEN_FLOATLITERAL; ; index = 121 ; length = 3 line = 5 ; column = 14 ; value ='0'; }
{kind = TOKEN_RIGHTPAREN; ; index = 124 ; length = 1 line = 5 ; column = 17 ; value =')'; }
{kind = TOKEN_SEMICOLON; ; index = 125 ; length = 1 line = 5 ; column = 18 ; value =';'; }
{kind = TOKEN_RIGHTBRACE; ; index = 128 ; length = 1 line = 6 ; column = 0 ; value ='}'; }
{kind = TOKEN_EOF; ; index = 131 ; length = 0 line = 7 ; column = 0 ; value =''; }

View File

@@ -0,0 +1,37 @@
{kind = TOKEN_VERTEX; ; index = 0 ; length = 6 line = 1 ; column = 0 ; value ='vertex'; }
{kind = TOKEN_IDENTIFIER; ; index = 7 ; length = 4 line = 1 ; column = 7 ; value ='main'; }
{kind = TOKEN_DOUBLECOLON; ; index = 12 ; length = 2 line = 1 ; column = 12 ; value ='::'; }
{kind = TOKEN_LEFTPAREN; ; index = 15 ; length = 1 line = 1 ; column = 15 ; value ='('; }
{kind = TOKEN_IDENTIFIER; ; index = 16 ; length = 3 line = 1 ; column = 16 ; value ='pos'; }
{kind = TOKEN_COLON; ; index = 20 ; length = 1 line = 1 ; column = 20 ; value =':'; }
{kind = TOKEN_IDENTIFIER; ; index = 22 ; length = 6 line = 1 ; column = 22 ; value ='float3'; }
{kind = TOKEN_AT; ; index = 29 ; length = 1 line = 1 ; column = 29 ; value ='@'; }
{kind = TOKEN_IDENTIFIER; ; index = 30 ; length = 8 line = 1 ; column = 30 ; value ='position'; }
{kind = TOKEN_RIGHTPAREN; ; index = 38 ; length = 1 line = 1 ; column = 38 ; value =')'; }
{kind = TOKEN_ARROW; ; index = 40 ; length = 2 line = 1 ; column = 40 ; value ='->'; }
{kind = TOKEN_IDENTIFIER; ; index = 43 ; length = 6 line = 1 ; column = 43 ; value ='float4'; }
{kind = TOKEN_AT; ; index = 50 ; length = 1 line = 1 ; column = 50 ; value ='@'; }
{kind = TOKEN_IDENTIFIER; ; index = 51 ; length = 8 line = 1 ; column = 51 ; value ='position'; }
{kind = TOKEN_LEFTBRACE; ; index = 60 ; length = 1 line = 1 ; column = 60 ; value ='{'; }
{kind = TOKEN_IF; ; index = 64 ; length = 2 line = 2 ; column = 0 ; value ='if'; }
{kind = TOKEN_INTLITERAL; ; index = 67 ; length = 1 line = 2 ; column = 3 ; value ='0'; }
{kind = TOKEN_ASSIGN; ; index = 69 ; length = 1 line = 2 ; column = 5 ; value ='='; }
{kind = TOKEN_INTLITERAL; ; index = 71 ; length = 3 line = 2 ; column = 7 ; value ='100'; }
{kind = TOKEN_LEFTBRACE; ; index = 75 ; length = 1 line = 2 ; column = 11 ; value ='{'; }
{kind = TOKEN_RETURN; ; index = 80 ; length = 6 line = 3 ; column = 0 ; value ='return'; }
{kind = TOKEN_IDENTIFIER; ; index = 87 ; length = 6 line = 3 ; column = 7 ; value ='float4'; }
{kind = TOKEN_LEFTPAREN; ; index = 93 ; length = 1 line = 3 ; column = 13 ; value ='('; }
{kind = TOKEN_IDENTIFIER; ; index = 94 ; length = 3 line = 3 ; column = 14 ; value ='pos'; }
{kind = TOKEN_COMMA; ; index = 97 ; length = 1 line = 3 ; column = 17 ; value =','; }
{kind = TOKEN_FLOATLITERAL; ; index = 99 ; length = 3 line = 3 ; column = 19 ; value ='1'; }
{kind = TOKEN_RIGHTPAREN; ; index = 102 ; length = 1 line = 3 ; column = 22 ; value =')'; }
{kind = TOKEN_SEMICOLON; ; index = 103 ; length = 1 line = 3 ; column = 23 ; value =';'; }
{kind = TOKEN_RIGHTBRACE; ; index = 107 ; length = 1 line = 4 ; column = 0 ; value ='}'; }
{kind = TOKEN_RETURN; ; index = 111 ; length = 6 line = 5 ; column = 0 ; value ='return'; }
{kind = TOKEN_IDENTIFIER; ; index = 118 ; length = 6 line = 5 ; column = 7 ; value ='float4'; }
{kind = TOKEN_LEFTPAREN; ; index = 124 ; length = 1 line = 5 ; column = 13 ; value ='('; }
{kind = TOKEN_FLOATLITERAL; ; index = 125 ; length = 3 line = 5 ; column = 14 ; value ='0'; }
{kind = TOKEN_RIGHTPAREN; ; index = 128 ; length = 1 line = 5 ; column = 17 ; value =')'; }
{kind = TOKEN_SEMICOLON; ; index = 129 ; length = 1 line = 5 ; column = 18 ; value =';'; }
{kind = TOKEN_RIGHTBRACE; ; index = 132 ; length = 1 line = 6 ; column = 0 ; value ='}'; }
{kind = TOKEN_EOF; ; index = 135 ; length = 0 line = 7 ; column = 0 ; value =''; }

39
test/lex/if_if_if.golden Normal file
View File

@@ -0,0 +1,39 @@
{kind = TOKEN_VERTEX; ; index = 0 ; length = 6 line = 1 ; column = 0 ; value ='vertex'; }
{kind = TOKEN_IDENTIFIER; ; index = 7 ; length = 4 line = 1 ; column = 7 ; value ='main'; }
{kind = TOKEN_DOUBLECOLON; ; index = 12 ; length = 2 line = 1 ; column = 12 ; value ='::'; }
{kind = TOKEN_LEFTPAREN; ; index = 15 ; length = 1 line = 1 ; column = 15 ; value ='('; }
{kind = TOKEN_IDENTIFIER; ; index = 16 ; length = 3 line = 1 ; column = 16 ; value ='pos'; }
{kind = TOKEN_COLON; ; index = 20 ; length = 1 line = 1 ; column = 20 ; value =':'; }
{kind = TOKEN_IDENTIFIER; ; index = 22 ; length = 6 line = 1 ; column = 22 ; value ='float3'; }
{kind = TOKEN_AT; ; index = 29 ; length = 1 line = 1 ; column = 29 ; value ='@'; }
{kind = TOKEN_IDENTIFIER; ; index = 30 ; length = 8 line = 1 ; column = 30 ; value ='position'; }
{kind = TOKEN_RIGHTPAREN; ; index = 38 ; length = 1 line = 1 ; column = 38 ; value =')'; }
{kind = TOKEN_ARROW; ; index = 40 ; length = 2 line = 1 ; column = 40 ; value ='->'; }
{kind = TOKEN_IDENTIFIER; ; index = 43 ; length = 6 line = 1 ; column = 43 ; value ='float4'; }
{kind = TOKEN_AT; ; index = 50 ; length = 1 line = 1 ; column = 50 ; value ='@'; }
{kind = TOKEN_IDENTIFIER; ; index = 51 ; length = 8 line = 1 ; column = 51 ; value ='position'; }
{kind = TOKEN_LEFTBRACE; ; index = 60 ; length = 1 line = 1 ; column = 60 ; value ='{'; }
{kind = TOKEN_IF; ; index = 64 ; length = 2 line = 2 ; column = 0 ; value ='if'; }
{kind = TOKEN_IF; ; index = 67 ; length = 2 line = 2 ; column = 3 ; value ='if'; }
{kind = TOKEN_IF; ; index = 70 ; length = 2 line = 2 ; column = 6 ; value ='if'; }
{kind = TOKEN_INTLITERAL; ; index = 73 ; length = 1 line = 2 ; column = 9 ; value ='0'; }
{kind = TOKEN_GREATER; ; index = 75 ; length = 1 line = 2 ; column = 11 ; value ='>'; }
{kind = TOKEN_INTLITERAL; ; index = 77 ; length = 3 line = 2 ; column = 13 ; value ='100'; }
{kind = TOKEN_LEFTBRACE; ; index = 81 ; length = 1 line = 2 ; column = 17 ; value ='{'; }
{kind = TOKEN_RETURN; ; index = 86 ; length = 6 line = 3 ; column = 0 ; value ='return'; }
{kind = TOKEN_IDENTIFIER; ; index = 93 ; length = 6 line = 3 ; column = 7 ; value ='float4'; }
{kind = TOKEN_LEFTPAREN; ; index = 99 ; length = 1 line = 3 ; column = 13 ; value ='('; }
{kind = TOKEN_IDENTIFIER; ; index = 100 ; length = 3 line = 3 ; column = 14 ; value ='pos'; }
{kind = TOKEN_COMMA; ; index = 103 ; length = 1 line = 3 ; column = 17 ; value =','; }
{kind = TOKEN_FLOATLITERAL; ; index = 105 ; length = 3 line = 3 ; column = 19 ; value ='1'; }
{kind = TOKEN_RIGHTPAREN; ; index = 108 ; length = 1 line = 3 ; column = 22 ; value =')'; }
{kind = TOKEN_SEMICOLON; ; index = 109 ; length = 1 line = 3 ; column = 23 ; value =';'; }
{kind = TOKEN_RIGHTBRACE; ; index = 113 ; length = 1 line = 4 ; column = 0 ; value ='}'; }
{kind = TOKEN_RETURN; ; index = 117 ; length = 6 line = 5 ; column = 0 ; value ='return'; }
{kind = TOKEN_IDENTIFIER; ; index = 124 ; length = 6 line = 5 ; column = 7 ; value ='float4'; }
{kind = TOKEN_LEFTPAREN; ; index = 130 ; length = 1 line = 5 ; column = 13 ; value ='('; }
{kind = TOKEN_FLOATLITERAL; ; index = 131 ; length = 3 line = 5 ; column = 14 ; value ='0'; }
{kind = TOKEN_RIGHTPAREN; ; index = 134 ; length = 1 line = 5 ; column = 17 ; value =')'; }
{kind = TOKEN_SEMICOLON; ; index = 135 ; length = 1 line = 5 ; column = 18 ; value =';'; }
{kind = TOKEN_RIGHTBRACE; ; index = 138 ; length = 1 line = 6 ; column = 0 ; value ='}'; }
{kind = TOKEN_EOF; ; index = 141 ; length = 0 line = 7 ; column = 0 ; value =''; }

View File

@@ -2,17 +2,21 @@ test/assign_arithmetic_expression.ink lex
test/basic_property_and_return_value.ink lex
test/complicated_computation.ink lex
test/constant_buffer.ink lex
test/else_if_after_else.ink lex
test/empty_struct.ink lex
test/empty_vertex_main.ink lex
test/empty_vertex_main_with_position_parameter.ink lex
test/field_assignment.ink lex
test/field_without_type_specifier.ink lex
test/float_suffix.ink lex
test/float_if_cond.ink lex
test/function_call.ink lex
test/function_call_out_of_order_declaration.ink lex
test/function_call_return.ink lex
test/functions_with_same_name.ink lex
test/function_with_int_return.ink lex
test/if_cond_assign.ink lex
test/if_if_if.ink lex
test/inferred_types.ink lex
test/meta_block.ink lex
test/multiple_functions.ink lex

View File

@@ -0,0 +1,4 @@
test/else_if_after_else.ink:6,6: error: 'else if' without 'if'
 } else if 0 > 200 {
^^^^


View File

@@ -0,0 +1,6 @@
(program
(fun vertex vs_main -> float4 (@position)
[(:= pos float3 (@position))]
(if 1
(return (float4 pos 1)))
(return (float4 0))))

View File

@@ -0,0 +1,6 @@
(program
(fun vertex vs_main -> float4 (@position)
[(:= pos float3 (@position))]
(if (= 0 100)
(return (float4 pos 1)))
(return (float4 0))))

View File

@@ -0,0 +1,4 @@
test/if_if_if.ink:2,3: error: Expected expression after 'if'.
if if if 0 > 100 {
^^


View File

@@ -2,17 +2,21 @@ test/assign_arithmetic_expression.ink parse
test/basic_property_and_return_value.ink parse
test/complicated_computation.ink parse
test/constant_buffer.ink parse
test/else_if_after_else.ink parse
test/empty_struct.ink parse
test/empty_vertex_main.ink parse
test/empty_vertex_main_with_position_parameter.ink parse
test/field_assignment.ink parse
test/field_without_type_specifier.ink parse
test/float_if_cond.ink parse
test/float_suffix.ink parse
test/function_call.ink parse
test/function_call_out_of_order_declaration.ink parse
test/function_call_return.ink parse
test/functions_with_same_name.ink parse
test/function_with_int_return.ink parse
test/if_cond_assign.ink parse
test/if_if_if.ink parse
test/inferred_types.ink parse
test/meta_block.ink parse
test/multiple_functions.ink parse

View File

@@ -0,0 +1,6 @@
test/float_if_cond.ink:0,0: error: Type of expression in if condition has to be bool.
if 1.0
^^^
1.0 has type float


View File

@@ -0,0 +1,6 @@
test/if_cond_assign.ink:0,0: error: Type of expression in if condition has to be bool.
if 0 = 100
^^^^^^
if 0 = 100 { has type int


View File

@@ -0,0 +1,6 @@
scope (global) [
[vertex__vs_main] : (pos : float3) -> float4
scope (vertex__vs_main) [
[pos] : float3
]
]

View File

@@ -0,0 +1,6 @@
scope (global) [
[vertex__vs_main] : (pos : float3) -> float4
scope (vertex__vs_main) [
[pos] : float3
]
]

View File

@@ -7,7 +7,20 @@
 color : float4 = float4(y, 1.0, 1.0, 1.0);
^
 Possible overloads:
 foreign float4 :: (float, float, float, float) -> float4; (test/wrong_type_for_function.ink:78)
 foreign float4 :: (float, float, float, float) -> float4; (test/wrong_type_for_function.ink:86)
 foreign float4 :: (float4) -> float4; (test/wrong_type_for_function.ink:87)
 foreign float4 :: (float2, float2) -> float4; (test/wrong_type_for_function.ink:88)
 foreign float4 :: (float2, float, float) -> float4; (test/wrong_type_for_function.ink:89)
 foreign float4 :: (float, float2, float) -> float4; (test/wrong_type_for_function.ink:90)
 foreign float4 :: (float, float2, float) -> float4; (test/wrong_type_for_function.ink:90)
 foreign float4 :: (float, float, float2) -> float4; (test/wrong_type_for_function.ink:91)
 foreign float4 :: (float, float, float2) -> float4; (test/wrong_type_for_function.ink:91)
 foreign float4 :: (float3, float) -> float4; (test/wrong_type_for_function.ink:92)
 foreign float4 :: (float3, float) -> float4; (test/wrong_type_for_function.ink:92)
 foreign float4 :: (float, float3) -> float4; (test/wrong_type_for_function.ink:93)
 foreign float4 :: (float, float3) -> float4; (test/wrong_type_for_function.ink:93)
 foreign float4 :: (float) -> float4; (test/wrong_type_for_function.ink:94)
 foreign float4 :: (float) -> float4; (test/wrong_type_for_function.ink:94)
test/wrong_type_for_function.ink:11,24: error: Type mismatch. Expected float got float2
 found:

View File

@@ -1,3 +1,4 @@
test/assign_arithmetic_expression.ink semant
test/basic_property_and_return_value.ink semant
test/complicated_computation.ink semant
@@ -11,6 +12,7 @@ test/function_call_out_of_order_declaration.ink semant
test/function_call_return.ink semant
test/functions_with_same_name.ink semant
test/function_with_int_return.ink semant
test/if_cond_assign.ink semant
test/inferred_types.ink semant
test/multiple_functions.ink semant
test/multiple_semicolons_everywhere.ink semant