From 743053734f187c220250d88e4e475b7a87767cbc Mon Sep 17 00:00:00 2001 From: George Marques Date: Tue, 29 May 2018 23:16:54 -0300 Subject: 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. --- modules/gdscript/gdscript_function.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'modules/gdscript/gdscript_function.h') diff --git a/modules/gdscript/gdscript_function.h b/modules/gdscript/gdscript_function.h index 770d5c8733..62b6871b76 100644 --- a/modules/gdscript/gdscript_function.h +++ b/modules/gdscript/gdscript_function.h @@ -42,6 +42,22 @@ class GDScriptInstance; class GDScript; +struct GDScriptDataType { + bool has_type; + enum { + BUILTIN, + NATIVE, + SCRIPT, + GDSCRIPT + } kind; + Variant::Type builtin_type; + StringName native_type; + Ref