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

GDScript: preloading a custom resource type has a return type of GDScript #70121

Closed
jtnicholl opened this issue Dec 15, 2022 · 1 comment · Fixed by #70131
Closed

GDScript: preloading a custom resource type has a return type of GDScript #70121

jtnicholl opened this issue Dec 15, 2022 · 1 comment · Fixed by #70131

Comments

@jtnicholl
Copy link
Contributor

jtnicholl commented Dec 15, 2022

Godot version

v4.0.beta.custom_build [47ef054]

System information

Fedora 36

Issue description

Calling preload to load a resource of a custom resource type has a return type of GDScript instead of the custom resource type, causing an error if used with static typing.

Removing the static typing or switching to load can be used as a workaround.

Seems to be a regression from #69471, reverting it fixes the error.

Steps to reproduce

  1. Define a custom resource in GDScript with a class name
  2. Create an instance of it
  3. Try to preload it for use in a statically typed variable or parameter

Minimal reproduction project

resource_preload.zip

@adamscott
Copy link
Member

CC @rune-scape

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

Successfully merging a pull request may close this issue.

3 participants