Uast: KotlinSecondaryConstructorWithInitializersUMethod introduced as workaround for KT-21617

to be the only constructor which includes `init` block when there is no primary constructors in the class
This commit is contained in:
Nicolay Mitropolsky
2017-12-05 12:22:36 +03:00
committed by xiexed
parent b8069b48c5
commit 209ba89a49
5 changed files with 39 additions and 6 deletions
-2
View File
@@ -58,8 +58,6 @@ class AWithSecondaryInit {
lateinit var a: String
init {
// This body will not be picked by UAST because no lightMethod contains it.
// Of course it is not a desired behaviour, so fix it if you know how
println()
}
+4
View File
@@ -130,6 +130,10 @@ UFile (package = )
UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0))
UIdentifier (Identifier ())
USimpleNameReferenceExpression (identifier = <init>)
UBlockExpression
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))
UIdentifier (Identifier (println))
USimpleNameReferenceExpression (identifier = println)
UBinaryExpression (operator = =)
USimpleNameReferenceExpression (identifier = a)
UQualifiedReferenceExpression
+3
View File
@@ -67,6 +67,9 @@ public final class AWithSecondaryInit {
public final fun setA(p: java.lang.String) : void = UastEmptyExpression
public fun AWithSecondaryInit(i: int) {
<init>()
{
println()
}
a = i.toString()
}
public fun AWithSecondaryInit(s: java.lang.String) {