Skip to content

Commit

Permalink
Merge pull request #81521 from dsnopek/method-bind-default-argument-h…
Browse files Browse the repository at this point in the history
…ash-fix

Fix method hashes with default arguments
  • Loading branch information
akien-mga committed Sep 22, 2023
2 parents 6094738 + 0d13727 commit 6fc1d50
Show file tree
Hide file tree
Showing 7 changed files with 937 additions and 8 deletions.
10 changes: 9 additions & 1 deletion core/extension/extension_api_dump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

#include "core/config/engine.h"
#include "core/core_constants.h"
#include "core/extension/gdextension_compat_hashes.h"
#include "core/io/file_access.h"
#include "core/io/json.h"
#include "core/templates/pair.h"
Expand Down Expand Up @@ -884,11 +885,18 @@ Dictionary GDExtensionAPIDump::generate_extension_api() {
d2["hash"] = method->get_hash();

Vector<uint32_t> compat_hashes = ClassDB::get_method_compatibility_hashes(class_name, method_name);
Array compatibility;
if (compat_hashes.size()) {
Array compatibility;
for (int i = 0; i < compat_hashes.size(); i++) {
compatibility.push_back(compat_hashes[i]);
}
}

#ifndef DISABLE_DEPRECATED
GDExtensionCompatHashes::get_legacy_hashes(class_name, method_name, compatibility);
#endif

if (compatibility.size() > 0) {
d2["hash_compatibility"] = compatibility;
}

Expand Down
Loading

0 comments on commit 6fc1d50

Please sign in to comment.