builtin_for now reports nice error message when given wrong arguments
This commit is contained in:
parent
aabcc42625
commit
421f8111f0
@ -366,7 +366,15 @@ static Result<Value> builtin_for(Interpreter &i, std::vector<Value> args)
|
|||||||
return Value{};
|
return Value{};
|
||||||
}
|
}
|
||||||
|
|
||||||
unimplemented();
|
return Error {
|
||||||
|
.details = errors::Unsupported_Types_For {
|
||||||
|
.type = errors::Unsupported_Types_For::Function,
|
||||||
|
.name = "for",
|
||||||
|
.possibilities = {
|
||||||
|
"(array, callback) -> nil",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
void Interpreter::register_builtin_functions()
|
void Interpreter::register_builtin_functions()
|
||||||
|
Loading…
Reference in New Issue
Block a user