forked from godotengine/godot
-
Notifications
You must be signed in to change notification settings - Fork 0
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 godotengine#82098 from dalexeev/gds-prevent-engine…
…-singleton-inheritance GDScript: Prevent constructing and inheriting engine singletons
- Loading branch information
Showing
5 changed files
with
22 additions
and
0 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
2 changes: 2 additions & 0 deletions
2
modules/gdscript/tests/scripts/analyzer/errors/engine_singleton_instantiate.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,2 @@ | ||
func test(): | ||
Time.new() |
2 changes: 2 additions & 0 deletions
2
modules/gdscript/tests/scripts/analyzer/errors/engine_singleton_instantiate.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_ANALYZER_ERROR | ||
Cannot construct native class "Time" because it is an engine singleton. |
6 changes: 6 additions & 0 deletions
6
modules/gdscript/tests/scripts/analyzer/errors/extend_engine_singleton.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,6 @@ | ||
# GH-82081 | ||
|
||
extends Time | ||
|
||
func test(): | ||
pass |
2 changes: 2 additions & 0 deletions
2
modules/gdscript/tests/scripts/analyzer/errors/extend_engine_singleton.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_ANALYZER_ERROR | ||
Cannot inherit native class "Time" because it is an engine singleton. |