-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GDScript: Fix subscript resolution for constant non-metatypes
- Loading branch information
Showing
5 changed files
with
194 additions
and
18 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
17 changes: 17 additions & 0 deletions
17
modules/gdscript/tests/scripts/analyzer/features/export_enum_as_dictionary.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,17 @@ | ||
class_name TestExportEnumAsDictionary | ||
|
||
enum MyEnum {A, B, C} | ||
|
||
const Utils = preload("../../utils.notest.gd") | ||
|
||
@export var x1 = MyEnum | ||
@export var x2 = MyEnum.A | ||
@export var x3 := MyEnum | ||
@export var x4 := MyEnum.A | ||
@export var x5: MyEnum | ||
|
||
func test(): | ||
for property in get_property_list(): | ||
if property.usage & PROPERTY_USAGE_SCRIPT_VARIABLE: | ||
print(Utils.get_property_signature(property)) | ||
print(" ", Utils.get_property_additional_info(property)) |
11 changes: 11 additions & 0 deletions
11
modules/gdscript/tests/scripts/analyzer/features/export_enum_as_dictionary.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,11 @@ | ||
GDTEST_OK | ||
@export var x1: Dictionary | ||
hint=NONE hint_string="" usage=DEFAULT|SCRIPT_VARIABLE | ||
@export var x2: TestExportEnumAsDictionary.MyEnum | ||
hint=ENUM hint_string="A:0,B:1,C:2" usage=DEFAULT|SCRIPT_VARIABLE|CLASS_IS_ENUM | ||
@export var x3: Dictionary | ||
hint=NONE hint_string="" usage=DEFAULT|SCRIPT_VARIABLE | ||
@export var x4: TestExportEnumAsDictionary.MyEnum | ||
hint=ENUM hint_string="A:0,B:1,C:2" usage=DEFAULT|SCRIPT_VARIABLE|CLASS_IS_ENUM | ||
@export var x5: TestExportEnumAsDictionary.MyEnum | ||
hint=ENUM hint_string="A:0,B:1,C:2" usage=DEFAULT|SCRIPT_VARIABLE|CLASS_IS_ENUM |
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