-
-
Notifications
You must be signed in to change notification settings - Fork 21.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49105 from vnen/gdscript-inner-preload-type
GDScript: Fix inner classes and preloaded scripts as types
- Loading branch information
Showing
11 changed files
with
74 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
modules/gdscript/tests/scripts/analyzer/features/call_static_builtin_function.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
func test(): | ||
print(Color.html_is_valid("00ffff")) | ||
print("OK") |
3 changes: 3 additions & 0 deletions
3
modules/gdscript/tests/scripts/analyzer/features/call_static_builtin_function.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
GDTEST_OK | ||
True | ||
OK |
5 changes: 5 additions & 0 deletions
5
modules/gdscript/tests/scripts/analyzer/features/gdscript_to_preload.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
func test(): | ||
pass | ||
|
||
func something(): | ||
return "OK" |
1 change: 1 addition & 0 deletions
1
modules/gdscript/tests/scripts/analyzer/features/gdscript_to_preload.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
GDTEST_OK |
11 changes: 11 additions & 0 deletions
11
modules/gdscript/tests/scripts/analyzer/features/inner_class_as_return_type.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
2 changes: 2 additions & 0 deletions
2
modules/gdscript/tests/scripts/analyzer/features/inner_class_as_return_type.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
GDTEST_OK | ||
OK |
5 changes: 5 additions & 0 deletions
5
modules/gdscript/tests/scripts/analyzer/features/use_preload_script_as_type.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const preloaded : GDScript = preload("gdscript_to_preload.gd") | ||
|
||
func test(): | ||
var preloaded_instance: preloaded = preloaded.new() | ||
print(preloaded_instance.something()) |
2 changes: 2 additions & 0 deletions
2
modules/gdscript/tests/scripts/analyzer/features/use_preload_script_as_type.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
GDTEST_OK | ||
OK |