Class inheritance method override does not work in 4.8 beta 1
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- C++
- Star
- 2.8k
- Fork
- 825
- Merge trung bình
- 3 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 19
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của godotengine/godot-cpp
-
Building gdextensions with lto=full warns about serial compilatonCó thể đã có người làm @marcozee03 đã nhận 59 ngày trước. Đang mởenhancement topic:buildsystem
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
godotengine/godot-cpp#2002 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
godotengine/godot-cpp#1969 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
TypedDictionary doesn't support Vector4(i)Có thể đã có người làm @AddisionS đã nhận 3 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
godotengine/godot-cpp#1967 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
enhancement topic:buildsystem tracker
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
godotengine/godot-cpp#2064 · 1 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 50/100
godotengine/godot-cpp#2059 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của godotengine/godot-cpp
Issue tương tự
-
v3: Lua m.setvar() returns -1 on errors, so the script gets stack garbageCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở3.x bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
owasp-modsecurity/ModSecurity#3731 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Sendspin/sendspin-cpp-cli#111 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
azerothcore/azerothcore-wotlk#28350 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bench harness: a surplus TSV column is silently dropped, and stride = L // 6 duplicates questionsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ambiguous enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
MaaAssistantArknights/MaaAssistantArknights#18976 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày