diff options
author | George Marques <george@gmarqu.es> | 2020-01-08 12:22:41 -0300 |
---|---|---|
committer | George Marques <george@gmarqu.es> | 2020-01-08 12:38:18 -0300 |
commit | d26414f9fe62e55af75dd9191ea602c8493640cc (patch) | |
tree | 2849e4f47f6e6bbc0901fc900e686759bd31f413 /main/tests/test_gdscript.cpp | |
parent | ae21664655a16526b1a8e3e30f4e03d9a7c9c67c (diff) |
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.
Diffstat (limited to 'main/tests/test_gdscript.cpp')
-rw-r--r-- | main/tests/test_gdscript.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/main/tests/test_gdscript.cpp b/main/tests/test_gdscript.cpp index 729c5f99cf..a6ef0e9cf4 100644 --- a/main/tests/test_gdscript.cpp +++ b/main/tests/test_gdscript.cpp @@ -671,6 +671,30 @@ static void _disassemble_class(const Ref<GDScript> &p_class, const Vector<String 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: { txt += " cast "; |