Class inheritance method override does not work in 4.8 beta 1
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start with the reproduction in addons/test/cTest.h and main.gd, then compile it with addons/test/compite_debug.sh using Godot 4.8 beta and the listed godot-cpp commits. Compare the inherited test method behavior with versions before 4.8; done when b.test(im) accepts the Image argument while a.test(ba) still works.
由索引模型根据 Issue 内容生成。
描述
Godot version
4.8.beta1
godot-cpp version
1b089f20a959e67e79e32e352a57065b3058dbfd
System information
Ubuntu 24.04
Issue description
We have two classes, see reproduction project (addons/test/cTest.h):
class cTestA : public RefCounted {
GDCLASS(cTestA, RefCounted)
public:
cTestA(){}
~cTestA(){}
void test(PackedByteArray byte_array){
UtilityFunctions::print("cTestA: test function call: PackedByteArray");
}
protected:
static void _bind_methods(){
ClassDB::bind_method(D_METHOD("test", "byte_array"), &cTestA::test);
};
};
class cTestB : public cTestA {
GDCLASS(cTestB, cTestA)
public:
cTestB(){}
~cTestB(){}
void test(Ref<Image> image){
UtilityFunctions::print("cTestB: test function call: Ref<Image>");
}
protected:
static void _bind_methods(){
ClassDB::bind_method(D_METHOD("test", "image2d"), &cTestB::test);
};
};
But in GDScript (main.gd):
func _ready() -> void:
var a := cTestA.new()
var b := cTestB.new()
var ba := PackedByteArray([0,0,0])
var im := Image.create_empty(128, 128, false, Image.FORMAT_RF)
a.test(ba)
b.test(im)
I get an error: "Error at (8, 12): Invalid argument for "test()" function: argument 1 should be "PackedByteArray" but is "Image"."
This problem did not exist in any version <4.8.
Tested with:
- godot-cpp commit 1b089f20a959e67e79e32e352a57065b3058dbfd
- godot-cpp commit 507ed9d840c01a3c5b2a39af8bb4000bfac30bf5
Steps to reproduce
See reproduction project. Compile script: addons/test/compite_debug.sh
To compile:
cd addons/test
git clone [email protected]:godotengine/godot-cpp.git
chmod +x compite_debug.sh
./compite_debug.sh
then open this project in Godot 4.8 beta.
Minimal reproduction project
- 主要语言
- C++
- 星标
- 2.8k
- 派生
- 829
- 平均合并
- 3 天 12 小时
- 30 天内合并 PR
- 16
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
godotengine/godot-cpp 的其他 Issue
-
Building gdextensions with lto=full warns about serial compilaton可能已有人在做 @marcozee03 于 62 天前认领。 未关闭enhancement topic:buildsystem
难度 2/5 1-3 小时 新手友好度 82/100
godotengine/godot-cpp#2002 ·
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 62/100
godotengine/godot-cpp#1969 · 4 条评论 ·
维护者通常 2 天内回复
-
TypedDictionary doesn't support Vector4(i)可能已有人在做 @AddisionS 于 7 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
godotengine/godot-cpp#1967 · 1 条评论 ·
维护者通常 2 天内回复
-
A hot-reloaded extension never releases its bindings on engine singletons, so the editor crashes at quit可能已有人在做 @dsnopek 于 1 天前认领。 未关闭bug
难度 4/5 3-5 天 新手友好度 54/100
godotengine/godot-cpp#2084 · 2 条评论 ·
维护者通常 2 天内回复
-
enhancement topic:buildsystem tracker
难度 4/5 3-5 天 新手友好度 52/100
godotengine/godot-cpp#2064 · 1 个 reaction ·
维护者通常 2 天内回复
查看 godotengine/godot-cpp 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 3 天内回复
-
Bug
难度 2/5 1-3 小时 新手友好度 68/100
SCIInstitute/SCIRun#2909 ·
维护者通常 2 天内回复
-
bug libcudf
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
-
Triage: Needed
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 2 天内回复