From c97876154d92f3379cb830ebeb067528b2a53c29 Mon Sep 17 00:00:00 2001 From: Wagyourtail Date: Sun, 22 Sep 2024 11:01:48 -0500 Subject: [PATCH] fix wildcard, skip empty named --- .../tree/node/_class/member/MethodNode.kt | 1 + .../tree/node/_class/member/WildcardNode.kt | 21 +++++++------------ 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/MethodNode.kt b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/MethodNode.kt index 4b9b7c0..ff60277 100644 --- a/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/MethodNode.kt +++ b/src/commonMain/kotlin/xyz/wagyourtail/unimined/mapping/tree/node/_class/member/MethodNode.kt @@ -95,6 +95,7 @@ class MethodNode(parent: ClassNode) : FieldMethodResolvable) : MemberNode(parent), WildcardVisitor, LazyResolvableEntry { private val _descs = descs.toMutableMap() private val _signatures: MutableSet> = mutableSetOf() - private val _params: MutableList> = mutableListOf() private val _locals: MutableList> = mutableListOf() private val _exceptions: MutableList> = mutableListOf() val descs: Map get() = _descs val signatures: Set> get() = _signatures - val params: List> get() = _params + val params = LazyResolvables>(root) { + ParameterNode(this, null, null) + } val locals: List> get() = _locals val exceptions: List> get() = _exceptions @@ -54,19 +56,9 @@ class WildcardNode(parent: ClassNode, val type: WildcardType, descs: Map): ParameterVisitor? { if (type == WildcardType.FIELD) return null - for (param in params) { - if (index != null && param.index == index) { - param.setNames(names) - return param - } - if (lvOrd != null && param.lvOrd == lvOrd) { - param.setNames(names) - return param - } - } val newParam = ParameterNode(this, index, lvOrd) newParam.setNames(names) - _params.add(newParam) + params.addUnresolved(newParam) return newParam } @@ -109,7 +101,8 @@ class WildcardNode(parent: ClassNode, val type: WildcardType, descs: Map