JVM IR: do not hide constructor with inline class in anonymous object

#KT-45131 Fixed
This commit is contained in:
Alexander Udalov
2021-02-24 19:58:27 +01:00
parent b026de768d
commit b417786fd4
13 changed files with 80 additions and 3 deletions
@@ -90,7 +90,10 @@ class AnonymousObjectTransformer(
val node = MethodNode(access, name, desc, signature, exceptions)
if (name == "<init>") {
if (constructor != null) {
throw RuntimeException("Lambda, SAM or anonymous object should have only one constructor")
throw RuntimeException(
"Lambda, SAM or anonymous object should have only one constructor.\n" +
"First:\n${constructor.nodeText}\n\nSecond:\n${node.nodeText}\n"
)
}
constructor = node
} else {