summaryrefslogtreecommitdiff
path: root/modules/gdscript/gd_compiler.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-06-06 20:08:39 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-06-06 20:08:39 -0300
commit5aa40704388be838c4fecc9989dd69bc6b5d9077 (patch)
tree6bb83dd8a8ea585ae16ffe0068a37ec8eaa0a3f4 /modules/gdscript/gd_compiler.cpp
parent9df4c1885362103baef02f01bf2012d8aa64e0a0 (diff)
parent3acbf8e71f15c682bcf4fee248f58180e689df1c (diff)
Merge pull request #5054 from eska014/fix-implicit-extends
Fix implicit GDScript Reference inheritance
Diffstat (limited to 'modules/gdscript/gd_compiler.cpp')
-rw-r--r--modules/gdscript/gd_compiler.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/gdscript/gd_compiler.cpp b/modules/gdscript/gd_compiler.cpp
index d51f1a4ddc..072c53fb9f 100644
--- a/modules/gdscript/gd_compiler.cpp
+++ b/modules/gdscript/gd_compiler.cpp
@@ -1588,6 +1588,12 @@ Error GDCompiler::_parse_class(GDScript *p_script, GDScript *p_owner, const GDPa
}
+ } else {
+ // without extends, implicitly extend Reference
+ int native_idx = GDScriptLanguage::get_singleton()->get_global_map()["Reference"];
+ native = GDScriptLanguage::get_singleton()->get_global_array()[native_idx];
+ ERR_FAIL_COND_V(native.is_null(), ERR_BUG);
+ p_script->native=native;
}