-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Classes recursive references lead to "script could not be loaded" #27136
Comments
Partial duplicate of #21461, but that issue is long and confusing, so it's probably best to keep this new one to focus on the
That one is expected, |
Pretty much the same as #21461. Both will be solved together. |
This bug is also present when a class references a class which preloads the other class. # one.gd
extends Node
class_name One
var two = preload("res://two.gd") # two.gd
extends Node
func use_one(one : One);
pass fails to execute with the same error. Edit: fixed formatting |
What's the status on this bug? |
@GaidamakUA @vnen has started working on a GDScript refactor which will eliminate this issue. It should be finished by the time Godot 4.0 is released. See #21461 (comment). |
Duplicate of #21461 (same cause). |
Godot version: 3.1
OS/device including version: Ubuntu 18.04
Issue description:
Say, you have the following:
The project will fail on startup with error "Class 'One' was found in global scope but its script could not be loaded"
If we remove one of type annotations
: One
or: Two
from functions above, it will launch without any complaintNote: same behavior was discovered for case when we replace
class_name
-s withpreload
logic, but the message is slightly different (something about recursive references)Minimal reproduction project:
repro_recursive.tar.gz
The text was updated successfully, but these errors were encountered: