GDScript: Allow use local constants as types

This commit is contained in:
Danil Alexeev 2023-08-24 19:01:31 +03:00
parent 6758a7f8c0
commit 68a567bd13
No known key found for this signature in database
GPG key ID: 124453E157DA8DC7
12 changed files with 236 additions and 122 deletions

View file

@ -0,0 +1,5 @@
enum MyEnum {}
func test():
var e: E
const E = MyEnum

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Local constant "E" is not resolved at this point.

View file

@ -0,0 +1,5 @@
enum MyEnum {}
func test():
var E = MyEnum
var e: E

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Local variable "E" cannot be used as a type.

View file

@ -0,0 +1,5 @@
enum MyEnum {A}
func test():
const E = MyEnum.A
var e: E

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Local constant "E" is not a valid type.