Add typed instructions to GDScript

- Typed assignment (built-in, native, and script).
- Cast (built-in conversion; native and script checks).
- Check type of functions arguments on call.
- Check type of members on set.
This commit is contained in:
George Marques committed 2018-07-20 21:55:17 -03:00
1 parent 743053734f
commit 4b18c4e448
4 files changed
+469 -10

No files matched your search

+5 -1
View File
@@ -941,8 +941,12 @@ bool GDScriptInstance::set(const StringName &p_name, const Variant &p_value) {
if (err.error == Variant::CallError::CALL_OK) {
return true; //function exists, call was successful
}
} else
} else {
if (!E->get().data_type.is_type(p_value)) {
return false; // Type mismatch
}
members[E->get().index] = p_value;
}
return true;
}
}