Fix function overload resolution. Add static array not working.

This commit is contained in:
2024-06-25 08:54:02 +02:00
parent d2614b3ba9
commit 3bbbc1d556
6 changed files with 161 additions and 89 deletions

View File

@@ -1,4 +1,16 @@
test/unknown_overload.shd:6,4: error: Type mismatch. Expected float3 got float
test/unknown_overload.shd:6,0: error: Procedure call did not match any of the possible overloads for 'foo'
 found:
foo(v, v);
^^^
 While matching argument 1 in function call.
 foo(v, v);
^
 Possible overloads:
 foo :: (v1 : float3, v2 : float3) { (test/unknown_overload.shd:1)
 foo :: (v1 : float2, v2 : float2, v3 : float2) { (test/unknown_overload.shd:2)
test/unknown_overload.shd:6,4: error: Type mismatch. Expected float3 got float
 found:
foo(v, v);
^
@@ -18,16 +30,4 @@
got:
v : float = 2.0
test/unknown_overload.shd:6,0: error: Procedure call did not match any of the possible overloads for 'foo'
 found:
foo(v, v);
^^^
 While matching argument 1 in function call.
 foo(v, v);
^
 Possible overloads:
 foo :: (v1 : float3, v2 : float3) { (test/unknown_overload.shd:1)
 foo :: (v1 : float2, v2 : float2, v3 : float2) { (test/unknown_overload.shd:2)


View File

@@ -1,14 +1,4 @@
test/wrong_type_for_function.shd:11,24: error: Type mismatch. Expected float got float2
 found:
color : float4 = float4(y, 1.0, 1.0, 1.0);
^
expected:
float
got:
y : float2 = foo()
test/wrong_type_for_function.shd:11,17: error: Procedure call did not match any of the possible overloads for 'float4'
test/wrong_type_for_function.shd:11,17: error: Procedure call did not match any of the possible overloads for 'float4'
 found:
color : float4 = float4(y, 1.0, 1.0, 1.0);
^^^^^^
@@ -19,4 +9,14 @@
 Possible overloads:
 foreign float4 :: (float, float, float, float) -> float4; (test/wrong_type_for_function.shd:79)
test/wrong_type_for_function.shd:11,24: error: Type mismatch. Expected float got float2
 found:
color : float4 = float4(y, 1.0, 1.0, 1.0);
^
expected:
float
got:
y : float2 = foo()