[.NET] Deprecate compat methods that reference deprecated types

This commit is contained in:
Raul Santos 2025-03-14 21:33:33 +01:00
parent 87f897ae0a
commit 2213545fc5
No known key found for this signature in database
GPG key ID: B532473AE3A803E4

View file

@ -4207,6 +4207,18 @@ bool BindingsGenerator::_populate_object_type_interfaces() {
// after all the non-compat methods have been added. The compat methods are added in
// reverse so the most recently added ones take precedence over older compat methods.
if (imethod.is_compat) {
// If the method references deprecated types, mark the method as deprecated as well.
for (const ArgumentInterface &iarg : imethod.arguments) {
String arg_type_name = iarg.type.cname;
String doc_name = arg_type_name.begins_with("_") ? arg_type_name.substr(1) : arg_type_name;
const DocData::ClassDoc &class_doc = EditorHelp::get_doc_data()->class_list[doc_name];
if (class_doc.is_deprecated) {
imethod.is_deprecated = true;
imethod.deprecation_message = "This method overload is deprecated.";
break;
}
}
imethod.is_hidden = true;
compat_methods.push_front(imethod);
continue;