1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-08 12:40:44 +00:00

GDScript: enable type checks on release mode

Also make builtin GDScript functions report return type as Variant in
release so type is converted when needed.
This commit is contained in:
George Marques
2020-01-08 12:22:41 -03:00
parent ae21664655
commit d26414f9fe
3 changed files with 38 additions and 9 deletions

View File

@@ -670,6 +670,30 @@ static void _disassemble_class(const Ref<GDScript> &p_class, const Vector<String
txt += "= false";
incr += 2;
} break;
case GDScriptFunction::OPCODE_ASSIGN_TYPED_BUILTIN: {
txt += " assign typed builtin (";
txt += Variant::get_type_name((Variant::Type)code[ip + 1]);
txt += ") ";
txt += DADDR(2);
txt += " = ";
txt += DADDR(3);
incr += 4;
} break;
case GDScriptFunction::OPCODE_ASSIGN_TYPED_NATIVE: {
Variant className = func.get_constant(code[ip + 1]);
GDScriptNativeClass *nc = Object::cast_to<GDScriptNativeClass>(className.operator Object *());
txt += " assign typed native (";
txt += nc->get_name().operator String();
txt += ") ";
txt += DADDR(2);
txt += " = ";
txt += DADDR(3);
incr += 4;
} break;
case GDScriptFunction::OPCODE_CAST_TO_SCRIPT: {