-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GDScript 2.0: Wrong lookup for outer things #70216
Comments
CC @adamscott |
Can you set this MRP in your description? I usually ask for users to join a MRP even if it's a simple copy and paste because it's way easier to know if an issue is fixed or not. Hence I asked you to open this issue, I created a MRP for you. |
I mean, if it was that easy I would not have opened the issue. Second part is important one. Example: class A:
const Q := 'right one'
class X:
const Q := 'wrong one'
class Y extends X:
class B extends A:
static func check() -> void:
print(Q)
func _ready() -> void:
Y.B.check() Obviously, that |
@akien-mga Could you reopen the issue? The issue is not fixed, finally. |
Another issue because of this line: class Hide: # Hide is needed just to separate from other issue
class A: pass
class B extends Hide.A:
static func check() -> void:
print(B.A) # no warning. runtime error.
print(B.B) # no warning. runtime error.
func _ready() -> void:
B.check() This logic should apply only if |
Godot version
master
System information
MacOS 10.15.7
Issue description
#69587 introduced regression because of this line in
reduce_identifier_from_base
.First argument here is
parser->current_class
, which ignores the fact that typing can happen in a different class, even in a different file. So lookup happens not formbase
perspective, but from perspective of a place of typing.Example:
Also
get_class_node_current_scope_classes
should not be used here as it collects both class, its base classes and outer classes together in one list, butreduce_identifier_from_base
have different logic for base classes and outer classes. So outer logic is applied now to all base classes except first direct one.Steps to reproduce
Copy paste code from the example and see that there is no warning in the editor.
Minimal reproduction project
70216.zip
The text was updated successfully, but these errors were encountered: