aboutsummaryrefslogtreecommitdiff
path: root/src/test/kotlin/com/replaymod/gradle/remap/mapper
diff options
context:
space:
mode:
authorJonas Herzig <jonas@spark-squared.com>2021-11-12 12:58:49 +0100
committerJonas Herzig <jonas@spark-squared.com>2021-11-13 10:28:09 +0100
commit3ee08cbce94a4e7e1ce668f06f5a612cd9f1e677 (patch)
tree940042d08d31be55f9c1ea643bf3cf41070121ce /src/test/kotlin/com/replaymod/gradle/remap/mapper
parentb30404f156adb6e01bfe4edc50b4de4245ba4509 (diff)
downloadRemap-3ee08cbce94a4e7e1ce668f06f5a612cd9f1e677.tar.gz
Remap-3ee08cbce94a4e7e1ce668f06f5a612cd9f1e677.tar.bz2
Remap-3ee08cbce94a4e7e1ce668f06f5a612cd9f1e677.zip
Fix mapping of synthetic properties when overridden in Kotlin class
In these cases, the getMethod of the property will not have a Psi element and we need to traverse up the overrides until we find one that does.
Diffstat (limited to 'src/test/kotlin/com/replaymod/gradle/remap/mapper')
-rw-r--r--src/test/kotlin/com/replaymod/gradle/remap/mapper/kotlin/TestKotlinSyntheticProperties.kt13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/kotlin/com/replaymod/gradle/remap/mapper/kotlin/TestKotlinSyntheticProperties.kt b/src/test/kotlin/com/replaymod/gradle/remap/mapper/kotlin/TestKotlinSyntheticProperties.kt
index b77978a..20b65b9 100644
--- a/src/test/kotlin/com/replaymod/gradle/remap/mapper/kotlin/TestKotlinSyntheticProperties.kt
+++ b/src/test/kotlin/com/replaymod/gradle/remap/mapper/kotlin/TestKotlinSyntheticProperties.kt
@@ -141,4 +141,17 @@ class TestKotlinSyntheticProperties {
val v = B().b
""".trimIndent()
}
+
+ @Test
+ fun `remaps synthetic property even when overwritten in kotlin subclass`() {
+ TestData.remapKt("""
+ import pkg.Kt
+ val v = Kt().syntheticA
+ fun test() { Kt().syntheticA = Kt() }
+ """.trimIndent()) shouldBe """
+ import pkg.Kt
+ val v = Kt().syntheticB
+ fun test() { Kt().syntheticB = Kt() }
+ """.trimIndent()
+ }
}