#[class(no_init)]
makes extension non-reloadable
#874
Labels
bug
c: register
Register classes, functions and other symbols to GDScript
status: upstream
Depending on upstream fix (typically Godot)
Note
Edit bromeon: updated problem description.
When disabling the default constructor via
#[class(no_init)]
, the class can no longer be reloaded. Godot uses this as a reason to disable reloading for the entire extension, with the following error:It looks like the problem arises in the following part:
gdext/godot-macros/src/class/derive_godot_class.rs
Lines 78 to 105 in 6e6889a
If
no_init
is specified, the init strategy will beAbsent
, and neithercreate
norrecreate
functions are set. I think particularly the latter causes problems, although this needs to be confirmed. The class is also marked abstract, but I'm not sure if that interferes with it.We would need to see how we can enable reloading in the absence of a default constructor. If there are no instances of a class to be reloaded, there shouldn't be a problem -- so maybe Godot is overzealous at forbidding reloading if there is no constructor?
Update: there's now an upstream issue to enable this workflow in Godot:
Original message:
Hello,
I've noticed that when I've updated gdext and godot on 4.3 I got broken reload. I used
gdext_coroutines
. After disable this part on another project that I've created for testing - reloadable starts work fine. After I read the library and didn't notice any specific cases and tried to add imports coroutines into my extenstion directrly and got same issue.Reproduce:
#![feature(coroutines, coroutine_trait)]
use std::ops::{Coroutine, CoroutineState};
Read more: Houtamelo/gdext_coroutines#2
showcase.zip
The text was updated successfully, but these errors were encountered: