Skip to content
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

Prefer identifiers annotated type if assigned type is incompatible to it #85224

Merged

Conversation

HolonProduction
Copy link
Member

@HolonProduction HolonProduction commented Nov 22, 2023

Clashes with the PR #78929

Fixes partially #74888
Fixes partially #71296
Fixes partially #78454

Fixes #78860
Fixes #78820

Fixes partially #86172

Fixes #86513
Fixes #86871

A small self contained example demonstrating the problem:

func _ready():
    var a: String = 1
    a. # no string methods are suggested

Obviously the example isn't valid GDScript, but in more complex situations like #74888 the incompatible assignment might result from an issue with interfering the type of the assignment which might still be valid at runtime. In such cases we should respect the type that the user specified.

Implementation detail:

  • If there are any ideas to prevent changing the analyzer without copying the over hundred line long function I'm all in for it.

TODO:

Copy link
Member

@vnen vnen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

modules/gdscript/gdscript_analyzer.cpp Outdated Show resolved Hide resolved
Copy link
Member

@vnen vnen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Sorry for the delay in reviewing it

@YuriSizov
Copy link
Contributor

Should we consider #78929 superseded?

@YuriSizov YuriSizov merged commit 7275613 into godotengine:master Jan 24, 2024
15 checks passed
@YuriSizov
Copy link
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment