GDScript: Fix inner classes and preloaded scripts as types

This commit is contained in:
George Marques 2021-05-26 09:23:17 -03:00
parent 31dfdcb69e
commit 2ba4ee9198
No known key found for this signature in database
GPG key ID: 046BD46A3201E43D
7 changed files with 55 additions and 0 deletions

View file

@ -0,0 +1,5 @@
func test():
pass
func something():
return "OK"

View file

@ -0,0 +1 @@
GDTEST_OK

View file

@ -0,0 +1,11 @@
class InnerClass:
var val := "OK"
static func create_instance() -> InnerClass:
return new()
func create_inner_instance() -> InnerClass:
return InnerClass.create_instance()
func test():
var instance = create_inner_instance()
print(instance.val)

View file

@ -0,0 +1,2 @@
GDTEST_OK
OK

View file

@ -0,0 +1,5 @@
const preloaded : GDScript = preload("gdscript_to_preload.gd")
func test():
var preloaded_instance: preloaded = preloaded.new()
print(preloaded_instance.something())

View file

@ -0,0 +1,2 @@
GDTEST_OK
OK