From 982982c63027e416bd78ca40708c7238e7eed26b Mon Sep 17 00:00:00 2001 From: Jonas Herzig Date: Thu, 11 Nov 2021 16:52:27 +0100 Subject: Fix remapping of qualified inner class reference in Kotlin code When we used to remap `a.pkg.A.Inner` we would apply both mappings (the one for the inner class and the one for the outer class) at the same time, resulting in `b.pkg.B.Inner.Inner`. The direct cause being that we only checked conflicts for the range of the respective expression (which is just `A` and `Inner` for Kotlin, and therefore not conflicting) instead of the parent as we should have. With that fixed, it now also becomes apparent that we need to apply mappings for dot qualified expressions back to front (otherwise the outer class takes priority), so that is the second thing this commit change. --- src/test/kotlin/com/replaymod/gradle/remap/util/TestData.kt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/test/kotlin/com/replaymod/gradle/remap/util') diff --git a/src/test/kotlin/com/replaymod/gradle/remap/util/TestData.kt b/src/test/kotlin/com/replaymod/gradle/remap/util/TestData.kt index cb0ad44..0f83373 100644 --- a/src/test/kotlin/com/replaymod/gradle/remap/util/TestData.kt +++ b/src/test/kotlin/com/replaymod/gradle/remap/util/TestData.kt @@ -45,4 +45,7 @@ object TestData { fun remap(content: String): String = transformer.remap(mapOf("test.java" to content))["test.java"]!!.first fun remapWithErrors(content: String) = transformer.remap(mapOf("test.java" to content))["test.java"]!! + + fun remapKt(content: String): String = transformer.remap(mapOf("test.kt" to content))["test.kt"]!!.first + fun remapKtWithErrors(content: String) = transformer.remap(mapOf("test.kt" to content))["test.kt"]!! } \ No newline at end of file -- cgit