KT-47475 Do not copy InnerClass attribute for WhenMapping classes

This commit is contained in:
Pavel Mikhailovskii
2022-08-25 12:33:52 +02:00
committed by teamcity
parent 38099e11c3
commit d65775ca1a
6 changed files with 57 additions and 0 deletions
@@ -83,6 +83,13 @@ class WhenMappingTransformer(
methodNodes.add(this)
}
}
override fun visitInnerClass(name: String?, outerName: String?, innerName: String?, access: Int) {
// Drop the attribute as the recreated class is not an inner class of the original outer class.
// In principle, we could also generate a new attribute with outerName set to the caller-side class,
// but that would require modification of both the inner (recreated) and the outer (caller-side) classes.
// The latter would require a lot of work without any clear benefits.
}
}, ClassReader.SKIP_FRAMES)
assert(methodNodes.size == 1) {