You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Add static type checks in the parser
- Resolve types for all identifiers. - Error when identifier is not found. - Match return type and error when not returning a value when it should. - Check unreachable code (code after sure return). - Match argument count and types for function calls. - Determine if return type of function call matches the assignment. - Do static type check with match statement when possible. - Use type hints to determine export type. - Check compatibility between type hint and explicit export type.
This commit is contained in:
@@ -1370,6 +1370,15 @@ int GDScriptFunction::get_default_argument_addr(int p_idx) const {
|
||||
return default_arguments[p_idx];
|
||||
}
|
||||
|
||||
GDScriptDataType GDScriptFunction::get_return_type() const {
|
||||
return return_type;
|
||||
}
|
||||
|
||||
GDScriptDataType GDScriptFunction::get_argument_type(int p_idx) const {
|
||||
ERR_FAIL_INDEX_V(p_idx, argument_types.size(), GDScriptDataType());
|
||||
return argument_types[p_idx];
|
||||
}
|
||||
|
||||
StringName GDScriptFunction::get_name() const {
|
||||
|
||||
return name;
|
||||
|
||||
Reference in New Issue
Block a user