Uast: secondary constructors delegation support (KT-21409)
This commit is contained in:
committed by
xiexed
parent
3bfa5c4706
commit
1ce21583ad
+19
@@ -23,6 +23,15 @@ UFile (package = )
|
||||
UAnnotationMethod (name = A)
|
||||
UParameter (name = i)
|
||||
UAnnotation (fqName = null)
|
||||
UBlockExpression
|
||||
UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1))
|
||||
UIdentifier (Identifier (this))
|
||||
USimpleNameReferenceExpression (identifier = <init>)
|
||||
UQualifiedReferenceExpression
|
||||
USimpleNameReferenceExpression (identifier = i)
|
||||
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))
|
||||
UIdentifier (Identifier (toString))
|
||||
USimpleNameReferenceExpression (identifier = toString)
|
||||
UClass (name = B)
|
||||
UAnnotationMethod (name = B)
|
||||
UParameter (name = param)
|
||||
@@ -46,9 +55,19 @@ UFile (package = )
|
||||
UAnnotationMethod (name = C)
|
||||
UParameter (name = p)
|
||||
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
|
||||
UBlockExpression
|
||||
UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1))
|
||||
UIdentifier (Identifier (super))
|
||||
USimpleNameReferenceExpression (identifier = <init>)
|
||||
USimpleNameReferenceExpression (identifier = p)
|
||||
UAnnotationMethod (name = C)
|
||||
UParameter (name = i)
|
||||
UAnnotation (fqName = null)
|
||||
UBlockExpression
|
||||
UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1))
|
||||
UIdentifier (Identifier (super))
|
||||
USimpleNameReferenceExpression (identifier = <init>)
|
||||
USimpleNameReferenceExpression (identifier = i)
|
||||
UClass (name = O)
|
||||
UField (name = INSTANCE)
|
||||
UAnnotation (fqName = null)
|
||||
|
||||
+11
-5
@@ -1,6 +1,6 @@
|
||||
public final class SuperCallsKt {
|
||||
private static final var anon: A = anonymous object : A ("textForAnon"){
|
||||
fun bar(){}
|
||||
private static final var anon: A = anonymous object : A("textForAnon") {
|
||||
fun bar() {}
|
||||
}
|
||||
public static final fun getAnon() : A = UastEmptyExpression
|
||||
}
|
||||
@@ -11,7 +11,9 @@ public class A {
|
||||
}
|
||||
public final fun getStr() : java.lang.String = UastEmptyExpression
|
||||
public fun A(str: java.lang.String) = UastEmptyExpression
|
||||
public fun A(i: int) = UastEmptyExpression
|
||||
public fun A(i: int) {
|
||||
<init>(i.toString())
|
||||
}
|
||||
}
|
||||
|
||||
public final class B : A {
|
||||
@@ -24,8 +26,12 @@ public final class C : A {
|
||||
public fun foo(a: long) : void {
|
||||
super.foo(a)
|
||||
}
|
||||
public fun C(p: java.lang.String) = UastEmptyExpression
|
||||
public fun C(i: int) = UastEmptyExpression
|
||||
public fun C(p: java.lang.String) {
|
||||
<init>(p)
|
||||
}
|
||||
public fun C(i: int) {
|
||||
<init>(i)
|
||||
}
|
||||
}
|
||||
|
||||
public final class O : A {
|
||||
|
||||
Reference in New Issue
Block a user