From 54f4562648c01ceae105cae504005144ff0e7054 Mon Sep 17 00:00:00 2001 From: Goooler Date: Wed, 15 Jul 2026 16:21:35 +0800 Subject: [PATCH] Test relocation of nested class signatures --- .../shadow/internal/BytecodeRemappingTest.kt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/internal/BytecodeRemappingTest.kt b/src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/internal/BytecodeRemappingTest.kt index d7840ada6..6708d2982 100644 --- a/src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/internal/BytecodeRemappingTest.kt +++ b/src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/internal/BytecodeRemappingTest.kt @@ -210,6 +210,17 @@ class BytecodeRemappingTest { assertThat(checkNotNull(method.signature)).contains("L$relocatedFixtureBase;") } + @Test + fun nestedClassSignatureIsRelocated() { + val result = fixtureSubjectDetails.remapClass(relocators) + + val method = result.classInfo().methodData.first { it.name == "methodWithNestedGeneric" } + assertThat(checkNotNull(method.signature)) + .isEqualTo( + $$"(Lcom/example/relocated/BytecodeRemappingTest$FixtureGenericOuter.FixtureInner;)V" + ) + } + @Test fun localVariableIsRelocated() { val result = fixtureSubjectDetails.remapClass(relocators) @@ -255,6 +266,10 @@ class BytecodeRemappingTest { open class FixtureBase + class FixtureGenericOuter { + inner class FixtureInner + } + @Suppress("unused") // Used by parsing bytecode. @FixtureAnnotation class FixtureSubject : FixtureBase(), FixtureInterface { @@ -292,6 +307,8 @@ class BytecodeRemappingTest { } fun methodWithGeneric(list: List): FixtureBase = list[0] + + fun methodWithNestedGeneric(arg: FixtureGenericOuter.FixtureInner) = Unit } }