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:
committed by
xiexed
parent
b8069b48c5
commit
209ba89a49
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user