Added int to float coercions to function args and returns, when specified

This commit is contained in:
2023-08-06 02:17:32 +10:00
parent a63bdaef1c
commit cfec1b6911
3 changed files with 38 additions and 0 deletions

View File

@@ -10,4 +10,20 @@
}
//test function coercion
{
fn f(arg: float) {
assert typeof arg == float, "argument coercion failed";
}
f(42);
fn g(): float {
return 42;
}
assert typeof g() == float, "return coercion failed";
}
print "All good";