currently the log function signature is hardcoded as:
const LOG_FN: &str = "log(var: Field)";
this makes the type checker forbid the function from being used with other types than Field.
To fix that, we need to:
make it so that the arguments part of a hardcoded builtin signature can be ignored by the type checker
while still making sure that the type checker can verify that the returned type of a builtin function matches the expected return type expected by the caller (the builtin function does not have that information so cannot do that type checking)
In get_parsed_fns we need a flag that signals this:
for (code, fn_handle, ignore_args) in fns {
Then FnKind::BuiltIn needs to carry that information as well.
Finally, in the typechecker, we can ignore type checks on the function arguments if we see this flag.
currently the
log
function signature is hardcoded as:this makes the type checker forbid the function from being used with other types than
Field
.To fix that, we need to:
In
get_parsed_fns
we need a flag that signals this:Then
FnKind::BuiltIn
needs to carry that information as well.Finally, in the typechecker, we can ignore type checks on the function arguments if we see this flag.