godotengine / godot-cpp

C++ bindings for the Godot script API
MIT License
1.7k stars 528 forks source link

Extending a class(A) from class(B) from a GDExtension(C) defined class results in Could not found(B) #1414

Open Ughuuu opened 6 months ago

Ughuuu commented 6 months ago

Godot version

4.2

godot-cpp version

4.2

System information

macos m1

Issue description

I have a GDExtension that defines a class(C). I then have a GDScript, B that extends C.(This works) Then I have a GDScript A that extends B.(This doesn't work).

If I change the name of class B and rename it back, it works in editor. No more errors If I export, it doesn't work.

Error is always:

SCRIPT ERROR: Parse Error: Could not resolve class "StreamToText".
          at: GDScript::reload (res://addons/godot_whisper/capture_stream_to_text.gd:0)
SCRIPT ERROR: Compile Error: 
          at: GDScript::reload (res://samples/godot_whisper/StartButton.gd:-1)
ERROR: Failed to load script "res://samples/godot_whisper/StartButton.gd" with error "Compilation failed".

Workaround, which I will do, only extend once. Extending multiple times seems to cause issue.

Steps to reproduce

Download the godot whisper(v1.0.3) and run sample https://github.com/V-Sekai/godot-whisper/releases/tag/v1.0.3

Minimal reproduction project

https://github.com/V-Sekai/godot-whisper/releases/tag/v1.0.3