Detected duplicate methods for ScriptTypeInfo methods

This commit is contained in:
bigguy345 committed 2025-12-31 14:27:57 +02:00
1 parent 002d2a6f15
commit 20f1c7cb66
2 files changed
+15

No files matched your search

@@ -636,6 +636,13 @@ public class ScriptDocument {
int scopeDepth = calculateScopeDepth(method.getFullDeclarationOffset());
methodsByScope.computeIfAbsent(scopeDepth, k -> new ArrayList<>()).add(method);
}
for (ScriptTypeInfo type : scriptTypes.values()) {
for (MethodInfo method : type.getAllMethodsFlat()) {
int scopeDepth = calculateScopeDepth(method.getFullDeclarationOffset());
methodsByScope.computeIfAbsent(scopeDepth, k -> new ArrayList<>()).add(method);
}
}
// Check each scope for duplicates
for (List<MethodInfo> scopeMethods : methodsByScope.values()) {
@@ -148,6 +148,14 @@ public class ScriptTypeInfo extends TypeInfo {
return new HashMap<>(methods);
}
public List<MethodInfo> getAllMethodsFlat() {
List<MethodInfo> allMethods = new ArrayList<>();
for (List<MethodInfo> overloads : methods.values()) {
allMethods.addAll(overloads);
}
return allMethods;
}
// ==================== CONSTRUCTOR MANAGEMENT ====================
public void addConstructor(MethodInfo constructor) {