aboutsummaryrefslogtreecommitdiff
path: root/src/test/kotlin
AgeCommit message (Collapse)Author
2021-11-11Fix remapping of qualified inner class reference in Kotlin codeJonas Herzig
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.
2021-11-11Fix mixin @At target not considering mappings from parent classesJonas Herzig
When remapping the @At `target` argument, we used to only look at the mappings for the target class but we also need to consider mappings for its super classes and interfaces. This commit now searches for the target Psi method and then uses the regular remap method for PsiMethod to get its properly mapped name.
2021-11-10Add test for anonymous inner class mixin targetJonas Herzig
To ensure the mixin target is being remapped, even though the corresponding PsiClass cannot be found.
2021-11-10Remap mixin injector target arguments even when method is not mappedJonas Herzig
E.g. there are no mapping entries for constructors cause their name is always `<init>` but we nevertheless want to remap their argument types. We cannot determine whether the name is ambiguous in the mapped environment (because that check is based on the mappings), so we always keep the arguments when it previously had ones.
2021-11-10Fix mixin injectors not considering mappings from parent classesJonas Herzig
When remapping the injector target argument (`method`), we used to only look at the mappings for the mixin target class but we also need to consider mappings for its super classes and interfaces. This commit now searches for the target Psi method and then uses the regular remap method for PsiMethod to get its properly mapped name. It still only looks at the target class mappings to determine whether the new name is ambiguous because we do not have access to the remapped target class hierarchy.
2021-11-10Start adding testsJonas Herzig