1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Add ability to infer variable type from assigned value

Syntax: var x : = 42
Infers the type of "x" to be an integer.
This commit is contained in:
George Marques
2018-06-19 02:55:52 -03:00
parent 03746da73f
commit 3445dca01d
2 changed files with 48 additions and 3 deletions

View File

@@ -56,6 +56,7 @@ public:
bool has_type;
bool is_constant;
bool is_meta_type; // Whether the value can be used as a type
bool infer_type;
Variant::Type builtin_type;
StringName native_type;
@@ -93,6 +94,7 @@ public:
has_type(false),
is_constant(false),
is_meta_type(false),
infer_type(false),
builtin_type(Variant::NIL),
class_type(NULL) {}
};