Uast: AbstractKotlinUVariable annotations now are retrieved from Kotlin Psi, not from compiled (KT-21025)

and `KotlinNullabilityUAnnotation` now is created for every `AbstractKotlinUVariable`
This commit is contained in:
Nicolay Mitropolsky
2017-10-15 15:17:15 +03:00
committed by Nikolay Krasko
parent f0723a5c07
commit 260c549cd7
37 changed files with 228 additions and 77 deletions
@@ -2,7 +2,7 @@ UFile (package = )
UClass (name = DefaultParameterValuesKt)
UAnnotationMethod (name = foo)
UParameter (name = a)
UAnnotation (fqName = null)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
ULiteralExpression (value = 1)
UParameter (name = foo)
UAnnotation (fqName = org.jetbrains.annotations.Nullable)
@@ -1,4 +1,4 @@
public final class DefaultParameterValuesKt {
public static final fun foo(@null a: int, @org.jetbrains.annotations.Nullable foo: java.lang.String) : void {
public static final fun foo(@org.jetbrains.annotations.NotNull a: int, @org.jetbrains.annotations.Nullable foo: java.lang.String) : void {
}
}
@@ -4,16 +4,19 @@ UFile (package = )
UBlockExpression
UDeclarationsExpression
ULocalVariable (name = var268d4034)
UAnnotation (fqName = null)
UBinaryExpression (operator = <other>)
ULiteralExpression (value = "foo")
ULiteralExpression (value = 1)
ULocalVariable (name = a)
UAnnotation (fqName = null)
UQualifiedReferenceExpression
USimpleNameReferenceExpression (identifier = var268d4034)
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))
UIdentifier (Identifier (component1))
USimpleNameReferenceExpression (identifier = <anonymous class>)
ULocalVariable (name = b)
UAnnotation (fqName = null)
UQualifiedReferenceExpression
USimpleNameReferenceExpression (identifier = var268d4034)
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))
@@ -1,7 +1,7 @@
public final class DestructuringDeclarationKt {
public static final fun foo() : void {
var var268d4034: <ErrorType> = "foo" <other> 1
var a: java.lang.String = var268d4034.<anonymous class>()
var b: int = var268d4034.<anonymous class>()
@null var var268d4034: <ErrorType> = "foo" <other> 1
@null var a: java.lang.String = var268d4034.<anonymous class>()
@null var b: int = var268d4034.<anonymous class>()
}
}
+2
View File
@@ -12,9 +12,11 @@ UFile (package = )
UExpressionList (elvis)
UDeclarationsExpression
ULocalVariable (name = var243c51a0)
UAnnotation (fqName = null)
UExpressionList (elvis)
UDeclarationsExpression
ULocalVariable (name = varc4aef569)
UAnnotation (fqName = null)
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))
UIdentifier (Identifier (foo))
USimpleNameReferenceExpression (identifier = foo)
+2 -2
View File
@@ -3,8 +3,8 @@ public final class ElvisKt {
public static final fun bar() : int = 42
public static final fun baz() : java.lang.String {
return elvis {
var var243c51a0: java.lang.String = elvis {
var varc4aef569: java.lang.String = foo("Lorem ipsum")
@null var var243c51a0: java.lang.String = elvis {
@null var varc4aef569: java.lang.String = foo("Lorem ipsum")
if (varc4aef569 != null) varc4aef569 else foo("dolor sit amet")
}
if (var243c51a0 != null) var243c51a0 else bar().toString()
+1
View File
@@ -1,6 +1,7 @@
UFile (package = )
UClass (name = Style)
UEnumConstant (name = SHEET)
UAnnotation (fqName = null)
USimpleNameReferenceExpression (identifier = Style)
UClass (name = null)
UAnnotationMethod (name = getExitAnimation)
+1 -1
View File
@@ -1,5 +1,5 @@
public enum Style {
SHEET {
@null SHEET {
public fun getExitAnimation() : java.lang.String = "bar"
fun SHEET() = UastEmptyExpression
}
+4 -4
View File
@@ -3,9 +3,9 @@ UFile (package = )
UAnnotationMethod (name = Foo)
UClass (name = Bar)
UField (name = a)
UAnnotation (fqName = null)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UField (name = b)
UAnnotation (fqName = null)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UAnnotationMethod (name = getAPlusB)
UBinaryExpression (operator = +)
USimpleNameReferenceExpression (identifier = a)
@@ -14,9 +14,9 @@ UFile (package = )
UAnnotationMethod (name = getB)
UAnnotationMethod (name = Bar)
UParameter (name = a)
UAnnotation (fqName = null)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UParameter (name = b)
UAnnotation (fqName = null)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UClass (name = Baz)
UAnnotationMethod (name = doNothing)
USimpleNameReferenceExpression (identifier = Unit)
+3 -3
View File
@@ -1,12 +1,12 @@
public final class Foo {
public fun Foo() = UastEmptyExpression
public static final class Bar {
@null private final var a: int
@null private final var b: int
@org.jetbrains.annotations.NotNull private final var a: int
@org.jetbrains.annotations.NotNull private final var b: int
public final fun getAPlusB() : int = a + b
public final fun getA() : int = UastEmptyExpression
public final fun getB() : int = UastEmptyExpression
public fun Bar(@null a: int, @null b: int) = UastEmptyExpression
public fun Bar(@org.jetbrains.annotations.NotNull a: int, @org.jetbrains.annotations.NotNull b: int) = UastEmptyExpression
public static final class Baz {
public final fun doNothing() : void = Unit
public fun Baz() = UastEmptyExpression
@@ -22,6 +22,7 @@ UFile (package = )
UVariable (name = someLocalFun)
ULambdaExpression
UParameter (name = text)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
ULiteralExpression (value = 42)
UReturnExpression
UBinaryExpression (operator = ==)
+1 -1
View File
@@ -9,7 +9,7 @@ public final class LocalDeclarationsKt {
var baz: kotlin.jvm.functions.Function0<? extends kotlin.Unit> = fun () {
<init>()
}
var someLocalFun: kotlin.jvm.functions.Function2<? super java.lang.Integer,? super java.lang.String,? extends java.lang.Integer> = fun (var text: java.lang.String) {
var someLocalFun: kotlin.jvm.functions.Function2<? super java.lang.Integer,? super java.lang.String,? extends java.lang.Integer> = fun (@org.jetbrains.annotations.NotNull var text: java.lang.String) {
42
}
return bar() == <init>()
+5 -4
View File
@@ -18,10 +18,11 @@ UFile (package = ) [public final class LocalDeclarationsKt {...]
UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [<init>()] : PsiType:<ErrorType>
UIdentifier (Identifier (Local)) [UIdentifier (Identifier (Local))]
USimpleNameReferenceExpression (identifier = <init>) [<init>] : PsiType:<ErrorType>
UDeclarationsExpression [var someLocalFun: kotlin.jvm.functions.Function2<? super java.lang.Integer,? super java.lang.String,? extends java.lang.Integer> = fun (var text: java.lang.String) {...}]
UVariable (name = someLocalFun) [var someLocalFun: kotlin.jvm.functions.Function2<? super java.lang.Integer,? super java.lang.String,? extends java.lang.Integer> = fun (var text: java.lang.String) {...}]
ULambdaExpression [fun (var text: java.lang.String) {...}]
UParameter (name = text) [var text: java.lang.String]
UDeclarationsExpression [var someLocalFun: kotlin.jvm.functions.Function2<? super java.lang.Integer,? super java.lang.String,? extends java.lang.Integer> = fun (@org.jetbrains.annotations.NotNull var text: java.lang.String) {...}]
UVariable (name = someLocalFun) [var someLocalFun: kotlin.jvm.functions.Function2<? super java.lang.Integer,? super java.lang.String,? extends java.lang.Integer> = fun (@org.jetbrains.annotations.NotNull var text: java.lang.String) {...}]
ULambdaExpression [fun (@org.jetbrains.annotations.NotNull var text: java.lang.String) {...}]
UParameter (name = text) [@org.jetbrains.annotations.NotNull var text: java.lang.String]
UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull]
ULiteralExpression (value = 42) [42] : PsiType:int
UReturnExpression [return bar() == <init>()] : PsiType:Void
UBinaryExpression (operator = ==) [bar() == <init>()] : PsiType:boolean
+5 -4
View File
@@ -18,10 +18,11 @@ UFile (package = ) [public final class LocalDeclarationsKt {...]
UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [<init>()] = external <init>()()
UIdentifier (Identifier (Local)) [UIdentifier (Identifier (Local))]
USimpleNameReferenceExpression (identifier = <init>) [<init>] = external <init>()()
UDeclarationsExpression [var someLocalFun: kotlin.jvm.functions.Function2<? super java.lang.Integer,? super java.lang.String,? extends java.lang.Integer> = fun (var text: java.lang.String) {...}] = Undetermined
UVariable (name = someLocalFun) [var someLocalFun: kotlin.jvm.functions.Function2<? super java.lang.Integer,? super java.lang.String,? extends java.lang.Integer> = fun (var text: java.lang.String) {...}]
ULambdaExpression [fun (var text: java.lang.String) {...}] = Undetermined
UParameter (name = text) [var text: java.lang.String]
UDeclarationsExpression [var someLocalFun: kotlin.jvm.functions.Function2<? super java.lang.Integer,? super java.lang.String,? extends java.lang.Integer> = fun (@org.jetbrains.annotations.NotNull var text: java.lang.String) {...}] = Undetermined
UVariable (name = someLocalFun) [var someLocalFun: kotlin.jvm.functions.Function2<? super java.lang.Integer,? super java.lang.String,? extends java.lang.Integer> = fun (@org.jetbrains.annotations.NotNull var text: java.lang.String) {...}]
ULambdaExpression [fun (@org.jetbrains.annotations.NotNull var text: java.lang.String) {...}] = Undetermined
UParameter (name = text) [@org.jetbrains.annotations.NotNull var text: java.lang.String]
UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull]
ULiteralExpression (value = 42) [42] = 42
UReturnExpression [return bar() == <init>()] = Nothing
UBinaryExpression (operator = ==) [bar() == <init>()] = Undetermined
@@ -6,26 +6,26 @@ UFile (package = )
UClass (name = MyAnnotation5)
UClass (name = Test1)
UField (name = bar)
UAnnotation (fqName = null)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UAnnotationMethod (name = getBar)
UAnnotationMethod (name = setBar)
UParameter (name = p)
UAnnotation (fqName = null)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UAnnotationMethod (name = Test1)
UParameter (name = bar)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UAnnotation (fqName = MyAnnotation)
UAnnotation (fqName = null)
UClass (name = Test2)
UField (name = bar)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UAnnotation (fqName = MyAnnotation5)
UAnnotation (fqName = null)
UAnnotationMethod (name = getBar)
UAnnotation (fqName = MyAnnotation)
UAnnotationMethod (name = setBar)
UAnnotation (fqName = MyAnnotation2)
UParameter (name = p)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UAnnotation (fqName = MyAnnotation3)
UAnnotation (fqName = null)
UAnnotationMethod (name = Test2)
UParameter (name = bar)
UAnnotation (fqName = null)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
@@ -14,17 +14,17 @@ public abstract annotation MyAnnotation5 {
}
public final class Test1 {
@null private var bar: int
@org.jetbrains.annotations.NotNull private var bar: int
public final fun getBar() : int = UastEmptyExpression
public final fun setBar(@null p: int) : void = UastEmptyExpression
public fun Test1(@MyAnnotation @null bar: int) = UastEmptyExpression
public final fun setBar(@org.jetbrains.annotations.NotNull p: int) : void = UastEmptyExpression
public fun Test1(@org.jetbrains.annotations.NotNull @MyAnnotation bar: int) = UastEmptyExpression
}
public final class Test2 {
@MyAnnotation5 @null private var bar: int
@org.jetbrains.annotations.NotNull @MyAnnotation5 private var bar: int
@MyAnnotation
public final fun getBar() : int = UastEmptyExpression
@MyAnnotation2
public final fun setBar(@MyAnnotation3 @null p: int) : void = UastEmptyExpression
public fun Test2(@null bar: int) = UastEmptyExpression
public final fun setBar(@org.jetbrains.annotations.NotNull @MyAnnotation3 p: int) : void = UastEmptyExpression
public fun Test2(@org.jetbrains.annotations.NotNull bar: int) = UastEmptyExpression
}
@@ -2,13 +2,13 @@ UFile (package = )
UClass (name = ParametersWithDefaultValuesKt)
UAnnotationMethod (name = foo)
UParameter (name = a)
UAnnotation (fqName = null)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UParameter (name = b)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UParameter (name = c)
UAnnotation (fqName = null)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
ULiteralExpression (value = 0)
UParameter (name = flag)
UAnnotation (fqName = null)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
ULiteralExpression (value = false)
UBlockExpression
@@ -1,4 +1,4 @@
public final class ParametersWithDefaultValuesKt {
public static final fun foo(@null a: int, @org.jetbrains.annotations.NotNull b: java.lang.String, @null c: int, @null flag: boolean) : void {
public static final fun foo(@org.jetbrains.annotations.NotNull a: int, @org.jetbrains.annotations.NotNull b: java.lang.String, @org.jetbrains.annotations.NotNull c: int, @org.jetbrains.annotations.NotNull flag: boolean) : void {
}
}
+4 -1
View File
@@ -2,4 +2,7 @@ val sdCardPath by lazy { "/sdcard" }
fun localPropertyTest() {
val sdCardPathLocal by lazy { "/sdcard" }
}
}
@delegate:Suppress
val annotatedDelegate by lazy { 1 + 1 }
+12
View File
@@ -8,6 +8,17 @@ UFile (package = )
ULambdaExpression
UBlockExpression
ULiteralExpression (value = "/sdcard")
UField (name = annotatedDelegate$delegate)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UAnnotation (fqName = kotlin.Suppress)
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))
UIdentifier (Identifier (lazy))
USimpleNameReferenceExpression (identifier = lazy)
ULambdaExpression
UBlockExpression
UBinaryExpression (operator = +)
ULiteralExpression (value = 1)
ULiteralExpression (value = 1)
UAnnotationMethod (name = getSdCardPath)
UAnnotationMethod (name = localPropertyTest)
UBlockExpression
@@ -19,3 +30,4 @@ UFile (package = )
ULambdaExpression
UBlockExpression
ULiteralExpression (value = "/sdcard")
UAnnotationMethod (name = getAnnotatedDelegate)
@@ -1,7 +1,9 @@
public final class PropertyDelegateKt {
@org.jetbrains.annotations.NotNull private static final var sdCardPath$delegate: kotlin.Lazy
@org.jetbrains.annotations.NotNull @kotlin.Suppress private static final var annotatedDelegate$delegate: kotlin.Lazy
public static final fun getSdCardPath() : java.lang.String = UastEmptyExpression
public static final fun localPropertyTest() : void {
var sdCardPathLocal: java.lang.String
}
public static final fun getAnnotatedDelegate() : int = UastEmptyExpression
}
@@ -1,10 +1,11 @@
UFile (package = )
UClass (name = PropertyWithAnnotationKt)
UField (name = prop1)
UAnnotation (fqName = null)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UAnnotation (fqName = TestAnnotation)
ULiteralExpression (value = 0)
UField (name = prop3)
UAnnotation (fqName = null)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
ULiteralExpression (value = 0)
UAnnotationMethod (name = getProp1)
UAnnotationMethod (name = getProp2)
@@ -15,7 +16,7 @@ UFile (package = )
UAnnotationMethod (name = setProp3)
UAnnotation (fqName = TestAnnotation)
UParameter (name = value)
UAnnotation (fqName = null)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UBlockExpression
UBinaryExpression (operator = =)
USimpleNameReferenceExpression (identifier = field)
@@ -1,12 +1,12 @@
public final class PropertyWithAnnotationKt {
@null private static final var prop1: int = 0
@null private static var prop3: int = 0
@org.jetbrains.annotations.NotNull @TestAnnotation private static final var prop1: int = 0
@org.jetbrains.annotations.NotNull private static var prop3: int = 0
public static final fun getProp1() : int = UastEmptyExpression
@TestAnnotation
public static final fun getProp2() : int = 0
public static final fun getProp3() : int = 0
@TestAnnotation
public static final fun setProp3(@null value: int) : void {
public static final fun setProp3(@org.jetbrains.annotations.NotNull value: int) : void {
field = value
}
}
+9
View File
@@ -0,0 +1,9 @@
class SimpleAnnotated {
@Suppress("abc")
fun method() {
println("Hello, world!")
}
@SinceKotlin("1.0")
val property: String = "Mary"
}
+4 -4
View File
@@ -2,7 +2,7 @@ UFile (package = )
UClass (name = SimpleScript)
UAnnotationMethod (name = getBarOrNull)
UParameter (name = flag)
UAnnotation (fqName = null)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UBlockExpression
UReturnExpression
UIfExpression
@@ -30,10 +30,10 @@ UFile (package = )
ULiteralExpression (value = "Goodbye World!")
UClass (name = Bar)
UField (name = b)
UAnnotation (fqName = null)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
ULiteralExpression (value = 0)
UField (name = a)
UAnnotation (fqName = null)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UAnnotationMethod (name = getB)
UAnnotationMethod (name = getAPlusB)
UBinaryExpression (operator = +)
@@ -42,7 +42,7 @@ UFile (package = )
UAnnotationMethod (name = getA)
UAnnotationMethod (name = Bar)
UParameter (name = a)
UAnnotation (fqName = null)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UClass (name = Baz)
UAnnotationMethod (name = doSomething)
UBlockExpression
+4 -4
View File
@@ -1,5 +1,5 @@
public class SimpleScript : kotlin.script.templates.standard.ScriptTemplateWithArgs {
public final fun getBarOrNull(@null flag: boolean) : SimpleScript.Bar {
public final fun getBarOrNull(@org.jetbrains.annotations.NotNull flag: boolean) : SimpleScript.Bar {
return if (flag) <init>(42) else null
}
public fun SimpleScript(@null p: java.lang.String[]) {
@@ -8,12 +8,12 @@ public class SimpleScript : kotlin.script.templates.standard.ScriptTemplateWithA
println("Goodbye World!")
}
public static final class Bar {
@null private final var b: int = 0
@null private final var a: int
@org.jetbrains.annotations.NotNull private final var b: int = 0
@org.jetbrains.annotations.NotNull private final var a: int
public final fun getB() : int = UastEmptyExpression
public final fun getAPlusB() : int = a + b
public final fun getA() : int = UastEmptyExpression
public fun Bar(@null a: int) = UastEmptyExpression
public fun Bar(@org.jetbrains.annotations.NotNull a: int) = UastEmptyExpression
public static final class Baz {
public final fun doSomething() : void {
}
+1 -1
View File
@@ -45,7 +45,7 @@ UFile (package = )
UAnnotationMethod (name = getLiteralInLiteral2)
UAnnotationMethod (name = simpleForTemplate)
UParameter (name = i)
UAnnotation (fqName = null)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
ULiteralExpression (value = 0)
USimpleNameReferenceExpression (identifier = i)
UAnnotationMethod (name = foo)
@@ -9,7 +9,7 @@ public final class StringTemplateComplexKt {
public static final fun getCase5() : java.lang.String = UastEmptyExpression
public static final fun getLiteralInLiteral() : java.lang.String = UastEmptyExpression
public static final fun getLiteralInLiteral2() : java.lang.String = UastEmptyExpression
public static final fun simpleForTemplate(@null i: int) : java.lang.String = i
public static final fun simpleForTemplate(@org.jetbrains.annotations.NotNull i: int) : java.lang.String = i
public static final fun foo() : void {
println(baz)
var template1: java.lang.String = simpleForTemplate()
+5 -5
View File
@@ -17,7 +17,7 @@ UFile (package = )
UAnnotationMethod (name = SuperCallsKt$anon$1)
UClass (name = innerObject)
UField (name = INSTANCE)
UAnnotation (fqName = null)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UAnnotationMethod (name = innerObject)
UBlockExpression
UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1))
@@ -41,7 +41,7 @@ UFile (package = )
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UAnnotationMethod (name = foo)
UParameter (name = a)
UAnnotation (fqName = null)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UBlockExpression
UAnnotationMethod (name = getStr)
UAnnotationMethod (name = A)
@@ -49,7 +49,7 @@ UFile (package = )
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UAnnotationMethod (name = A)
UParameter (name = i)
UAnnotation (fqName = null)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UBlockExpression
UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1))
UIdentifier (Identifier (this))
@@ -71,7 +71,7 @@ UFile (package = )
UClass (name = C)
UAnnotationMethod (name = foo)
UParameter (name = a)
UAnnotation (fqName = null)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UBlockExpression
UQualifiedReferenceExpression
USuperExpression (label = null)
@@ -89,7 +89,7 @@ UFile (package = )
USimpleNameReferenceExpression (identifier = p)
UAnnotationMethod (name = C)
UParameter (name = i)
UAnnotation (fqName = null)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UBlockExpression
UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1))
UIdentifier (Identifier (super))
+4 -4
View File
@@ -15,11 +15,11 @@ public final class SuperCallsKt {
public class A {
@org.jetbrains.annotations.NotNull private final var str: java.lang.String
public fun foo(@null a: long) : void {
public fun foo(@org.jetbrains.annotations.NotNull a: long) : void {
}
public final fun getStr() : java.lang.String = UastEmptyExpression
public fun A(@org.jetbrains.annotations.NotNull str: java.lang.String) = UastEmptyExpression
public fun A(@null i: int) {
public fun A(@org.jetbrains.annotations.NotNull i: int) {
<init>(i.toString())
}
}
@@ -31,13 +31,13 @@ public final class B : A {
}
public final class C : A {
public fun foo(@null a: long) : void {
public fun foo(@org.jetbrains.annotations.NotNull a: long) : void {
super.foo(a)
}
public fun C(@org.jetbrains.annotations.NotNull p: java.lang.String) {
<init>(p)
}
public fun C(@null i: int) {
public fun C(@org.jetbrains.annotations.NotNull i: int) {
<init>(i)
println()
}
@@ -24,14 +24,17 @@ UFile (package = )
UExpressionList (when_entry)
UDeclarationsExpression
ULocalVariable (name = var837f1e82)
UAnnotation (fqName = null)
USimpleNameReferenceExpression (identifier = arr)
ULocalVariable (name = bindingContext)
UAnnotation (fqName = null)
UQualifiedReferenceExpression
USimpleNameReferenceExpression (identifier = var837f1e82)
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))
UIdentifier (Identifier (component1))
USimpleNameReferenceExpression (identifier = <anonymous class>)
ULocalVariable (name = statementFilter)
UAnnotation (fqName = null)
UQualifiedReferenceExpression
USimpleNameReferenceExpression (identifier = var837f1e82)
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))
+3 -3
View File
@@ -8,9 +8,9 @@ public final class WhenAndDestructingKt {
}
-> {
var var837f1e82: <ErrorType> = arr
var bindingContext: java.lang.String = var837f1e82.<anonymous class>()
var statementFilter: java.lang.String = var837f1e82.<anonymous class>()
@null var var837f1e82: <ErrorType> = arr
@null var bindingContext: java.lang.String = var837f1e82.<anonymous class>()
@null var statementFilter: java.lang.String = var837f1e82.<anonymous class>()
return bindingContext
break
}
+1 -1
View File
@@ -6,7 +6,7 @@ UFile (package = )
UIdentifier (Identifier (readLine))
USimpleNameReferenceExpression (identifier = readLine)
UField (name = b)
UAnnotation (fqName = null)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
USwitchExpression
USimpleNameReferenceExpression (identifier = a)
UExpressionList (when)
+1 -1
View File
@@ -1,6 +1,6 @@
public final class WhenStringLiteralKt {
@org.jetbrains.annotations.Nullable private static final var a: java.lang.String = readLine()
@null private static final var b: int = switch (a) {
@org.jetbrains.annotations.NotNull private static final var b: int = switch (a) {
"abc" -> {
1
break