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

Make GDScript cyclic reference checks "smarter". #1629

Closed
tx350z opened this issue Oct 8, 2020 · 2 comments
Closed

Make GDScript cyclic reference checks "smarter". #1629

tx350z opened this issue Oct 8, 2020 · 2 comments

Comments

@tx350z
Copy link

tx350z commented Oct 8, 2020

Describe the project you are working on:
My project has a GUI containing a large number of inter-operating custom controls and related logic modules. There is a need for the various controls and logic modules to inter-communicate.

Describe the problem or limitation you are having in your project:
If I use type definitions (e.g. class names as method parameter types) widely the editor throws errors saying scripts cannot be fully loaded due to cyclic references. If I remove type definitions no errors are raised and my code runs fine but without the benefit of type checking. The parser does not recognize that some cyclic references will not cause runtime problems.

Currently I am using a massive number of group calls to allow the GUI controls and logic modules to talk. The group call approach is not easily managed due to the need to assure that every GC method is uniquely named (e.g. problem of the same method names in multiple call-groups and multiple call-group membership).

Describe the feature / enhancement and how it helps to overcome the problem or limitation:
Make the parser "smarter" (is the parser multi-pass?) to ignore type definitions.

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
The parser will not throw a script loading error just because two classes have type references to each other.

If this enhancement will not be used often, can it be worked around with a few lines of script?:
The only work around is to not use type definitions.

Is there a reason why this should be core and not an add-on in the asset library?:
I don't believe this can be done as an add-on.

@Calinou
Copy link
Member

Calinou commented Oct 8, 2020

This sounds more like a bug than a feature request to me: godotengine/godot#21461

This may be fixed in 4.0.

@KoBeWi
Copy link
Member

KoBeWi commented Oct 8, 2020

Yeah this is a bug, there are already plans to fix it.

@KoBeWi KoBeWi closed this as completed Oct 8, 2020
@KoBeWi KoBeWi added the archived label Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants