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

Parse Error: Can't override name of the unique global class "State" #150

Closed
1xch opened this issue Aug 24, 2020 · 2 comments
Closed

Parse Error: Can't override name of the unique global class "State" #150

1xch opened this issue Aug 24, 2020 · 2 comments
Assignees
Labels
bug Something isn't working resolved For features and refactors that got added

Comments

@1xch
Copy link

1xch commented Aug 24, 2020

Godot 3.2.2stable

downloaded version of WAT through Assets tab in editor, gives error

downloaded WAT/releases/tag/v4.2.2, gives the same error

I get this:

 res://addons/WAT/core/test/test.gd:4 - Parse Error: Can't override name of the unique global class "State". It already exists at: res://addons/WAT/core/test/test.gd
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/namespace.gd:6 - Parse Error: Couldn't fully preload the script, possible cyclic reference or compilation error. Use "load()" instead if a cyclic reference is intended.
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/core/test/test.gd:4 - Parse Error: Can't override name of the unique global class "State". It already exists at: res://addons/WAT/core/test/test.gd
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/namespace.gd:6 - Parse Error: Couldn't fully preload the script, possible cyclic reference or compilation error. Use "load()" instead if a cyclic reference is intended.
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/ui/results/result_tree.gd:96 - Parse Error: The class "WAT" couldn't be fully loaded (script error or cyclic dependency).
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/core/test/test.gd:4 - Parse Error: Can't override name of the unique global class "State". It already exists at: res://addons/WAT/core/test/test.gd
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/namespace.gd:6 - Parse Error: Couldn't fully preload the script, possible cyclic reference or compilation error. Use "load()" instead if a cyclic reference is intended.
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/core/test/test.gd:4 - Parse Error: Can't override name of the unique global class "State". It already exists at: res://addons/WAT/core/test/test.gd
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/namespace.gd:6 - Parse Error: Couldn't fully preload the script, possible cyclic reference or compilation error. Use "load()" instead if a cyclic reference is intended.
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/core/test/test.gd:4 - Parse Error: Can't override name of the unique global class "State". It already exists at: res://addons/WAT/core/test/test.gd
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/namespace.gd:6 - Parse Error: Couldn't fully preload the script, possible cyclic reference or compilation error. Use "load()" instead if a cyclic reference is intended.
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/core/test/test.gd:4 - Parse Error: Can't override name of the unique global class "State". It already exists at: res://addons/WAT/core/test/test.gd
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/namespace.gd:6 - Parse Error: Couldn't fully preload the script, possible cyclic reference or compilation error. Use "load()" instead if a cyclic reference is intended.
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/ui/results/result_forest.gd:66 - Parse Error: The class "WAT" couldn't be fully loaded (script error or cyclic dependency).
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/core/test/test.gd:4 - Parse Error: Can't override name of the unique global class "State". It already exists at: res://addons/WAT/core/test/test.gd
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/namespace.gd:6 - Parse Error: Couldn't fully preload the script, possible cyclic reference or compilation error. Use "load()" instead if a cyclic reference is intended.
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/core/test/test.gd:4 - Parse Error: Can't override name of the unique global class "State". It already exists at: res://addons/WAT/core/test/test.gd
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/namespace.gd:6 - Parse Error: Couldn't fully preload the script, possible cyclic reference or compilation error. Use "load()" instead if a cyclic reference is intended.
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 built-in:208 - Parse Error: The class "WAT" couldn't be fully loaded (script error or cyclic dependency).
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/core/test/test.gd:4 - Parse Error: Can't override name of the unique global class "State". It already exists at: res://addons/WAT/core/test/test.gd
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/namespace.gd:6 - Parse Error: Couldn't fully preload the script, possible cyclic reference or compilation error. Use "load()" instead if a cyclic reference is intended.
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/core/test/test.gd:4 - Parse Error: Can't override name of the unique global class "State". It already exists at: res://addons/WAT/core/test/test.gd
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/namespace.gd:6 - Parse Error: Couldn't fully preload the script, possible cyclic reference or compilation error. Use "load()" instead if a cyclic reference is intended.
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/core/test/test.gd:4 - Parse Error: Can't override name of the unique global class "State". It already exists at: res://addons/WAT/core/test/test.gd
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/namespace.gd:6 - Parse Error: Couldn't fully preload the script, possible cyclic reference or compilation error. Use "load()" instead if a cyclic reference is intended.
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/core/test/test.gd:4 - Parse Error: Can't override name of the unique global class "State". It already exists at: res://addons/WAT/core/test/test.gd
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/namespace.gd:6 - Parse Error: Couldn't fully preload the script, possible cyclic reference or compilation error. Use "load()" instead if a cyclic reference is intended.
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/ui/results/result_tree.gd:96 - Parse Error: The class "WAT" couldn't be fully loaded (script error or cyclic dependency).
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/core/test/test.gd:4 - Parse Error: Can't override name of the unique global class "State". It already exists at: res://addons/WAT/core/test/test.gd
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/namespace.gd:6 - Parse Error: Couldn't fully preload the script, possible cyclic reference or compilation error. Use "load()" instead if a cyclic reference is intended.
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/core/test/test.gd:4 - Parse Error: Can't override name of the unique global class "State". It already exists at: res://addons/WAT/core/test/test.gd
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/namespace.gd:6 - Parse Error: Couldn't fully preload the script, possible cyclic reference or compilation error. Use "load()" instead if a cyclic reference is intended.
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/core/test/test.gd:4 - Parse Error: Can't override name of the unique global class "State". It already exists at: res://addons/WAT/core/test/test.gd
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/namespace.gd:6 - Parse Error: Couldn't fully preload the script, possible cyclic reference or compilation error. Use "load()" instead if a cyclic reference is intended.
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/core/test/test.gd:4 - Parse Error: Can't override name of the unique global class "State". It already exists at: res://addons/WAT/core/test/test.gd
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR
 res://addons/WAT/namespace.gd:6 - Parse Error: Couldn't fully preload the script, possible cyclic reference or compilation error. Use "load()" instead if a cyclic reference is intended.
 modules/gdscript/gdscript.cpp:599 - Method failed. Returning: ERR_PARSE_ERROR

Overall this addon is unusable because of this.

@AlexDarigan
Copy link
Collaborator

AlexDarigan commented Aug 26, 2020

I'm assuming you have a "class_name State" somewhere in your code? It was conflicting with WATTest's local State Class. This is why GDScript requires namespaces.

Should be fixed by 019283a

@1xch
Copy link
Author

1xch commented Aug 27, 2020

thanks @CodeDarigan
I had not even considered this, I do have a State defined in an addon I wrote. Good to know so I can create non colliding class names & recognize this in the future.

@1xch 1xch closed this as completed Aug 27, 2020
@AlexDarigan AlexDarigan self-assigned this Dec 15, 2020
@AlexDarigan AlexDarigan added bug Something isn't working resolved For features and refactors that got added labels Dec 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resolved For features and refactors that got added
Projects
None yet
Development

No branches or pull requests

2 participants