diff --git a/generators/idea-generator/tests/org/jetbrains/kotlin/generators/tests/idea/GenerateTests.kt b/generators/idea-generator/tests/org/jetbrains/kotlin/generators/tests/idea/GenerateTests.kt index ed8b791ccec..3e7d4e12629 100644 --- a/generators/idea-generator/tests/org/jetbrains/kotlin/generators/tests/idea/GenerateTests.kt +++ b/generators/idea-generator/tests/org/jetbrains/kotlin/generators/tests/idea/GenerateTests.kt @@ -1673,6 +1673,10 @@ fun main(args: Array) { testClass { model("") } + + testClass { + model("") + } } testGroup("plugins/uast-kotlin-fir/tests", "plugins/uast-kotlin-fir/testData") { @@ -1693,6 +1697,10 @@ fun main(args: Array) { testClass { model("") } + + testClass { + model("") + } } testGroup("idea/performanceTests/test", "idea/testData") { diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/AnnotatedExpressions.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/AnnotatedExpressions.values.fe10.txt new file mode 100644 index 00000000000..986c03d149a --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/AnnotatedExpressions.values.fe10.txt @@ -0,0 +1,74 @@ +UFile (package = ) [public final class AnnotatedExpressionsKt {...] + UClass (name = AnnotatedExpressionsKt) [public final class AnnotatedExpressionsKt {...}] + UMethod (name = foo) [public static final fun foo() : void {...}] + UBlockExpression [{...}] = Undetermined + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [foo()] = external foo()() + UAnnotation (fqName = kotlin.Suppress) [@kotlin.Suppress] + UIdentifier (Identifier (foo)) [UIdentifier (Identifier (foo))] + USimpleNameReferenceExpression (identifier = foo, resolvesTo = null) [foo] = external foo()() + UDeclarationsExpression [@kotlin.Suppress var a: int = 1] = Undetermined + ULocalVariable (name = a) [@kotlin.Suppress var a: int = 1] + UAnnotation (fqName = kotlin.Suppress) [@kotlin.Suppress] + ULiteralExpression (value = 1) [1] = 1 + UDeclarationsExpression [@kotlin.Suppress var b: int = 2] = Undetermined + ULocalVariable (name = b) [@kotlin.Suppress var b: int = 2] + UAnnotation (fqName = kotlin.Suppress) [@kotlin.Suppress] + ULiteralExpression (value = 2) [2] = 2 + UBinaryExpression (operator = =) [b = a] = (var a = 1) + UAnnotation (fqName = kotlin.Suppress) [@kotlin.Suppress] + USimpleNameReferenceExpression (identifier = b) [b] = (var b = 2) + USimpleNameReferenceExpression (identifier = a) [a] = (var a = 1) + UIfExpression [if (a > 2) a else b] = (var b = (var a = 1)) + UAnnotation (fqName = kotlin.Suppress) [@kotlin.Suppress] + UBinaryExpression (operator = >) [a > 2] = false (depending on: (var a = 1)) + USimpleNameReferenceExpression (identifier = a) [a] = (var a = 1) + ULiteralExpression (value = 2) [2] = 2 + USimpleNameReferenceExpression (identifier = a) [a] = (var a = 1) + USimpleNameReferenceExpression (identifier = b) [b] = (var b = (var a = 1)) + UDeclarationsExpression [var c: int = elvis {...}] = Undetermined + ULocalVariable (name = c) [var c: int = elvis {...}] + UExpressionList (elvis) [elvis {...}] = Undetermined + UDeclarationsExpression [var varae507364: int = a] = Undetermined + ULocalVariable (name = varae507364) [var varae507364: int = a] + USimpleNameReferenceExpression (identifier = a) [a] = Undetermined + UAnnotation (fqName = kotlin.Suppress) [@kotlin.Suppress] + UIfExpression [if (varae507364 != null) varae507364 else b] = Undetermined + UBinaryExpression (operator = !=) [varae507364 != null] = Undetermined + USimpleNameReferenceExpression (identifier = varae507364) [varae507364] = Undetermined + ULiteralExpression (value = null) [null] = null + USimpleNameReferenceExpression (identifier = varae507364) [varae507364] = Undetermined + USimpleNameReferenceExpression (identifier = b) [b] = Undetermined + UMethod (name = annotatedSwitch) [public static final fun annotatedSwitch(@org.jetbrains.annotations.NotNull str: java.lang.String) : java.lang.Integer {...}] + UParameter (name = str) [@org.jetbrains.annotations.NotNull var str: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UReturnExpression [return switch {...] = Nothing + USwitchExpression [switch {...] = null + UExpressionList (when) [ str.isBlank() -> {... ] = null + USwitchClauseExpressionWithBody [str.isBlank() -> {...] = Undetermined + UQualifiedReferenceExpression [str.isBlank()] = external isBlank()() + UAnnotation (fqName = kotlin.Suppress) [@kotlin.Suppress(names = "DEPRECATION")] + UNamedExpression (name = names) [names = "DEPRECATION"] = Nothing + ULiteralExpression (value = "DEPRECATION") ["DEPRECATION"] = "DEPRECATION" + USimpleNameReferenceExpression (identifier = str) [str] = Undetermined + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [isBlank()] = external isBlank()() + UIdentifier (Identifier (isBlank)) [UIdentifier (Identifier (isBlank))] + USimpleNameReferenceExpression (identifier = isBlank, resolvesTo = null) [isBlank] = external isBlank()() + UExpressionList (when_entry) [{...] = Undetermined + UYieldExpression [yield null] = UYieldResult(null) + ULiteralExpression (value = null) [null] = null + USwitchClauseExpressionWithBody [str.isNotEmpty() != null -> {...] = Undetermined + UBinaryExpression (operator = !=) [str.isNotEmpty() != null] = Undetermined + UQualifiedReferenceExpression [str.isNotEmpty()] = external isNotEmpty()() + USimpleNameReferenceExpression (identifier = str) [str] = Undetermined + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [isNotEmpty()] = external isNotEmpty()() + UIdentifier (Identifier (isNotEmpty)) [UIdentifier (Identifier (isNotEmpty))] + USimpleNameReferenceExpression (identifier = isNotEmpty, resolvesTo = null) [isNotEmpty] = external isNotEmpty()() + ULiteralExpression (value = null) [null] = null + UExpressionList (when_entry) [{...] = Undetermined + UYieldExpression [yield null] = UYieldResult(null) + ULiteralExpression (value = null) [null] = null + USwitchClauseExpressionWithBody [ -> {...] = Undetermined + UExpressionList (when_entry) [{...] = Undetermined + UYieldExpression [yield 1] = UYieldResult(1) + ULiteralExpression (value = 1) [1] = 1 diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/AnnotatedExpressions.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/AnnotatedExpressions.values.fir.txt new file mode 100644 index 00000000000..2942fc899e0 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/AnnotatedExpressions.values.fir.txt @@ -0,0 +1,7 @@ +UFile (package = ) [public final class AnnotatedExpressionsKt {...] + UClass (name = AnnotatedExpressionsKt) [public final class AnnotatedExpressionsKt {...}] + UMethod (name = foo) [public static final fun foo() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = annotatedSwitch) [public static final fun annotatedSwitch(str: java.lang.String) : java.lang.Integer = [!] UnknownKotlinExpression (WHEN)] + UParameter (name = str) [var str: java.lang.String] + [!] UnknownKotlinExpression (WHEN) [[!] UnknownKotlinExpression (WHEN)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/AnnotationComplex.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/AnnotationComplex.values.fe10.txt new file mode 100644 index 00000000000..ae86b621cbe --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/AnnotationComplex.values.fe10.txt @@ -0,0 +1,49 @@ +UFile (package = ) [public abstract annotation Annotation {...] + UClass (name = Annotation) [public abstract annotation Annotation {...}] + UAnnotationMethod (name = strings) [public abstract fun strings() : java.lang.String[] = UastEmptyExpression] + UClass (name = A) [public final class A {...}] + UAnnotation (fqName = Annotation) [@Annotation] + UMethod (name = A) [public fun A() = UastEmptyExpression] + UClass (name = AnnotationInner) [public abstract annotation AnnotationInner {...}] + UAnnotationMethod (name = value) [public abstract fun value() : Annotation = UastEmptyExpression] + UClass (name = B1) [public final class B1 {...}] + UAnnotation (fqName = AnnotationArray) [@AnnotationArray(value = ())] + UNamedExpression (name = value) [value = ()] = Undetermined + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] = Undetermined + UIdentifier (Identifier (Annotation)) [UIdentifier (Identifier (Annotation))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Annotation) [] = Undetermined + UMethod (name = B1) [public fun B1() = UastEmptyExpression] + UClass (name = B2) [public final class B2 {...}] + UAnnotation (fqName = AnnotationArray) [@AnnotationArray(value = ("sv1", "sv2"))] + UNamedExpression (name = value) [value = ("sv1", "sv2")] = Undetermined + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 2)) [("sv1", "sv2")] = Undetermined + UIdentifier (Identifier (Annotation)) [UIdentifier (Identifier (Annotation))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Annotation) [] = Undetermined + ULiteralExpression (value = "sv1") ["sv1"] = Undetermined + ULiteralExpression (value = "sv2") ["sv2"] = Undetermined + UMethod (name = B2) [public fun B2() = UastEmptyExpression] + UClass (name = AnnotationArray) [public abstract annotation AnnotationArray {...}] + UAnnotationMethod (name = value) [public abstract fun value() : Annotation[] = UastEmptyExpression] + UClass (name = C) [public final class C {...}] + UAnnotation (fqName = AnnotationArray) [@AnnotationArray(value = (arrayOf("sar1", "sar2")))] + UNamedExpression (name = value) [value = (arrayOf("sar1", "sar2"))] = Undetermined + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [(arrayOf("sar1", "sar2"))] = Undetermined + UIdentifier (Identifier (Annotation)) [UIdentifier (Identifier (Annotation))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Annotation) [] = Undetermined + UCallExpression (kind = UastCallKind(name='array_initializer'), argCount = 2)) [arrayOf("sar1", "sar2")] = Undetermined + UIdentifier (Identifier (arrayOf)) [UIdentifier (Identifier (arrayOf))] + USimpleNameReferenceExpression (identifier = arrayOf, resolvesTo = null) [arrayOf] = Undetermined + ULiteralExpression (value = "sar1") ["sar1"] = Undetermined + ULiteralExpression (value = "sar2") ["sar2"] = Undetermined + UMethod (name = C) [public fun C() = UastEmptyExpression] + UClass (name = C2) [public final class C2 {...}] + UAnnotation (fqName = AnnotationArray) [@AnnotationArray(value = (collectionLiteral["[sar]1", "[sar]2"]))] + UNamedExpression (name = value) [value = (collectionLiteral["[sar]1", "[sar]2"])] = Undetermined + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [(collectionLiteral["[sar]1", "[sar]2"])] = Undetermined + UIdentifier (Identifier (Annotation)) [UIdentifier (Identifier (Annotation))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Annotation) [] = Undetermined + UCallExpression (kind = UastCallKind(name='array_initializer'), argCount = 2)) [collectionLiteral["[sar]1", "[sar]2"]] = Undetermined + UIdentifier (Identifier ([)) [UIdentifier (Identifier ([))] + ULiteralExpression (value = "[sar]1") ["[sar]1"] = Undetermined + ULiteralExpression (value = "[sar]2") ["[sar]2"] = Undetermined + UMethod (name = C2) [public fun C2() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/AnnotationComplex.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/AnnotationComplex.values.fir.txt new file mode 100644 index 00000000000..5a6b97bc5a3 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/AnnotationComplex.values.fir.txt @@ -0,0 +1,17 @@ +UFile (package = ) [public abstract annotation Annotation {...] + UClass (name = Annotation) [public abstract annotation Annotation {...}] + UMethod (name = strings) [public abstract fun strings() : java.lang.String[] = UastEmptyExpression] + UClass (name = A) [public final class A {...}] + UMethod (name = A) [public fun A() = UastEmptyExpression] + UClass (name = AnnotationInner) [public abstract annotation AnnotationInner {...}] + UMethod (name = value) [public abstract fun value() : Annotation = UastEmptyExpression] + UClass (name = B1) [public final class B1 {...}] + UMethod (name = B1) [public fun B1() = UastEmptyExpression] + UClass (name = B2) [public final class B2 {...}] + UMethod (name = B2) [public fun B2() = UastEmptyExpression] + UClass (name = AnnotationArray) [public abstract annotation AnnotationArray {...}] + UMethod (name = value) [public abstract fun value() : Annotation[] = UastEmptyExpression] + UClass (name = C) [public final class C {...}] + UMethod (name = C) [public fun C() = UastEmptyExpression] + UClass (name = C2) [public final class C2 {...}] + UMethod (name = C2) [public fun C2() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/AnnotationParameters.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/AnnotationParameters.values.fe10.txt new file mode 100644 index 00000000000..d61893f3fda --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/AnnotationParameters.values.fe10.txt @@ -0,0 +1,72 @@ +UFile (package = ) [public final class AnnotationParametersKt {...] + UClass (name = AnnotationParametersKt) [public final class AnnotationParametersKt {...}] + UMethod (name = foo) [@RequiresPermission(anyOf = intArrayOf(1, 2, 3))...}] + UAnnotation (fqName = RequiresPermission) [@RequiresPermission(anyOf = intArrayOf(1, 2, 3))] + UNamedExpression (name = anyOf) [anyOf = intArrayOf(1, 2, 3)] = Nothing + UCallExpression (kind = UastCallKind(name='array_initializer'), argCount = 3)) [intArrayOf(1, 2, 3)] = external intArrayOf(1, 2, 3)(1, 2, 3) + UIdentifier (Identifier (intArrayOf)) [UIdentifier (Identifier (intArrayOf))] + USimpleNameReferenceExpression (identifier = intArrayOf, resolvesTo = null) [intArrayOf] = external intArrayOf(1, 2, 3)(1, 2, 3) + ULiteralExpression (value = 1) [1] = 1 + ULiteralExpression (value = 2) [2] = 2 + ULiteralExpression (value = 3) [3] = 3 + UAnnotation (fqName = IntRange) [@IntRange(from = 10, to = 0)] + UNamedExpression (name = from) [from = 10] = Nothing + ULiteralExpression (value = 10) [10] = 10 + UNamedExpression (name = to) [to = 0] = Nothing + ULiteralExpression (value = 0) [0] = 0 + UAnnotation (fqName = WithDefaultValue) [@WithDefaultValue] + UAnnotation (fqName = SuppressLint) [@SuppressLint(value = "Lorem")] + UNamedExpression (name = value) [value = "Lorem"] = Nothing + ULiteralExpression (value = "Lorem") ["Lorem"] = "Lorem" + UBlockExpression [{...}] = Nothing + UReturnExpression [return 5] = Nothing + ULiteralExpression (value = 5) [5] = 5 + UMethod (name = bar) [@IntRange(from = 0, to = 100)...}] + UAnnotation (fqName = IntRange) [@IntRange(from = 0, to = 100)] + UNamedExpression (name = from) [from = 0] = Nothing + ULiteralExpression (value = 0) [0] = 0 + UNamedExpression (name = to) [to = 100] = Nothing + ULiteralExpression (value = 100) [100] = 100 + UAnnotation (fqName = SuppressLint) [@SuppressLint(value = ("Lorem", "Ipsum", "Dolor"))] + UNamedExpression (name = value) [value = ("Lorem", "Ipsum", "Dolor")] = Nothing + UCallExpression (kind = UastCallKind(name='array_initializer'), argCount = 3)) [("Lorem", "Ipsum", "Dolor")] = Nothing + ULiteralExpression (value = "Lorem") ["Lorem"] = "Lorem" + ULiteralExpression (value = "Ipsum") ["Ipsum"] = "Ipsum" + ULiteralExpression (value = "Dolor") ["Dolor"] = "Dolor" + UBlockExpression [{...}] = Nothing + UReturnExpression [return Unit] = Nothing + USimpleNameReferenceExpression (identifier = Unit) [Unit] = external Unit() + UMethod (name = fooWithArrLiteral) [@RequiresPermission(anyOf = collectionLiteral[1, 2, 3])...}] + UAnnotation (fqName = RequiresPermission) [@RequiresPermission(anyOf = collectionLiteral[1, 2, 3])] + UNamedExpression (name = anyOf) [anyOf = collectionLiteral[1, 2, 3]] = Nothing + UCallExpression (kind = UastCallKind(name='array_initializer'), argCount = 3)) [collectionLiteral[1, 2, 3]] = external collectionLiteral[1, 2, 3](1, 2, 3) + UIdentifier (Identifier ([)) [UIdentifier (Identifier ([))] + ULiteralExpression (value = 1) [1] = 1 + ULiteralExpression (value = 2) [2] = 2 + ULiteralExpression (value = 3) [3] = 3 + UBlockExpression [{...}] = Nothing + UReturnExpression [return 5] = Nothing + ULiteralExpression (value = 5) [5] = 5 + UMethod (name = fooWithStrArrLiteral) [@RequiresStrPermission(strs = collectionLiteral["a", "b", "c"])...}] + UAnnotation (fqName = RequiresStrPermission) [@RequiresStrPermission(strs = collectionLiteral["a", "b", "c"])] + UNamedExpression (name = strs) [strs = collectionLiteral["a", "b", "c"]] = Nothing + UCallExpression (kind = UastCallKind(name='array_initializer'), argCount = 3)) [collectionLiteral["a", "b", "c"]] = external collectionLiteral["a", "b", "c"]("a", "b", "c") + UIdentifier (Identifier ([)) [UIdentifier (Identifier ([))] + ULiteralExpression (value = "a") ["a"] = "a" + ULiteralExpression (value = "b") ["b"] = "b" + ULiteralExpression (value = "c") ["c"] = "c" + UBlockExpression [{...}] = Nothing + UReturnExpression [return 3] = Nothing + ULiteralExpression (value = 3) [3] = 3 + UClass (name = IntRange) [public abstract annotation IntRange {...}] + UAnnotationMethod (name = from) [public abstract fun from() : long = UastEmptyExpression] + UAnnotationMethod (name = to) [public abstract fun to() : long = UastEmptyExpression] + UClass (name = RequiresPermission) [public abstract annotation RequiresPermission {...}] + UAnnotationMethod (name = anyOf) [public abstract fun anyOf() : int[] = UastEmptyExpression] + UClass (name = RequiresStrPermission) [public abstract annotation RequiresStrPermission {...}] + UAnnotationMethod (name = strs) [public abstract fun strs() : java.lang.String[] = UastEmptyExpression] + UClass (name = WithDefaultValue) [public abstract annotation WithDefaultValue {...}] + UAnnotationMethod (name = value) [public abstract fun value() : int = UastEmptyExpression] + ULiteralExpression (value = 42) [42] = 42 + UClass (name = SuppressLint) [public abstract annotation SuppressLint {...}] + UAnnotationMethod (name = value) [public abstract fun value() : java.lang.String[] = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/AnnotationParameters.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/AnnotationParameters.values.fir.txt new file mode 100644 index 00000000000..49ba7577e1c --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/AnnotationParameters.values.fir.txt @@ -0,0 +1,21 @@ +UFile (package = ) [public final class AnnotationParametersKt {...] + UClass (name = AnnotationParametersKt) [public final class AnnotationParametersKt {...}] + UMethod (name = foo) [public static final fun foo() : int = [!] UnknownKotlinExpression (INTEGER_CONSTANT)] + [!] UnknownKotlinExpression (INTEGER_CONSTANT) [[!] UnknownKotlinExpression (INTEGER_CONSTANT)] = Undetermined + UMethod (name = bar) [public static final fun bar() : void = [!] UnknownKotlinExpression (REFERENCE_EXPRESSION)] + [!] UnknownKotlinExpression (REFERENCE_EXPRESSION) [[!] UnknownKotlinExpression (REFERENCE_EXPRESSION)] = Undetermined + UMethod (name = fooWithArrLiteral) [public static final fun fooWithArrLiteral() : int = [!] UnknownKotlinExpression (INTEGER_CONSTANT)] + [!] UnknownKotlinExpression (INTEGER_CONSTANT) [[!] UnknownKotlinExpression (INTEGER_CONSTANT)] = Undetermined + UMethod (name = fooWithStrArrLiteral) [public static final fun fooWithStrArrLiteral() : int = [!] UnknownKotlinExpression (INTEGER_CONSTANT)] + [!] UnknownKotlinExpression (INTEGER_CONSTANT) [[!] UnknownKotlinExpression (INTEGER_CONSTANT)] = Undetermined + UClass (name = IntRange) [public abstract annotation IntRange {...}] + UMethod (name = from) [public abstract fun from() : long = UastEmptyExpression] + UMethod (name = to) [public abstract fun to() : long = UastEmptyExpression] + UClass (name = RequiresPermission) [public abstract annotation RequiresPermission {...}] + UMethod (name = anyOf) [public abstract fun anyOf() : int[] = UastEmptyExpression] + UClass (name = RequiresStrPermission) [public abstract annotation RequiresStrPermission {...}] + UMethod (name = strs) [public abstract fun strs() : java.lang.String[] = UastEmptyExpression] + UClass (name = WithDefaultValue) [public abstract annotation WithDefaultValue {...}] + UMethod (name = value) [public abstract fun value() : int = UastEmptyExpression] + UClass (name = SuppressLint) [public abstract annotation SuppressLint {...}] + UMethod (name = value) [public abstract fun value() : java.lang.String[] = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/Anonymous.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/Anonymous.values.fe10.txt new file mode 100644 index 00000000000..fb17ef51644 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/Anonymous.values.fe10.txt @@ -0,0 +1,65 @@ +UFile (package = ) [import java.io.Closeable...] + UImportStatement (isOnDemand = false) [import java.io.Closeable] + UImportStatement (isOnDemand = false) [import java.io.InputStream] + UClass (name = AnonymousKt) [public final class AnonymousKt {...}] + UMethod (name = foo) [public static final fun foo() : void {...}] + UBlockExpression [{...}] = Undetermined + UDeclarationsExpression [var runnable: = anonymous object : Runnable { override fun run() {} }] = Undetermined + ULocalVariable (name = runnable) [var runnable: = anonymous object : Runnable { override fun run() {} }] + UObjectLiteralExpression [anonymous object : Runnable { override fun run() {} }] = Undetermined + UClass (name = null) [final class null : java.lang.Runnable {...}] + UMethod (name = run) [public fun run() : void {...}] + UBlockExpression [{...}] = Undetermined + UMethod (name = ) [private fun () = UastEmptyExpression] + UQualifiedReferenceExpression [runnable.run()] = external run()() + USimpleNameReferenceExpression (identifier = runnable) [runnable] = (var runnable = Undetermined) + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [run()] = external run()() + UIdentifier (Identifier (run)) [UIdentifier (Identifier (run))] + USimpleNameReferenceExpression (identifier = run, resolvesTo = null) [run] = external run()() + UDeclarationsExpression [var runnable2: java.lang.Runnable = Runnable({ ...})] = Undetermined + ULocalVariable (name = runnable2) [var runnable2: java.lang.Runnable = Runnable({ ...})] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [Runnable({ ...})] = external Runnable({ + println() +})(Undetermined) + UIdentifier (Identifier (Runnable)) [UIdentifier (Identifier (Runnable))] + USimpleNameReferenceExpression (identifier = Runnable, resolvesTo = PsiClass: Runnable) [Runnable] = external Runnable({ + println() +})(Undetermined) + ULambdaExpression [{ ...}] = Undetermined + UBlockExpression [{...}] = external println()() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [println()] = external println()() + UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] + USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] = external println()() + UQualifiedReferenceExpression [runnable2.run()] = external run()() + USimpleNameReferenceExpression (identifier = runnable2) [runnable2] = (var runnable2 = external Runnable({ + println() +})(Undetermined)) + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [run()] = external run()() + UIdentifier (Identifier (run)) [UIdentifier (Identifier (run))] + USimpleNameReferenceExpression (identifier = run, resolvesTo = null) [run] = external run()() + UDeclarationsExpression [var closeableRunnable: = anonymous object : Runnable, Closeable { override fun close() {} override fun run() {} }] = Undetermined + ULocalVariable (name = closeableRunnable) [var closeableRunnable: = anonymous object : Runnable, Closeable { override fun close() {} override fun run() {} }] + UObjectLiteralExpression [anonymous object : Runnable, Closeable { override fun close() {} override fun run() {} }] = Undetermined + UClass (name = null) [final class null : java.lang.Runnable, java.io.Closeable {...}] + UMethod (name = close) [public fun close() : void {...}] + UBlockExpression [{...}] = Undetermined + UMethod (name = run) [public fun run() : void {...}] + UBlockExpression [{...}] = Undetermined + UMethod (name = ) [private fun () = UastEmptyExpression] + UDeclarationsExpression [var runnableIs: = anonymous object : InputStream(), Runnable { override fun read(): Int = 0; override fun run() {} }] = Undetermined + ULocalVariable (name = runnableIs) [var runnableIs: = anonymous object : InputStream(), Runnable { override fun read(): Int = 0; override fun run() {} }] + UObjectLiteralExpression [anonymous object : InputStream(), Runnable { override fun read(): Int = 0; override fun run() {} }] = Undetermined + UClass (name = null) [final class null : java.io.InputStream, java.lang.Runnable {...}] + UMethod (name = read) [public fun read() : int {...}] + UBlockExpression [{...}] = Nothing + UReturnExpression [return 0] = Nothing + ULiteralExpression (value = 0) [0] = 0 + UMethod (name = run) [public fun run() : void {...}] + UBlockExpression [{...}] = Undetermined + UMethod (name = ) [private fun () = UastEmptyExpression] + UMethod (name = withErr) [public static final fun withErr() : void {...}] + UBlockExpression [{...}] = Undetermined + UDeclarationsExpression [var runnable: = anonymous null] = Undetermined + ULocalVariable (name = runnable) [var runnable: = anonymous null] + UObjectLiteralExpression [anonymous null] = Undetermined + UClass (name = ) [class {...}] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/Anonymous.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/Anonymous.values.fir.txt new file mode 100644 index 00000000000..9eac2f0f21d --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/Anonymous.values.fir.txt @@ -0,0 +1,8 @@ +UFile (package = ) [import java.io.Closeable...] + UImportStatement (isOnDemand = false) [import java.io.Closeable] + UImportStatement (isOnDemand = false) [import java.io.InputStream] + UClass (name = AnonymousKt) [public final class AnonymousKt {...}] + UMethod (name = foo) [public static final fun foo() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = withErr) [public static final fun withErr() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/Assertion.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/Assertion.values.fe10.txt new file mode 100644 index 00000000000..db956afc60a --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/Assertion.values.fe10.txt @@ -0,0 +1,10 @@ +UFile (package = ) [public final class AssertionKt {...] + UClass (name = AssertionKt) [public final class AssertionKt {...}] + UMethod (name = foo) [public static final fun foo() : java.lang.String {...}] + UBlockExpression [{...}] = Nothing + UDeclarationsExpression [var s: java.lang.String = "Not Null"] = Undetermined + ULocalVariable (name = s) [var s: java.lang.String = "Not Null"] + ULiteralExpression (value = "Not Null") ["Not Null"] = "Not Null" + UReturnExpression [return s!!] = Nothing + UPostfixExpression (operator = !!) [s!!] = (var s = "Not Null") + USimpleNameReferenceExpression (identifier = s) [s] = (var s = "Not Null") diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/Assertion.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/Assertion.values.fir.txt new file mode 100644 index 00000000000..f701c87556c --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/Assertion.values.fir.txt @@ -0,0 +1,4 @@ +UFile (package = ) [public final class AssertionKt {...] + UClass (name = AssertionKt) [public final class AssertionKt {...}] + UMethod (name = foo) [public static final fun foo() : java.lang.String = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/Bitwise.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/Bitwise.values.fir.txt new file mode 100644 index 00000000000..8975810fd09 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/Bitwise.values.fir.txt @@ -0,0 +1,6 @@ +UFile (package = ) [public final class BitwiseKt {...] + UClass (name = BitwiseKt) [public final class BitwiseKt {...}] + UMethod (name = foo) [public static final fun foo() : int = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = bar) [public static final fun bar() : long = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/BrokenMethod.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/BrokenMethod.values.fe10.txt new file mode 100644 index 00000000000..fab05528485 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/BrokenMethod.values.fe10.txt @@ -0,0 +1,52 @@ +UFile (package = ) [public final class BrokenMethodKt {...] + UClass (name = BrokenMethodKt) [public final class BrokenMethodKt {...}] + UMethod (name = main) [public static final fun main(@org.jetbrains.annotations.NotNull args: java.lang.String[]) : void {...}] + UParameter (name = args) [@org.jetbrains.annotations.NotNull var args: java.lang.String[]] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Undetermined + UDeclarationsExpression [public static final class TestUsed {...}] = Undetermined + UClass (name = TestUsed) [public static final class TestUsed {...}] + UField (name = parameter) [@org.jetbrains.annotations.NotNull private final var parameter: java.lang.CharSequence] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UMethod (name = getParameter) [public final fun getParameter() : java.lang.CharSequence = UastEmptyExpression] + UMethod (name = TestUsed) [public fun TestUsed(@org.jetbrains.annotations.NotNull parameter: java.lang.CharSequence) = UastEmptyExpression] + UParameter (name = parameter) [@org.jetbrains.annotations.NotNull var parameter: java.lang.CharSequence] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UMethod (name = component1) [public final fun component1() : java.lang.CharSequence = UastEmptyExpression] + UMethod (name = copy) [public final fun copy(@org.jetbrains.annotations.NotNull parameter: java.lang.CharSequence) : TestUsed = UastEmptyExpression] + UParameter (name = parameter) [@org.jetbrains.annotations.NotNull var parameter: java.lang.CharSequence] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UMethod (name = toString) [public fun toString() : java.lang.String = UastEmptyExpression] + UMethod (name = hashCode) [public fun hashCode() : int = UastEmptyExpression] + UMethod (name = equals) [public fun equals(@org.jetbrains.annotations.Nullable other: java.lang.Object) : boolean = UastEmptyExpression] + UParameter (name = other) [@org.jetbrains.annotations.Nullable var other: java.lang.Object] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] + UClass (name = Used) [private static final class Used {...}] + UField (name = Companion) [@null public static final var Companion: Companion] + UAnnotation (fqName = null) [@null] + UField (name = parameter) [@org.jetbrains.annotations.NotNull private final var parameter: java.lang.Object] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UMethod (name = getParameter) [public final fun getParameter() : java.lang.Object = UastEmptyExpression] + UMethod (name = Used) [public fun Used(@org.jetbrains.annotations.NotNull parameter: java.lang.Object) = UastEmptyExpression] + UParameter (name = parameter) [@org.jetbrains.annotations.NotNull var parameter: java.lang.Object] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UMethod (name = component1) [public final fun component1() : java.lang.Object = UastEmptyExpression] + UMethod (name = copy) [public final fun copy(@org.jetbrains.annotations.NotNull parameter: java.lang.Object) : Used = UastEmptyExpression] + UParameter (name = parameter) [@org.jetbrains.annotations.NotNull var parameter: java.lang.Object] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UMethod (name = toString) [public fun toString() : java.lang.String = UastEmptyExpression] + UMethod (name = hashCode) [public fun hashCode() : int = UastEmptyExpression] + UMethod (name = equals) [public fun equals(@org.jetbrains.annotations.Nullable other: java.lang.Object) : boolean = UastEmptyExpression] + UParameter (name = other) [@org.jetbrains.annotations.Nullable var other: java.lang.Object] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] + UClass (name = Companion) [public static final class Companion {...}] + UMethod (name = doStuff1) [public final fun doStuff1(@org.jetbrains.annotations.NotNull $this$doStuff1: java.lang.Object) : Used {...}] + UParameter (name = $this$doStuff1) [@org.jetbrains.annotations.NotNull var $this$doStuff1: java.lang.Object] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UReturnExpression [return (this)] = Nothing + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [(this)] = external (this)(Undetermined) + UIdentifier (Identifier (Used)) [UIdentifier (Identifier (Used))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Used) [] = external (this)(Undetermined) + UThisExpression (label = null) [this] = Undetermined + UMethod (name = Companion) [private fun Companion() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/BrokenMethod.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/BrokenMethod.values.fir.txt new file mode 100644 index 00000000000..7260aa6a7b4 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/BrokenMethod.values.fir.txt @@ -0,0 +1,5 @@ +UFile (package = ) [public final class BrokenMethodKt {...] + UClass (name = BrokenMethodKt) [public final class BrokenMethodKt {...}] + UMethod (name = main) [public static final fun main(args: java.lang.String[]) : void = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = args) [var args: java.lang.String[]] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/ClassAnnotation.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/ClassAnnotation.values.fe10.txt new file mode 100644 index 00000000000..0d20a40a0c8 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/ClassAnnotation.values.fe10.txt @@ -0,0 +1,30 @@ +UFile (package = ) [public final class A {...] + UClass (name = A) [public final class A {...}] + UAnnotation (fqName = null) [@null] + UMethod (name = A) [public fun A() = UastEmptyExpression] + UClass (name = MyAnnotation) [public abstract annotation MyAnnotation {...}] + UAnnotationMethod (name = text) [public abstract fun text() : java.lang.String = UastEmptyExpression] + UClass (name = B) [public final class B {...}] + UAnnotation (fqName = MyAnnotation) [@MyAnnotation(text = "class")] + UNamedExpression (name = text) [text = "class"] = Undetermined + ULiteralExpression (value = "class") ["class"] = Undetermined + UField (name = Companion) [@null public static final var Companion: B.Companion] + UAnnotation (fqName = null) [@null] + UMethod (name = B) [public fun B() = UastEmptyExpression] + UClass (name = InB) [public static final class InB {...}] + UAnnotation (fqName = MyAnnotation) [@MyAnnotation(text = "inB class")] + UNamedExpression (name = text) [text = "inB class"] = Undetermined + ULiteralExpression (value = "inB class") ["inB class"] = Undetermined + UMethod (name = InB) [public fun InB() = UastEmptyExpression] + UClass (name = Companion) [public static final class Companion {...}] + UAnnotation (fqName = MyAnnotation) [@MyAnnotation(text = "companion")] + UNamedExpression (name = text) [text = "companion"] = Undetermined + ULiteralExpression (value = "companion") ["companion"] = Undetermined + UMethod (name = Companion) [private fun Companion() = UastEmptyExpression] + UClass (name = Obj) [public final class Obj {...}] + UAnnotation (fqName = MyAnnotation) [@MyAnnotation(text = "object")] + UNamedExpression (name = text) [text = "object"] = Undetermined + ULiteralExpression (value = "object") ["object"] = Undetermined + UField (name = INSTANCE) [@null public static final var INSTANCE: Obj] + UAnnotation (fqName = null) [@null] + UMethod (name = Obj) [private fun Obj() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/ClassAnnotation.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/ClassAnnotation.values.fir.txt new file mode 100644 index 00000000000..5f116a7ec08 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/ClassAnnotation.values.fir.txt @@ -0,0 +1,15 @@ +UFile (package = ) [public final class A {...] + UClass (name = A) [public final class A {...}] + UMethod (name = A) [public fun A() = UastEmptyExpression] + UClass (name = MyAnnotation) [public abstract annotation MyAnnotation {...}] + UMethod (name = text) [public abstract fun text() : java.lang.String = UastEmptyExpression] + UClass (name = B) [public final class B {...}] + UField (name = Companion) [public static final var Companion: B.Companion] + UMethod (name = B) [public fun B() = UastEmptyExpression] + UClass (name = InB) [public static final class InB {...}] + UMethod (name = InB) [public fun InB() = UastEmptyExpression] + UClass (name = Companion) [public static final class Companion {...}] + UMethod (name = Companion) [private fun Companion() = UastEmptyExpression] + UClass (name = Obj) [public final class Obj {...}] + UField (name = INSTANCE) [public static final var INSTANCE: Obj] + UMethod (name = Obj) [private fun Obj() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/ConstructorDelegate.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/ConstructorDelegate.values.fe10.txt new file mode 100644 index 00000000000..0ab1b8f088d --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/ConstructorDelegate.values.fe10.txt @@ -0,0 +1,39 @@ +UFile (package = ) [public final class ConstructorDelegateKt {...] + UClass (name = ConstructorDelegateKt) [public final class ConstructorDelegateKt {...}] + UMethod (name = createBase) [public static final fun createBase(@org.jetbrains.annotations.NotNull i: int) : Base {...}] + UParameter (name = i) [@org.jetbrains.annotations.NotNull var i: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UReturnExpression [return (i)] = Nothing + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [(i)] = external (i)(Undetermined) + UIdentifier (Identifier (BaseImpl)) [UIdentifier (Identifier (BaseImpl))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: BaseImpl) [] = external (i)(Undetermined) + USimpleNameReferenceExpression (identifier = i) [i] = Undetermined + UClass (name = Base) [public abstract interface Base {...}] + UMethod (name = print) [public abstract fun print() : void = UastEmptyExpression] + UClass (name = BaseImpl) [public final class BaseImpl : Base {...}] + UField (name = x) [@org.jetbrains.annotations.NotNull private final var x: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UMethod (name = print) [public fun print() : void {...}] + UBlockExpression [{...}] = external print(x)(Undetermined) + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [print(x)] = external print(x)(Undetermined) + UIdentifier (Identifier (print)) [UIdentifier (Identifier (print))] + USimpleNameReferenceExpression (identifier = print, resolvesTo = null) [print] = external print(x)(Undetermined) + USimpleNameReferenceExpression (identifier = x) [x] = Undetermined + UMethod (name = getX) [public final fun getX() : int = UastEmptyExpression] + UMethod (name = BaseImpl) [public fun BaseImpl(@org.jetbrains.annotations.NotNull x: int) = UastEmptyExpression] + UParameter (name = x) [@org.jetbrains.annotations.NotNull var x: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UClass (name = Derived) [public final class Derived : Base, java.lang.CharSequence {...}] + UExpressionList (super_delegation) [super_delegation Base : createBase(10)] = Undetermined + UTypeReferenceExpression (name = Base) [Base] = Undetermined + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [createBase(10)] = Undetermined + UIdentifier (Identifier (createBase)) [UIdentifier (Identifier (createBase))] + USimpleNameReferenceExpression (identifier = createBase, resolvesTo = null) [createBase] = Undetermined + ULiteralExpression (value = 10) [10] = Undetermined + UExpressionList (super_delegation) [super_delegation java.lang.CharSequence : "abc"] = Undetermined + UTypeReferenceExpression (name = java.lang.CharSequence) [java.lang.CharSequence] = Undetermined + ULiteralExpression (value = "abc") ["abc"] = Undetermined + UMethod (name = Derived) [public fun Derived(@org.jetbrains.annotations.NotNull b: Base) = UastEmptyExpression] + UParameter (name = b) [@org.jetbrains.annotations.NotNull var b: Base] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/ConstructorDelegate.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/ConstructorDelegate.values.fir.txt new file mode 100644 index 00000000000..9242fa2b166 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/ConstructorDelegate.values.fir.txt @@ -0,0 +1,17 @@ +UFile (package = ) [public final class ConstructorDelegateKt {...] + UClass (name = ConstructorDelegateKt) [public final class ConstructorDelegateKt {...}] + UMethod (name = createBase) [public static final fun createBase(i: int) : Base = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = i) [var i: int] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UClass (name = Base) [public abstract interface Base {...}] + UMethod (name = print) [public abstract fun print() : void = UastEmptyExpression] + UClass (name = BaseImpl) [public final class BaseImpl : null {...}] + UField (name = x) [private final var x: int] + UMethod (name = BaseImpl) [public fun BaseImpl(x: int) = UastEmptyExpression] + UParameter (name = x) [var x: int] + UMethod (name = getX) [public final fun getX() : int = UastEmptyExpression] + UMethod (name = print) [public fun print() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UClass (name = Derived) [public final class Derived : null, null {...}] + UMethod (name = Derived) [public fun Derived(b: Base) = UastEmptyExpression] + UParameter (name = b) [var b: Base] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/Constructors.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/Constructors.values.fe10.txt new file mode 100644 index 00000000000..ff6aca76783 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/Constructors.values.fe10.txt @@ -0,0 +1,177 @@ +UFile (package = ) [public final class A {...] + UClass (name = A) [public final class A {...}] + UField (name = str) [@org.jetbrains.annotations.NotNull private final var str: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UMethod (name = getStr) [public final fun getStr() : java.lang.String = UastEmptyExpression] + UMethod (name = A) [public fun A(@org.jetbrains.annotations.NotNull str: java.lang.String) = UastEmptyExpression] + UParameter (name = str) [@org.jetbrains.annotations.NotNull var str: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UMethod (name = A) [public fun A(@org.jetbrains.annotations.NotNull i: int) {...}] + UParameter (name = i) [@org.jetbrains.annotations.NotNull var i: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = external (i.toString())(external toString()()) + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [(i.toString())] = external (i.toString())(external toString()()) + UIdentifier (Identifier (this)) [UIdentifier (Identifier (this))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) [] = external (i.toString())(external toString()()) + UQualifiedReferenceExpression [i.toString()] = external toString()() + USimpleNameReferenceExpression (identifier = i) [i] = Undetermined + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [toString()] = external toString()() + UIdentifier (Identifier (toString)) [UIdentifier (Identifier (toString))] + USimpleNameReferenceExpression (identifier = toString, resolvesTo = null) [toString] = external toString()() + UClass (name = AWithInit) [public final class AWithInit {...}] + UField (name = str) [@org.jetbrains.annotations.NotNull private final var str: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UMethod (name = getStr) [public final fun getStr() : java.lang.String = UastEmptyExpression] + UMethod (name = AWithInit) [public fun AWithInit(@org.jetbrains.annotations.NotNull str: java.lang.String) {...}] + UParameter (name = str) [@org.jetbrains.annotations.NotNull var str: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = external println()() + UBlockExpression [{...}] = external println()() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [println()] = external println()() + UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] + USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] = external println()() + UMethod (name = AWithInit) [public fun AWithInit(@org.jetbrains.annotations.NotNull i: int) {...}] + UParameter (name = i) [@org.jetbrains.annotations.NotNull var i: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = external (i.toString())(external toString()()) + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [(i.toString())] = external (i.toString())(external toString()()) + UIdentifier (Identifier (this)) [UIdentifier (Identifier (this))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: AWithInit) [] = external (i.toString())(external toString()()) + UQualifiedReferenceExpression [i.toString()] = external toString()() + USimpleNameReferenceExpression (identifier = i) [i] = Undetermined + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [toString()] = external toString()() + UIdentifier (Identifier (toString)) [UIdentifier (Identifier (toString))] + USimpleNameReferenceExpression (identifier = toString, resolvesTo = null) [toString] = external toString()() + UClass (name = AWith2Init) [public final class AWith2Init {...}] + UField (name = str) [@org.jetbrains.annotations.NotNull private final var str: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UMethod (name = getStr) [public final fun getStr() : java.lang.String = UastEmptyExpression] + UMethod (name = AWith2Init) [public fun AWith2Init(@org.jetbrains.annotations.NotNull str: java.lang.String) {...}] + UParameter (name = str) [@org.jetbrains.annotations.NotNull var str: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = external println(2)(2) + UBlockExpression [{...}] = external println(1)(1) + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [println(1)] = external println(1)(1) + UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] + USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] = external println(1)(1) + ULiteralExpression (value = 1) [1] = 1 + UBlockExpression [{...}] = external println(2)(2) + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [println(2)] = external println(2)(2) + UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] + USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] = external println(2)(2) + ULiteralExpression (value = 2) [2] = 2 + UMethod (name = AWith2Init) [public fun AWith2Init(@org.jetbrains.annotations.NotNull i: int) {...}] + UParameter (name = i) [@org.jetbrains.annotations.NotNull var i: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = external (i.toString())(external toString()()) + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [(i.toString())] = external (i.toString())(external toString()()) + UIdentifier (Identifier (this)) [UIdentifier (Identifier (this))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: AWith2Init) [] = external (i.toString())(external toString()()) + UQualifiedReferenceExpression [i.toString()] = external toString()() + USimpleNameReferenceExpression (identifier = i) [i] = Undetermined + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [toString()] = external toString()() + UIdentifier (Identifier (toString)) [UIdentifier (Identifier (toString))] + USimpleNameReferenceExpression (identifier = toString, resolvesTo = null) [toString] = external toString()() + UClass (name = AOnlyInit) [public final class AOnlyInit {...}] + UMethod (name = AOnlyInit) [public fun AOnlyInit() {...}] + UBlockExpression [{...}] = external println(2)(2) + UBlockExpression [{...}] = external println(1)(1) + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [println(1)] = external println(1)(1) + UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] + USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] = external println(1)(1) + ULiteralExpression (value = 1) [1] = 1 + UBlockExpression [{...}] = external println(2)(2) + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [println(2)] = external println(2)(2) + UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] + USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] = external println(2)(2) + ULiteralExpression (value = 2) [2] = 2 + UClass (name = AWithSecondary) [public final class AWithSecondary {...}] + UField (name = a) [@org.jetbrains.annotations.NotNull public var a: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UMethod (name = getA) [public final fun getA() : java.lang.String = UastEmptyExpression] + UMethod (name = setA) [public final fun setA(@org.jetbrains.annotations.NotNull a: java.lang.String) : void = UastEmptyExpression] + UParameter (name = a) [@org.jetbrains.annotations.NotNull var a: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UMethod (name = AWithSecondary) [public fun AWithSecondary(@org.jetbrains.annotations.NotNull i: int) {...}] + UParameter (name = i) [@org.jetbrains.annotations.NotNull var i: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Undetermined + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] = external ()() + UIdentifier (Identifier ()) [UIdentifier (Identifier ())] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Object) [] = external ()() + UBinaryExpression (operator = =) [a = i.toString()] = Undetermined + USimpleNameReferenceExpression (identifier = a) [a] = external a() + UQualifiedReferenceExpression [i.toString()] = external toString()() + USimpleNameReferenceExpression (identifier = i) [i] = Undetermined + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [toString()] = external toString()() + UIdentifier (Identifier (toString)) [UIdentifier (Identifier (toString))] + USimpleNameReferenceExpression (identifier = toString, resolvesTo = null) [toString] = external toString()() + UMethod (name = AWithSecondary) [public fun AWithSecondary(@org.jetbrains.annotations.NotNull s: java.lang.String) {...}] + UParameter (name = s) [@org.jetbrains.annotations.NotNull var s: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Undetermined + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] = external ()() + UIdentifier (Identifier ()) [UIdentifier (Identifier ())] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Object) [] = external ()() + UBinaryExpression (operator = =) [a = s] = Undetermined + USimpleNameReferenceExpression (identifier = a) [a] = external a() + USimpleNameReferenceExpression (identifier = s) [s] = Undetermined + UClass (name = AWithSecondaryInit) [public final class AWithSecondaryInit {...}] + UField (name = a) [@org.jetbrains.annotations.NotNull public var a: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UMethod (name = getA) [public final fun getA() : java.lang.String = UastEmptyExpression] + UMethod (name = setA) [public final fun setA(@org.jetbrains.annotations.NotNull a: java.lang.String) : void = UastEmptyExpression] + UParameter (name = a) [@org.jetbrains.annotations.NotNull var a: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UMethod (name = AWithSecondaryInit) [public fun AWithSecondaryInit(@org.jetbrains.annotations.NotNull i: int) {...}] + UParameter (name = i) [@org.jetbrains.annotations.NotNull var i: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Undetermined + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] = external ()() + UIdentifier (Identifier ()) [UIdentifier (Identifier ())] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Object) [] = external ()() + UBlockExpression [{...}] = external println()() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [println()] = external println()() + UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] + USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] = external println()() + UBinaryExpression (operator = =) [a = i.toString()] = Undetermined + USimpleNameReferenceExpression (identifier = a) [a] = external a() + UQualifiedReferenceExpression [i.toString()] = external toString()() + USimpleNameReferenceExpression (identifier = i) [i] = Undetermined + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [toString()] = external toString()() + UIdentifier (Identifier (toString)) [UIdentifier (Identifier (toString))] + USimpleNameReferenceExpression (identifier = toString, resolvesTo = null) [toString] = external toString()() + UMethod (name = AWithSecondaryInit) [public fun AWithSecondaryInit(@org.jetbrains.annotations.NotNull s: java.lang.String) {...}] + UParameter (name = s) [@org.jetbrains.annotations.NotNull var s: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = external toString()() + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] = external ()() + UIdentifier (Identifier ()) [UIdentifier (Identifier ())] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Object) [] = external ()() + UBinaryExpression (operator = =) [a = s] = Undetermined + USimpleNameReferenceExpression (identifier = a) [a] = external a() + USimpleNameReferenceExpression (identifier = s) [s] = Undetermined + UDeclarationsExpression [var local: java.lang.String = s] = Undetermined + ULocalVariable (name = local) [var local: java.lang.String = s] + USimpleNameReferenceExpression (identifier = s) [s] = Undetermined + UQualifiedReferenceExpression [local.toString()] = external toString()() + USimpleNameReferenceExpression (identifier = local) [local] = (var local = Undetermined) + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [toString()] = external toString()() + UIdentifier (Identifier (toString)) [UIdentifier (Identifier (toString))] + USimpleNameReferenceExpression (identifier = toString, resolvesTo = null) [toString] = external toString()() + UClass (name = AWithFieldInit) [public final class AWithFieldInit {...}] + UField (name = a) [@org.jetbrains.annotations.NotNull private final var a: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UMethod (name = getA) [public final fun getA() : java.lang.String = UastEmptyExpression] + UMethod (name = AWithFieldInit) [public fun AWithFieldInit(@org.jetbrains.annotations.NotNull i: int) {...}] + UParameter (name = i) [@org.jetbrains.annotations.NotNull var i: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = external toString()() + UBlockExpression [{...}] = external toString()() + UBinaryExpression (operator = =) [a = i.toString()] = external toString()() + USimpleNameReferenceExpression (identifier = a) [a] = Undetermined + UQualifiedReferenceExpression [i.toString()] = external toString()() + USimpleNameReferenceExpression (identifier = i) [i] = Undetermined + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [toString()] = external toString()() + UIdentifier (Identifier (toString)) [UIdentifier (Identifier (toString))] + USimpleNameReferenceExpression (identifier = toString, resolvesTo = null) [toString] = external toString()() diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/Constructors.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/Constructors.values.fir.txt new file mode 100644 index 00000000000..9a1b9f7a239 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/Constructors.values.fir.txt @@ -0,0 +1,51 @@ +UFile (package = ) [public final class A {...] + UClass (name = A) [public final class A {...}] + UField (name = str) [private final var str: java.lang.String] + UMethod (name = A) [public fun A(str: java.lang.String) = UastEmptyExpression] + UParameter (name = str) [var str: java.lang.String] + UMethod (name = A) [public fun A(i: int) = UastEmptyExpression] + UParameter (name = i) [var i: int] + UMethod (name = getStr) [public final fun getStr() : java.lang.String = UastEmptyExpression] + UClass (name = AWithInit) [public final class AWithInit {...}] + UField (name = str) [private final var str: java.lang.String] + UMethod (name = AWithInit) [public fun AWithInit(str: java.lang.String) = UastEmptyExpression] + UParameter (name = str) [var str: java.lang.String] + UMethod (name = AWithInit) [public fun AWithInit(i: int) = UastEmptyExpression] + UParameter (name = i) [var i: int] + UMethod (name = getStr) [public final fun getStr() : java.lang.String = UastEmptyExpression] + UClass (name = AWith2Init) [public final class AWith2Init {...}] + UField (name = str) [private final var str: java.lang.String] + UMethod (name = AWith2Init) [public fun AWith2Init(str: java.lang.String) = UastEmptyExpression] + UParameter (name = str) [var str: java.lang.String] + UMethod (name = AWith2Init) [public fun AWith2Init(i: int) = UastEmptyExpression] + UParameter (name = i) [var i: int] + UMethod (name = getStr) [public final fun getStr() : java.lang.String = UastEmptyExpression] + UClass (name = AOnlyInit) [public final class AOnlyInit {...}] + UMethod (name = AOnlyInit) [public fun AOnlyInit() = UastEmptyExpression] + UClass (name = AWithSecondary) [public final class AWithSecondary {...}] + UField (name = a) [private var a: java.lang.String] + UMethod (name = AWithSecondary) [public fun AWithSecondary(i: int) = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = i) [var i: int] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = AWithSecondary) [public fun AWithSecondary(s: java.lang.String) = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = s) [var s: java.lang.String] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = getA) [public final fun getA() : java.lang.String = UastEmptyExpression] + UMethod (name = setA) [public final fun setA(value: java.lang.String) : void = UastEmptyExpression] + UParameter (name = value) [var value: java.lang.String] + UClass (name = AWithSecondaryInit) [public final class AWithSecondaryInit {...}] + UField (name = a) [private var a: java.lang.String] + UMethod (name = AWithSecondaryInit) [public fun AWithSecondaryInit(i: int) = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = i) [var i: int] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = AWithSecondaryInit) [public fun AWithSecondaryInit(s: java.lang.String) = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = s) [var s: java.lang.String] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = getA) [public final fun getA() : java.lang.String = UastEmptyExpression] + UMethod (name = setA) [public final fun setA(value: java.lang.String) : void = UastEmptyExpression] + UParameter (name = value) [var value: java.lang.String] + UClass (name = AWithFieldInit) [public final class AWithFieldInit {...}] + UField (name = a) [private final var a: java.lang.String] + UMethod (name = AWithFieldInit) [public fun AWithFieldInit(i: int) = UastEmptyExpression] + UParameter (name = i) [var i: int] + UMethod (name = getA) [public final fun getA() : java.lang.String = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/CycleInTypeParameters.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/CycleInTypeParameters.values.fe10.txt new file mode 100644 index 00000000000..8f7c2923552 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/CycleInTypeParameters.values.fe10.txt @@ -0,0 +1,10 @@ +UFile (package = ) [public final class CycleInTypeParametersKt {...] + UClass (name = CycleInTypeParametersKt) [public final class CycleInTypeParametersKt {...}] + UField (name = a) [@org.jetbrains.annotations.Nullable private static final var a: Device = null as? Device] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] + UBinaryExpressionWithType [null as? Device] = Undetermined + ULiteralExpression (value = null) [null] = null + UTypeReferenceExpression (name = Device) [Device] = Undetermined + UMethod (name = getA) [public static final fun getA() : Device = UastEmptyExpression] + UClass (name = Device) [public final class Device {...}] + UMethod (name = Device) [public fun Device() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/CycleInTypeParameters.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/CycleInTypeParameters.values.fir.txt new file mode 100644 index 00000000000..e453579ded9 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/CycleInTypeParameters.values.fir.txt @@ -0,0 +1,7 @@ +UFile (package = ) [public final class CycleInTypeParametersKt {...] + UClass (name = CycleInTypeParametersKt) [public final class CycleInTypeParametersKt {...}] + UField (name = a) [private static final var a: Device = [!] UnknownKotlinExpression (BINARY_WITH_TYPE)] + [!] UnknownKotlinExpression (BINARY_WITH_TYPE) [[!] UnknownKotlinExpression (BINARY_WITH_TYPE)] = Undetermined + UMethod (name = getA) [public static final fun getA() : Device = UastEmptyExpression] + UClass (name = Device) [public final class Device {...}] + UMethod (name = Device) [public fun Device() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/DefaultImpls.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/DefaultImpls.values.fe10.txt new file mode 100644 index 00000000000..321d3d8537c --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/DefaultImpls.values.fe10.txt @@ -0,0 +1,8 @@ +UFile (package = ) [public abstract interface Foo {...] + UClass (name = Foo) [public abstract interface Foo {...}] + UMethod (name = bar) [public default fun bar() : java.lang.String {...}] + UBlockExpression [{...}] = Nothing + UReturnExpression [return "Hello!"] = Nothing + ULiteralExpression (value = "Hello!") ["Hello!"] = "Hello!" + UClass (name = Baz) [public final class Baz : Foo {...}] + UMethod (name = Baz) [public fun Baz() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/DefaultImpls.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/DefaultImpls.values.fir.txt new file mode 100644 index 00000000000..084b1ba7de6 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/DefaultImpls.values.fir.txt @@ -0,0 +1,6 @@ +UFile (package = ) [public abstract interface Foo {...] + UClass (name = Foo) [public abstract interface Foo {...}] + UMethod (name = bar) [public fun bar() : java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] = Undetermined + UClass (name = Baz) [public final class Baz : null {...}] + UMethod (name = Baz) [public fun Baz() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/DefaultParameterValues.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/DefaultParameterValues.values.fe10.txt new file mode 100644 index 00000000000..6c388be1314 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/DefaultParameterValues.values.fe10.txt @@ -0,0 +1,10 @@ +UFile (package = ) [public final class DefaultParameterValuesKt {...] + UClass (name = DefaultParameterValuesKt) [public final class DefaultParameterValuesKt {...}] + UMethod (name = foo) [public static final fun foo(@org.jetbrains.annotations.NotNull a: int, @org.jetbrains.annotations.Nullable foo: java.lang.String) : void {...}] + UParameter (name = a) [@org.jetbrains.annotations.NotNull var a: int = 1] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + ULiteralExpression (value = 1) [1] = 1 + UParameter (name = foo) [@org.jetbrains.annotations.Nullable var foo: java.lang.String = null] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] + ULiteralExpression (value = null) [null] = null + UBlockExpression [{...}] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/DefaultParameterValues.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/DefaultParameterValues.values.fir.txt new file mode 100644 index 00000000000..a0e14450a09 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/DefaultParameterValues.values.fir.txt @@ -0,0 +1,8 @@ +UFile (package = ) [public final class DefaultParameterValuesKt {...] + UClass (name = DefaultParameterValuesKt) [public final class DefaultParameterValuesKt {...}] + UMethod (name = foo) [public static final fun foo(a: int, foo: java.lang.String) : void = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = a) [var a: int = [!] UnknownKotlinExpression (INTEGER_CONSTANT)] + [!] UnknownKotlinExpression (INTEGER_CONSTANT) [[!] UnknownKotlinExpression (INTEGER_CONSTANT)] = Undetermined + UParameter (name = foo) [var foo: java.lang.String = [!] UnknownKotlinExpression (NULL)] + [!] UnknownKotlinExpression (NULL) [[!] UnknownKotlinExpression (NULL)] = Undetermined + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/Delegate.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/Delegate.values.fe10.txt new file mode 100644 index 00000000000..1e2d5bdd844 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/Delegate.values.fe10.txt @@ -0,0 +1,67 @@ +UFile (package = ) [public final class MyColor {...] + UClass (name = MyColor) [public final class MyColor {...}] + UField (name = x) [@org.jetbrains.annotations.NotNull private final var x: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UField (name = y) [@org.jetbrains.annotations.NotNull private final var y: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UField (name = z) [@org.jetbrains.annotations.NotNull private final var z: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UMethod (name = getX) [public final fun getX() : int = UastEmptyExpression] + UMethod (name = getY) [public final fun getY() : int = UastEmptyExpression] + UMethod (name = getZ) [public final fun getZ() : int = UastEmptyExpression] + UMethod (name = MyColor) [public fun MyColor(@org.jetbrains.annotations.NotNull x: int, @org.jetbrains.annotations.NotNull y: int, @org.jetbrains.annotations.NotNull z: int) = UastEmptyExpression] + UParameter (name = x) [@org.jetbrains.annotations.NotNull var x: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = y) [@org.jetbrains.annotations.NotNull var y: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = z) [@org.jetbrains.annotations.NotNull var z: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UClass (name = Some) [public final class Some {...}] + UField (name = delegate$delegate) [@org.jetbrains.annotations.NotNull private final var delegate$delegate: kotlin.Lazy] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [lazy({ ...})] = external lazy({ + return (18, 2, 3) +})(Undetermined) + UIdentifier (Identifier (lazy)) [UIdentifier (Identifier (lazy))] + USimpleNameReferenceExpression (identifier = lazy, resolvesTo = null) [lazy] = external lazy({ + return (18, 2, 3) +})(Undetermined) + ULambdaExpression [{ ...}] = Undetermined + UBlockExpression [{...}] = Nothing + UReturnExpression [return (18, 2, 3)] = Nothing + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 3)) [(18, 2, 3)] = external (18, 2, 3)(18, 2, 3) + UIdentifier (Identifier (MyColor)) [UIdentifier (Identifier (MyColor))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: MyColor) [] = external (18, 2, 3)(18, 2, 3) + ULiteralExpression (value = 18) [18] = 18 + ULiteralExpression (value = 2) [2] = 2 + ULiteralExpression (value = 3) [3] = 3 + UField (name = lambda) [@org.jetbrains.annotations.NotNull private final var lambda: kotlin.Lazy = lazy({ ...})] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [lazy({ ...})] = external lazy({ + return (1, 2, 3) +})(Undetermined) + UIdentifier (Identifier (lazy)) [UIdentifier (Identifier (lazy))] + USimpleNameReferenceExpression (identifier = lazy, resolvesTo = null) [lazy] = external lazy({ + return (1, 2, 3) +})(Undetermined) + ULambdaExpression [{ ...}] = Undetermined + UBlockExpression [{...}] = Nothing + UReturnExpression [return (1, 2, 3)] = Nothing + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 3)) [(1, 2, 3)] = external (1, 2, 3)(1, 2, 3) + UIdentifier (Identifier (MyColor)) [UIdentifier (Identifier (MyColor))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: MyColor) [] = external (1, 2, 3)(1, 2, 3) + ULiteralExpression (value = 1) [1] = 1 + ULiteralExpression (value = 2) [2] = 2 + ULiteralExpression (value = 3) [3] = 3 + UField (name = nonLazy) [@org.jetbrains.annotations.NotNull private final var nonLazy: MyColor = (1, 2, 3)] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 3)) [(1, 2, 3)] = external (1, 2, 3)(1, 2, 3) + UIdentifier (Identifier (MyColor)) [UIdentifier (Identifier (MyColor))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: MyColor) [] = external (1, 2, 3)(1, 2, 3) + ULiteralExpression (value = 1) [1] = 1 + ULiteralExpression (value = 2) [2] = 2 + ULiteralExpression (value = 3) [3] = 3 + UMethod (name = getDelegate) [public final fun getDelegate() : MyColor = UastEmptyExpression] + UMethod (name = getLambda) [public final fun getLambda() : kotlin.Lazy = UastEmptyExpression] + UMethod (name = getNonLazy) [public final fun getNonLazy() : MyColor = UastEmptyExpression] + UMethod (name = Some) [public fun Some() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/Delegate.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/Delegate.values.fir.txt new file mode 100644 index 00000000000..f1517193eb4 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/Delegate.values.fir.txt @@ -0,0 +1,21 @@ +UFile (package = ) [public final class MyColor {...] + UClass (name = MyColor) [public final class MyColor {...}] + UField (name = x) [private final var x: int] + UField (name = y) [private final var y: int] + UField (name = z) [private final var z: int] + UMethod (name = MyColor) [public fun MyColor(x: int, y: int, z: int) = UastEmptyExpression] + UParameter (name = x) [var x: int] + UParameter (name = y) [var y: int] + UParameter (name = z) [var z: int] + UMethod (name = getX) [public final fun getX() : int = UastEmptyExpression] + UMethod (name = getY) [public final fun getY() : int = UastEmptyExpression] + UMethod (name = getZ) [public final fun getZ() : int = UastEmptyExpression] + UClass (name = Some) [public final class Some {...}] + UField (name = lambda) [private final var lambda: kotlin.Lazy = [!] UnknownKotlinExpression (CALL_EXPRESSION)] + [!] UnknownKotlinExpression (CALL_EXPRESSION) [[!] UnknownKotlinExpression (CALL_EXPRESSION)] = Undetermined + UField (name = nonLazy) [private final var nonLazy: MyColor = [!] UnknownKotlinExpression (CALL_EXPRESSION)] + [!] UnknownKotlinExpression (CALL_EXPRESSION) [[!] UnknownKotlinExpression (CALL_EXPRESSION)] = Undetermined + UMethod (name = Some) [public fun Some() = UastEmptyExpression] + UMethod (name = getDelegate) [public final fun getDelegate() : MyColor = UastEmptyExpression] + UMethod (name = getLambda) [public final fun getLambda() : kotlin.Lazy = UastEmptyExpression] + UMethod (name = getNonLazy) [public final fun getNonLazy() : MyColor = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/DeprecatedHidden.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/DeprecatedHidden.values.fe10.txt new file mode 100644 index 00000000000..7bd45543fdc --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/DeprecatedHidden.values.fe10.txt @@ -0,0 +1,14 @@ +UFile (package = test.pkg) [package test.pkg...] + UClass (name = Test) [public final class Test {...}] + UMethod (name = test1) [public final fun test1() : void {...}] + UBlockExpression [{...}] = Undetermined + UMethod (name = Test) [public fun Test() = UastEmptyExpression] + UMethod (name = test2) [@kotlin.Deprecated(level = DeprecationLevel.HIDDEN, message = "nothing")...}] + UAnnotation (fqName = kotlin.Deprecated) [@kotlin.Deprecated(level = DeprecationLevel.HIDDEN, message = "nothing")] + UNamedExpression (name = level) [level = DeprecationLevel.HIDDEN] = Undetermined + UQualifiedReferenceExpression [DeprecationLevel.HIDDEN] = external HIDDEN() + USimpleNameReferenceExpression (identifier = DeprecationLevel) [DeprecationLevel] = external DeprecationLevel() + USimpleNameReferenceExpression (identifier = HIDDEN) [HIDDEN] = external HIDDEN() + UNamedExpression (name = message) [message = "nothing"] = Undetermined + ULiteralExpression (value = "nothing") ["nothing"] = "nothing" + UBlockExpression [{...}] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/DeprecatedHidden.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/DeprecatedHidden.values.fir.txt new file mode 100644 index 00000000000..b3efb4e002e --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/DeprecatedHidden.values.fir.txt @@ -0,0 +1,5 @@ +UFile (package = test.pkg) [package test.pkg...] + UClass (name = Test) [public final class Test {...}] + UMethod (name = Test) [public fun Test() = UastEmptyExpression] + UMethod (name = test1) [public final fun test1() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/DestructuringDeclaration.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/DestructuringDeclaration.values.fe10.txt new file mode 100644 index 00000000000..6ad12a6509c --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/DestructuringDeclaration.values.fe10.txt @@ -0,0 +1,49 @@ +UFile (package = ) [public final class DestructuringDeclarationKt {...] + UClass (name = DestructuringDeclarationKt) [public final class DestructuringDeclarationKt {...}] + UMethod (name = foo) [public static final fun foo(@org.jetbrains.annotations.NotNull data: java.lang.Object) : void {...}] + UParameter (name = data) [@org.jetbrains.annotations.NotNull var data: java.lang.Object] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Undetermined + UDeclarationsExpression [@null var var268d41a5: = "foo" 1...@null var b: int = var268d41a5.()] = Undetermined + ULocalVariable (name = var268d41a5) [@null var var268d41a5: = "foo" 1] + UAnnotation (fqName = null) [@null] + UBinaryExpression (operator = ) ["foo" 1] = Undetermined + ULiteralExpression (value = "foo") ["foo"] = "foo" + ULiteralExpression (value = 1) [1] = 1 + ULocalVariable (name = a) [@null var a: java.lang.String = var268d41a5.()] + UAnnotation (fqName = null) [@null] + UQualifiedReferenceExpression [var268d41a5.()] = external ()() + USimpleNameReferenceExpression (identifier = var268d41a5) [var268d41a5] = external var268d41a5() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [()] = external ()() + UIdentifier (Identifier (component1)) [UIdentifier (Identifier (component1))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] = external ()() + ULocalVariable (name = b) [@null var b: int = var268d41a5.()] + UAnnotation (fqName = null) [@null] + UQualifiedReferenceExpression [var268d41a5.()] = external ()() + USimpleNameReferenceExpression (identifier = var268d41a5) [var268d41a5] = external var268d41a5() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [()] = external ()() + UIdentifier (Identifier (component2)) [UIdentifier (Identifier (component2))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] = external ()() + UDeclarationsExpression [@null @kotlin.Suppress(names = "UNCHECKED_CAST") var var465978a0: = data as kotlin.Pair...@null var v: java.lang.String = var465978a0.()] = Undetermined + ULocalVariable (name = var465978a0) [@null @kotlin.Suppress(names = "UNCHECKED_CAST") var var465978a0: = data as kotlin.Pair] + UAnnotation (fqName = null) [@null] + UAnnotation (fqName = kotlin.Suppress) [@kotlin.Suppress(names = "UNCHECKED_CAST")] + UNamedExpression (name = names) [names = "UNCHECKED_CAST"] = Undetermined + ULiteralExpression (value = "UNCHECKED_CAST") ["UNCHECKED_CAST"] = "UNCHECKED_CAST" + UBinaryExpressionWithType [data as kotlin.Pair] = Undetermined + USimpleNameReferenceExpression (identifier = data) [data] = Undetermined + UTypeReferenceExpression (name = kotlin.Pair) [kotlin.Pair] = Undetermined + ULocalVariable (name = k) [@null var k: java.lang.String = var465978a0.()] + UAnnotation (fqName = null) [@null] + UQualifiedReferenceExpression [var465978a0.()] = external ()() + USimpleNameReferenceExpression (identifier = var465978a0) [var465978a0] = external var465978a0() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [()] = external ()() + UIdentifier (Identifier (component1)) [UIdentifier (Identifier (component1))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] = external ()() + ULocalVariable (name = v) [@null var v: java.lang.String = var465978a0.()] + UAnnotation (fqName = null) [@null] + UQualifiedReferenceExpression [var465978a0.()] = external ()() + USimpleNameReferenceExpression (identifier = var465978a0) [var465978a0] = external var465978a0() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [()] = external ()() + UIdentifier (Identifier (component2)) [UIdentifier (Identifier (component2))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] = external ()() diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/DestructuringDeclaration.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/DestructuringDeclaration.values.fir.txt new file mode 100644 index 00000000000..488611db063 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/DestructuringDeclaration.values.fir.txt @@ -0,0 +1,5 @@ +UFile (package = ) [public final class DestructuringDeclarationKt {...] + UClass (name = DestructuringDeclarationKt) [public final class DestructuringDeclarationKt {...}] + UMethod (name = foo) [public static final fun foo(data: java.lang.Object) : void = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = data) [var data: java.lang.Object] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/Elvis.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/Elvis.values.fe10.txt new file mode 100644 index 00000000000..708e0756553 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/Elvis.values.fe10.txt @@ -0,0 +1,46 @@ +UFile (package = ) [public final class ElvisKt {...] + UClass (name = ElvisKt) [public final class ElvisKt {...}] + UMethod (name = foo) [public static final fun foo(@org.jetbrains.annotations.NotNull bar: java.lang.String) : java.lang.String {...}] + UParameter (name = bar) [@org.jetbrains.annotations.NotNull var bar: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UReturnExpression [return null] = Nothing + ULiteralExpression (value = null) [null] = null + UMethod (name = bar) [public static final fun bar() : int {...}] + UBlockExpression [{...}] = Nothing + UReturnExpression [return 42] = Nothing + ULiteralExpression (value = 42) [42] = 42 + UMethod (name = baz) [public static final fun baz() : java.lang.String {...}] + UBlockExpression [{...}] = Nothing + UReturnExpression [return elvis {...}] = Nothing + UExpressionList (elvis) [elvis {...}] = Undetermined + UDeclarationsExpression [var var243c51a0: java.lang.String = elvis {...}] = Undetermined + ULocalVariable (name = var243c51a0) [var var243c51a0: java.lang.String = elvis {...}] + UExpressionList (elvis) [elvis {...}] = Undetermined + UDeclarationsExpression [var varc4aef569: java.lang.String = foo("Lorem ipsum")] = Undetermined + ULocalVariable (name = varc4aef569) [var varc4aef569: java.lang.String = foo("Lorem ipsum")] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [foo("Lorem ipsum")] = external foo("Lorem ipsum")("Lorem ipsum") + UIdentifier (Identifier (foo)) [UIdentifier (Identifier (foo))] + USimpleNameReferenceExpression (identifier = foo, resolvesTo = null) [foo] = external foo("Lorem ipsum")("Lorem ipsum") + ULiteralExpression (value = "Lorem ipsum") ["Lorem ipsum"] = "Lorem ipsum" + UIfExpression [if (varc4aef569 != null) varc4aef569 else foo("dolor sit amet")] = Undetermined + UBinaryExpression (operator = !=) [varc4aef569 != null] = Undetermined + USimpleNameReferenceExpression (identifier = varc4aef569) [varc4aef569] = Undetermined + ULiteralExpression (value = null) [null] = null + USimpleNameReferenceExpression (identifier = varc4aef569) [varc4aef569] = Undetermined + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [foo("dolor sit amet")] = external foo("dolor sit amet")("dolor sit amet") + UIdentifier (Identifier (foo)) [UIdentifier (Identifier (foo))] + USimpleNameReferenceExpression (identifier = foo, resolvesTo = null) [foo] = external foo("dolor sit amet")("dolor sit amet") + ULiteralExpression (value = "dolor sit amet") ["dolor sit amet"] = "dolor sit amet" + UIfExpression [if (var243c51a0 != null) var243c51a0 else bar().toString()] = Undetermined + UBinaryExpression (operator = !=) [var243c51a0 != null] = Undetermined + USimpleNameReferenceExpression (identifier = var243c51a0) [var243c51a0] = Undetermined + ULiteralExpression (value = null) [null] = null + USimpleNameReferenceExpression (identifier = var243c51a0) [var243c51a0] = Undetermined + UQualifiedReferenceExpression [bar().toString()] = external toString()() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [bar()] = external bar()() + UIdentifier (Identifier (bar)) [UIdentifier (Identifier (bar))] + USimpleNameReferenceExpression (identifier = bar, resolvesTo = null) [bar] = external bar()() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [toString()] = external toString()() + UIdentifier (Identifier (toString)) [UIdentifier (Identifier (toString))] + USimpleNameReferenceExpression (identifier = toString, resolvesTo = null) [toString] = external toString()() diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/Elvis.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/Elvis.values.fir.txt new file mode 100644 index 00000000000..60c28441400 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/Elvis.values.fir.txt @@ -0,0 +1,9 @@ +UFile (package = ) [public final class ElvisKt {...] + UClass (name = ElvisKt) [public final class ElvisKt {...}] + UMethod (name = foo) [public static final fun foo(bar: java.lang.String) : java.lang.String = [!] UnknownKotlinExpression (NULL)] + UParameter (name = bar) [var bar: java.lang.String] + [!] UnknownKotlinExpression (NULL) [[!] UnknownKotlinExpression (NULL)] = Undetermined + UMethod (name = bar) [public static final fun bar() : int = [!] UnknownKotlinExpression (INTEGER_CONSTANT)] + [!] UnknownKotlinExpression (INTEGER_CONSTANT) [[!] UnknownKotlinExpression (INTEGER_CONSTANT)] = Undetermined + UMethod (name = baz) [public static final fun baz() : java.lang.String = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/ElvisType.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/ElvisType.values.fe10.txt new file mode 100644 index 00000000000..c2e8017012c --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/ElvisType.values.fe10.txt @@ -0,0 +1,30 @@ +UFile (package = ) [public final class ElvisTypeKt {...] + UClass (name = ElvisTypeKt) [public final class ElvisTypeKt {...}] + UMethod (name = foo) [public static final fun foo(@org.jetbrains.annotations.Nullable text: java.lang.String) : void {...}] + UParameter (name = text) [@org.jetbrains.annotations.Nullable var text: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] + UBlockExpression [{...}] = Nothing + UReturnExpression [return bar(elvis {...})] = Nothing + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [bar(elvis {...})] = external bar(elvis { + var var63c495f9: java.lang.String = text + if (var63c495f9 != null) var63c495f9 else return +})(Undetermined) + UIdentifier (Identifier (bar)) [UIdentifier (Identifier (bar))] + USimpleNameReferenceExpression (identifier = bar, resolvesTo = null) [bar] = external bar(elvis { + var var63c495f9: java.lang.String = text + if (var63c495f9 != null) var63c495f9 else return +})(Undetermined) + UExpressionList (elvis) [elvis {...}] = Undetermined + UDeclarationsExpression [var var63c495f9: java.lang.String = text] = Nothing + ULocalVariable (name = var63c495f9) [var var63c495f9: java.lang.String = text] + USimpleNameReferenceExpression (identifier = text) [text] = Undetermined + UIfExpression [if (var63c495f9 != null) var63c495f9 else return] = Undetermined + UBinaryExpression (operator = !=) [var63c495f9 != null] = Undetermined + USimpleNameReferenceExpression (identifier = var63c495f9) [var63c495f9] = Undetermined + ULiteralExpression (value = null) [null] = null + USimpleNameReferenceExpression (identifier = var63c495f9) [var63c495f9] = Undetermined + UReturnExpression [return] = Nothing + UMethod (name = bar) [public static final fun bar(@org.jetbrains.annotations.NotNull o: java.lang.Object) : void {...}] + UParameter (name = o) [@org.jetbrains.annotations.NotNull var o: java.lang.Object] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/ElvisType.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/ElvisType.values.fir.txt new file mode 100644 index 00000000000..190d48200f4 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/ElvisType.values.fir.txt @@ -0,0 +1,8 @@ +UFile (package = ) [public final class ElvisTypeKt {...] + UClass (name = ElvisTypeKt) [public final class ElvisTypeKt {...}] + UMethod (name = foo) [public static final fun foo(text: java.lang.String) : void = [!] UnknownKotlinExpression (CALL_EXPRESSION)] + UParameter (name = text) [var text: java.lang.String] + [!] UnknownKotlinExpression (CALL_EXPRESSION) [[!] UnknownKotlinExpression (CALL_EXPRESSION)] = Undetermined + UMethod (name = bar) [public static final fun bar(o: java.lang.Object) : void = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = o) [var o: java.lang.Object] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/EnumValueMembers.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/EnumValueMembers.values.fe10.txt new file mode 100644 index 00000000000..d6e535b5473 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/EnumValueMembers.values.fe10.txt @@ -0,0 +1,19 @@ +UFile (package = ) [public enum Style {...] + UClass (name = Style) [public enum Style {...}] + UField (name = value) [@org.jetbrains.annotations.NotNull private final var value: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UEnumConstant (name = SHEET) [@null SHEET("foo") {...}] = Undetermined + UAnnotation (fqName = null) [@null] + USimpleNameReferenceExpression (identifier = Style) [Style] = external Style() + ULiteralExpression (value = "foo") ["foo"] = "foo" + UClass (name = SHEET) [public static final class SHEET : Style {...}] + UMethod (name = getExitAnimation) [public fun getExitAnimation() : java.lang.String {...}] + UBlockExpression [{...}] = Nothing + UReturnExpression [return "bar"] = Nothing + ULiteralExpression (value = "bar") ["bar"] = "bar" + UMethod (name = SHEET) [fun SHEET() = UastEmptyExpression] + UMethod (name = getExitAnimation) [public abstract fun getExitAnimation() : java.lang.String = UastEmptyExpression] + UMethod (name = getValue) [public final fun getValue() : java.lang.String = UastEmptyExpression] + UMethod (name = Style) [private fun Style(@org.jetbrains.annotations.NotNull value: java.lang.String) = UastEmptyExpression] + UParameter (name = value) [@org.jetbrains.annotations.NotNull var value: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/EnumValueMembers.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/EnumValueMembers.values.fir.txt new file mode 100644 index 00000000000..cf1dad3db16 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/EnumValueMembers.values.fir.txt @@ -0,0 +1,8 @@ +UFile (package = ) [public final enum Style {...] + UClass (name = Style) [public final enum Style {...}] + UField (name = value) [private final var value: java.lang.String] + UField (name = SHEET) [public static final var SHEET: Style] + UMethod (name = Style) [private fun Style(value: java.lang.String) = UastEmptyExpression] + UParameter (name = value) [var value: java.lang.String] + UMethod (name = getValue) [public final fun getValue() : java.lang.String = UastEmptyExpression] + UMethod (name = getExitAnimation) [public abstract fun getExitAnimation() : java.lang.String = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/EnumValuesConstructors.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/EnumValuesConstructors.values.fe10.txt new file mode 100644 index 00000000000..4410c1376d2 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/EnumValuesConstructors.values.fe10.txt @@ -0,0 +1,24 @@ +UFile (package = ) [public enum Style {...] + UClass (name = Style) [public enum Style {...}] + UField (name = value) [@org.jetbrains.annotations.Nullable private final var value: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] + UEnumConstant (name = SYSTEM) [@null SYSTEM("system")] = Undetermined + UAnnotation (fqName = null) [@null] + USimpleNameReferenceExpression (identifier = Style) [Style] = external Style() + ULiteralExpression (value = "system") ["system"] = "system" + UEnumConstant (name = USER) [@null USER("user")] = Undetermined + UAnnotation (fqName = null) [@null] + USimpleNameReferenceExpression (identifier = Style) [Style] = external Style() + ULiteralExpression (value = "user") ["user"] = "user" + UEnumConstant (name = INTERNAL) [@null INTERNAL("internal")] = Undetermined + UAnnotation (fqName = null) [@null] + USimpleNameReferenceExpression (identifier = Style) [Style] = external Style() + ULiteralExpression (value = "internal") ["internal"] = "internal" + UEnumConstant (name = UNKNOWN) [@null UNKNOWN(null)] = Undetermined + UAnnotation (fqName = null) [@null] + USimpleNameReferenceExpression (identifier = Style) [Style] = external Style() + ULiteralExpression (value = null) [null] = null + UMethod (name = getValue) [public final fun getValue() : java.lang.String = UastEmptyExpression] + UMethod (name = Style) [private fun Style(@org.jetbrains.annotations.Nullable value: java.lang.String) = UastEmptyExpression] + UParameter (name = value) [@org.jetbrains.annotations.Nullable var value: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/EnumValuesConstructors.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/EnumValuesConstructors.values.fir.txt new file mode 100644 index 00000000000..0041eae9923 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/EnumValuesConstructors.values.fir.txt @@ -0,0 +1,10 @@ +UFile (package = ) [public final enum Style {...] + UClass (name = Style) [public final enum Style {...}] + UField (name = value) [private final var value: java.lang.String] + UField (name = SYSTEM) [public static final var SYSTEM: Style] + UField (name = USER) [public static final var USER: Style] + UField (name = INTERNAL) [public static final var INTERNAL: Style] + UField (name = UNKNOWN) [public static final var UNKNOWN: Style] + UMethod (name = Style) [private fun Style(value: java.lang.String) = UastEmptyExpression] + UParameter (name = value) [var value: java.lang.String] + UMethod (name = getValue) [public final fun getValue() : java.lang.String = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/IfStatement.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/IfStatement.values.fe10.txt new file mode 100644 index 00000000000..17badb78fff --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/IfStatement.values.fe10.txt @@ -0,0 +1,12 @@ +UFile (package = ) [public final class IfStatementKt {...] + UClass (name = IfStatementKt) [public final class IfStatementKt {...}] + UMethod (name = foo) [public static final fun foo() : void {...}] + UBlockExpression [{...}] = Undetermined + UDeclarationsExpression [var x: int = if ("abc" != "def") 1 else 0] = Undetermined + ULocalVariable (name = x) [var x: int = if ("abc" != "def") 1 else 0] + UIfExpression [if ("abc" != "def") 1 else 0] = 1 + UBinaryExpression (operator = !=) ["abc" != "def"] = true + ULiteralExpression (value = "abc") ["abc"] = "abc" + ULiteralExpression (value = "def") ["def"] = "def" + ULiteralExpression (value = 1) [1] = 1 + ULiteralExpression (value = 0) [0] = 0 diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/IfStatement.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/IfStatement.values.fir.txt new file mode 100644 index 00000000000..67a6cfc34f7 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/IfStatement.values.fir.txt @@ -0,0 +1,4 @@ +UFile (package = ) [public final class IfStatementKt {...] + UClass (name = IfStatementKt) [public final class IfStatementKt {...}] + UMethod (name = foo) [public static final fun foo() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/Imports.values.txt b/plugins/uast-kotlin-fir/testData/legacyValues/Imports.values.txt new file mode 100644 index 00000000000..725e3e0f0f2 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/Imports.values.txt @@ -0,0 +1,7 @@ +UFile (package = ) [import java.lang.Thread.currentThread...] + UImportStatement (isOnDemand = false) [import java.lang.Thread.currentThread] + UImportStatement (isOnDemand = false) [import java.lang.Thread.NORM_PRIORITY] + UImportStatement (isOnDemand = false) [import java.lang.Thread.UncaughtExceptionHandler] + UImportStatement (isOnDemand = false) [import java.lang.Thread.sleep] + UImportStatement (isOnDemand = false) [import kotlin.collections.emptyList] + UImportStatement (isOnDemand = false) [import kotlin.Int.Companion.SIZE_BYTES] \ No newline at end of file diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/In.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/In.values.fe10.txt new file mode 100644 index 00000000000..95d1c22b191 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/In.values.fe10.txt @@ -0,0 +1,22 @@ +UFile (package = ) [public final class InKt {...] + UClass (name = InKt) [public final class InKt {...}] + UMethod (name = foo) [public static final fun foo() : boolean {...}] + UBlockExpression [{...}] = Nothing + UDeclarationsExpression [var x: int = 1] = Undetermined + ULocalVariable (name = x) [var x: int = 1] + ULiteralExpression (value = 1) [1] = 1 + UDeclarationsExpression [var y: int = 10] = Undetermined + ULocalVariable (name = y) [var y: int = 10] + ULiteralExpression (value = 10) [10] = 10 + UReturnExpression [return x in 0 .. 5 && y !in 4 .. 9] = Nothing + UBinaryExpression (operator = &&) [x in 0 .. 5 && y !in 4 .. 9] = true (depending on: (var x = 1), (var y = 10)) + UBinaryExpression (operator = in) [x in 0 .. 5] = true (depending on: (var x = 1)) + USimpleNameReferenceExpression (identifier = x) [x] = (var x = 1) + UBinaryExpression (operator = ..) [0 .. 5] = 0..5 + ULiteralExpression (value = 0) [0] = 0 + ULiteralExpression (value = 5) [5] = 5 + UBinaryExpression (operator = !in) [y !in 4 .. 9] = true (depending on: (var y = 10)) + USimpleNameReferenceExpression (identifier = y) [y] = (var y = 10) + UBinaryExpression (operator = ..) [4 .. 9] = 4..9 + ULiteralExpression (value = 4) [4] = 4 + ULiteralExpression (value = 9) [9] = 9 diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/In.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/In.values.fir.txt new file mode 100644 index 00000000000..348f5ee9218 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/In.values.fir.txt @@ -0,0 +1,4 @@ +UFile (package = ) [public final class InKt {...] + UClass (name = InKt) [public final class InKt {...}] + UMethod (name = foo) [public static final fun foo() : boolean = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/InferenceInsideUnresolvedConstructor.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/InferenceInsideUnresolvedConstructor.values.fe10.txt new file mode 100644 index 00000000000..16c07771f74 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/InferenceInsideUnresolvedConstructor.values.fe10.txt @@ -0,0 +1,18 @@ +UFile (package = ) [public final class InferenceInsideUnresolvedConstructorKt {...] + UClass (name = InferenceInsideUnresolvedConstructorKt) [public final class InferenceInsideUnresolvedConstructorKt {...}] + UMethod (name = getBar) [public static final fun getBar() : java.lang.Object {...}] + UBlockExpression [{...}] = Nothing + UReturnExpression [return (id(42))] = Nothing + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [(id(42))] = external (id(42))(external id(42)(42)) + UIdentifier (Identifier (Unresolved)) [UIdentifier (Identifier (Unresolved))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] = external (id(42))(external id(42)(42)) + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [id(42)] = external id(42)(42) + UIdentifier (Identifier (id)) [UIdentifier (Identifier (id))] + USimpleNameReferenceExpression (identifier = id, resolvesTo = null) [id] = external id(42)(42) + ULiteralExpression (value = 42) [42] = 42 + UMethod (name = id) [public static final fun id(@org.jetbrains.annotations.Nullable x: T) : T {...}] + UParameter (name = x) [@org.jetbrains.annotations.Nullable var x: T] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] + UBlockExpression [{...}] = Nothing + UReturnExpression [return x] = Nothing + USimpleNameReferenceExpression (identifier = x) [x] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/InferenceInsideUnresolvedConstructor.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/InferenceInsideUnresolvedConstructor.values.fir.txt new file mode 100644 index 00000000000..e8ecf2e5736 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/InferenceInsideUnresolvedConstructor.values.fir.txt @@ -0,0 +1,7 @@ +UFile (package = ) [public final class InferenceInsideUnresolvedConstructorKt {...] + UClass (name = InferenceInsideUnresolvedConstructorKt) [public final class InferenceInsideUnresolvedConstructorKt {...}] + UMethod (name = getBar) [public static final fun getBar() : java.lang.Object = [!] UnknownKotlinExpression (CALL_EXPRESSION)] + [!] UnknownKotlinExpression (CALL_EXPRESSION) [[!] UnknownKotlinExpression (CALL_EXPRESSION)] = Undetermined + UMethod (name = id) [public static final fun id(x: T) : T = [!] UnknownKotlinExpression (REFERENCE_EXPRESSION)] + UParameter (name = x) [var x: T] + [!] UnknownKotlinExpression (REFERENCE_EXPRESSION) [[!] UnknownKotlinExpression (REFERENCE_EXPRESSION)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/InnerClasses.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/InnerClasses.values.fe10.txt new file mode 100644 index 00000000000..1d0c45232bf --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/InnerClasses.values.fe10.txt @@ -0,0 +1,27 @@ +UFile (package = ) [public final class Foo {...] + UClass (name = Foo) [public final class Foo {...}] + UMethod (name = Foo) [public fun Foo() = UastEmptyExpression] + UClass (name = Bar) [public static final class Bar {...}] + UField (name = a) [@org.jetbrains.annotations.NotNull private final var a: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UField (name = b) [@org.jetbrains.annotations.NotNull private final var b: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UMethod (name = getAPlusB) [public final fun getAPlusB() : int {...}] + UBlockExpression [{...}] = Nothing + UReturnExpression [return a + b] = Nothing + UBinaryExpression (operator = +) [a + b] = Undetermined + USimpleNameReferenceExpression (identifier = a) [a] = Undetermined + USimpleNameReferenceExpression (identifier = b) [b] = Undetermined + UMethod (name = getA) [public final fun getA() : int = UastEmptyExpression] + UMethod (name = getB) [public final fun getB() : int = UastEmptyExpression] + UMethod (name = Bar) [public fun Bar(@org.jetbrains.annotations.NotNull a: int, @org.jetbrains.annotations.NotNull b: int) = UastEmptyExpression] + UParameter (name = a) [@org.jetbrains.annotations.NotNull var a: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = b) [@org.jetbrains.annotations.NotNull var b: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UClass (name = Baz) [public static final class Baz {...}] + UMethod (name = doNothing) [public final fun doNothing() : void {...}] + UBlockExpression [{...}] = Nothing + UReturnExpression [return Unit] = Nothing + USimpleNameReferenceExpression (identifier = Unit) [Unit] = external Unit() + UMethod (name = Baz) [public fun Baz() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/InnerClasses.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/InnerClasses.values.fir.txt new file mode 100644 index 00000000000..f7549221d47 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/InnerClasses.values.fir.txt @@ -0,0 +1,17 @@ +UFile (package = ) [public final class Foo {...] + UClass (name = Foo) [public final class Foo {...}] + UMethod (name = Foo) [public fun Foo() = UastEmptyExpression] + UClass (name = Bar) [public static final class Bar {...}] + UField (name = a) [private final var a: int] + UField (name = b) [private final var b: int] + UMethod (name = Bar) [public fun Bar(a: int, b: int) = UastEmptyExpression] + UParameter (name = a) [var a: int] + UParameter (name = b) [var b: int] + UMethod (name = getA) [public final fun getA() : int = UastEmptyExpression] + UMethod (name = getB) [public final fun getB() : int = UastEmptyExpression] + UMethod (name = getAPlusB) [public final fun getAPlusB() : int = [!] UnknownKotlinExpression (BINARY_EXPRESSION)] + [!] UnknownKotlinExpression (BINARY_EXPRESSION) [[!] UnknownKotlinExpression (BINARY_EXPRESSION)] = Undetermined + UClass (name = Baz) [public static final class Baz {...}] + UMethod (name = Baz) [public fun Baz() = UastEmptyExpression] + UMethod (name = doNothing) [public final fun doNothing() : void = [!] UnknownKotlinExpression (REFERENCE_EXPRESSION)] + [!] UnknownKotlinExpression (REFERENCE_EXPRESSION) [[!] UnknownKotlinExpression (REFERENCE_EXPRESSION)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/InnerNonFixedTypeVariable.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/InnerNonFixedTypeVariable.values.fe10.txt new file mode 100644 index 00000000000..0113bc319b9 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/InnerNonFixedTypeVariable.values.fe10.txt @@ -0,0 +1,30 @@ +UFile (package = ) [public final class InnerNonFixedTypeVariableKt {...] + UClass (name = InnerNonFixedTypeVariableKt) [public final class InnerNonFixedTypeVariableKt {...}] + UMethod (name = test) [public static final fun test(@org.jetbrains.annotations.NotNull list: java.util.List) : void {...}] + UParameter (name = list) [@org.jetbrains.annotations.NotNull var list: java.util.List] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = external (mutableSetOf(), { + +})(external mutableSetOf()(), Undetermined) + UQualifiedReferenceExpression [list.filterIsInstance().(mutableSetOf(), { ...})] = external (mutableSetOf(), { + +})(external mutableSetOf()(), Undetermined) + UQualifiedReferenceExpression [list.filterIsInstance()] = external filterIsInstance()() + USimpleNameReferenceExpression (identifier = list) [list] = Undetermined + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [filterIsInstance()] = external filterIsInstance()() + UIdentifier (Identifier (filterIsInstance)) [UIdentifier (Identifier (filterIsInstance))] + USimpleNameReferenceExpression (identifier = filterIsInstance, resolvesTo = null) [filterIsInstance] = external filterIsInstance()() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 2)) [(mutableSetOf(), { ...})] = external (mutableSetOf(), { + +})(external mutableSetOf()(), Undetermined) + UIdentifier (Identifier (mapTo)) [UIdentifier (Identifier (mapTo))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] = external (mutableSetOf(), { + +})(external mutableSetOf()(), Undetermined) + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [mutableSetOf()] = external mutableSetOf()() + UIdentifier (Identifier (mutableSetOf)) [UIdentifier (Identifier (mutableSetOf))] + USimpleNameReferenceExpression (identifier = mutableSetOf, resolvesTo = null) [mutableSetOf] = external mutableSetOf()() + ULambdaExpression [{ ...}] = Undetermined + UBlockExpression [{...}] = Undetermined + UClass (name = Some) [public final class Some {...}] + UMethod (name = Some) [public fun Some() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/InnerNonFixedTypeVariable.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/InnerNonFixedTypeVariable.values.fir.txt new file mode 100644 index 00000000000..0dd559a1eab --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/InnerNonFixedTypeVariable.values.fir.txt @@ -0,0 +1,7 @@ +UFile (package = ) [public final class InnerNonFixedTypeVariableKt {...] + UClass (name = InnerNonFixedTypeVariableKt) [public final class InnerNonFixedTypeVariableKt {...}] + UMethod (name = test) [public static final fun test(list: java.util.List) : void = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = list) [var list: java.util.List] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UClass (name = Some) [public final class Some {...}] + UMethod (name = Some) [public fun Some() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/LambdaReturn.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/LambdaReturn.values.fe10.txt new file mode 100644 index 00000000000..fa6c1e8f075 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/LambdaReturn.values.fe10.txt @@ -0,0 +1,151 @@ +UFile (package = org.jetbrains.uast.kotlin) [package org.jetbrains.uast.kotlin...] + UClass (name = LambdaReturnKt) [public final class LambdaReturnKt {...}] + UMethod (name = foo) [public static final fun foo() : void {...}] + UBlockExpression [{...}] = Undetermined + UDeclarationsExpression [var lam1: kotlin.jvm.functions.Function1 = { @org.jetbrains.annotations.NotNull var a: int ->...}] = Undetermined + ULocalVariable (name = lam1) [var lam1: kotlin.jvm.functions.Function1 = { @org.jetbrains.annotations.NotNull var a: int ->...}] + ULambdaExpression [{ @org.jetbrains.annotations.NotNull var a: int ->...}] = Undetermined + UParameter (name = a) [@org.jetbrains.annotations.NotNull var a: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UDeclarationsExpression [var b: int = 1] = Undetermined + ULocalVariable (name = b) [var b: int = 1] + ULiteralExpression (value = 1) [1] = 1 + UReturnExpression [return a + b] = Undetermined + UBinaryExpression (operator = +) [a + b] = Undetermined (depending on: (var b = 1)) + USimpleNameReferenceExpression (identifier = a) [a] = external a() + USimpleNameReferenceExpression (identifier = b) [b] = (var b = 1) + UDeclarationsExpression [var lam2: kotlin.jvm.functions.Function1 = { @org.jetbrains.annotations.NotNull var a: int ->...}] = Undetermined + ULocalVariable (name = lam2) [var lam2: kotlin.jvm.functions.Function1 = { @org.jetbrains.annotations.NotNull var a: int ->...}] + ULambdaExpression [{ @org.jetbrains.annotations.NotNull var a: int ->...}] = Undetermined + UParameter (name = a) [@org.jetbrains.annotations.NotNull var a: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UDeclarationsExpression [var c: int = 1] = Undetermined + ULocalVariable (name = c) [var c: int = 1] + ULiteralExpression (value = 1) [1] = 1 + UReturnExpression [return if (a > 0) a + c else a - c] = Undetermined + UIfExpression [if (a > 0) a + c else a - c] = Undetermined (depending on: (var c = 1)) + UBinaryExpression (operator = >) [a > 0] = Undetermined + USimpleNameReferenceExpression (identifier = a) [a] = external a() + ULiteralExpression (value = 0) [0] = 0 + UBinaryExpression (operator = +) [a + c] = Undetermined (depending on: (var c = 1)) + USimpleNameReferenceExpression (identifier = a) [a] = external a() + USimpleNameReferenceExpression (identifier = c) [c] = (var c = 1) + UBinaryExpression (operator = -) [a - c] = Undetermined (depending on: (var c = 1)) + USimpleNameReferenceExpression (identifier = a) [a] = external a() + USimpleNameReferenceExpression (identifier = c) [c] = (var c = 1) + UDeclarationsExpression [var lam3: kotlin.jvm.functions.Function1 = lbd@ { @org.jetbrains.annotations.NotNull var a: int ->...}] = Undetermined + ULocalVariable (name = lam3) [var lam3: kotlin.jvm.functions.Function1 = lbd@ { @org.jetbrains.annotations.NotNull var a: int ->...}] + ULabeledExpression (label = lbd) [lbd@ { @org.jetbrains.annotations.NotNull var a: int ->...}] = Undetermined + ULambdaExpression [{ @org.jetbrains.annotations.NotNull var a: int ->...}] = Undetermined + UParameter (name = a) [@org.jetbrains.annotations.NotNull var a: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UDeclarationsExpression [var d: int = 1] = Undetermined + ULocalVariable (name = d) [var d: int = 1] + ULiteralExpression (value = 1) [1] = 1 + UReturnExpression [return a + d] = Nothing + UBinaryExpression (operator = +) [a + d] = Undetermined (depending on: (var d = 1)) + USimpleNameReferenceExpression (identifier = a) [a] = external a() + USimpleNameReferenceExpression (identifier = d) [d] = (var d = 1) + UDeclarationsExpression [var lam4: kotlin.jvm.functions.Function1 = fun (@org.jetbrains.annotations.NotNull var a: int) {...}] = Undetermined + ULocalVariable (name = lam4) [var lam4: kotlin.jvm.functions.Function1 = fun (@org.jetbrains.annotations.NotNull var a: int) {...}] + ULambdaExpression [fun (@org.jetbrains.annotations.NotNull var a: int) {...}] = Undetermined + UParameter (name = a) [@org.jetbrains.annotations.NotNull var a: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UIfExpression [if (a < 5) return "5"] = Undetermined + UBinaryExpression (operator = <) [a < 5] = Undetermined + USimpleNameReferenceExpression (identifier = a) [a] = external a() + ULiteralExpression (value = 5) [5] = 5 + UReturnExpression [return "5"] = Nothing + ULiteralExpression (value = "5") ["5"] = "5" + UIfExpression [if (a > 0) return "1" else return "2"] = Nothing + UBinaryExpression (operator = >) [a > 0] = Undetermined + USimpleNameReferenceExpression (identifier = a) [a] = external a() + ULiteralExpression (value = 0) [0] = 0 + UReturnExpression [return "1"] = Nothing + ULiteralExpression (value = "1") ["1"] = "1" + UReturnExpression [return "2"] = Nothing + ULiteralExpression (value = "2") ["2"] = "2" + UDeclarationsExpression [var lam5: kotlin.jvm.functions.Function1 = fun (@org.jetbrains.annotations.NotNull var a: int) {...}] = Undetermined + ULocalVariable (name = lam5) [var lam5: kotlin.jvm.functions.Function1 = fun (@org.jetbrains.annotations.NotNull var a: int) {...}] + ULambdaExpression [fun (@org.jetbrains.annotations.NotNull var a: int) {...}] = Undetermined + UParameter (name = a) [@org.jetbrains.annotations.NotNull var a: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UReturnExpression [return "a" + a] = Nothing + UBinaryExpression (operator = +) ["a" + a] = Undetermined + ULiteralExpression (value = "a") ["a"] = "a" + USimpleNameReferenceExpression (identifier = a) [a] = external a() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [bar({ var it: int ->...})] = external bar({ var it: int -> + + if (it > 5) return + var b: int = 1 + return it + b +})(Undetermined) + UIdentifier (Identifier (bar)) [UIdentifier (Identifier (bar))] + USimpleNameReferenceExpression (identifier = bar, resolvesTo = null) [bar] = external bar({ var it: int -> + + if (it > 5) return + var b: int = 1 + return it + b +})(Undetermined) + ULambdaExpression [{ var it: int ->...}] = Undetermined + UParameter (name = it) [var it: int] + UBlockExpression [{...}] = Nothing + UIfExpression [if (it > 5) return] = Undetermined + UBinaryExpression (operator = >) [it > 5] = Undetermined + USimpleNameReferenceExpression (identifier = it) [it] = external it() + ULiteralExpression (value = 5) [5] = 5 + UReturnExpression [return] = Nothing + UDeclarationsExpression [var b: int = 1] = Nothing + ULocalVariable (name = b) [var b: int = 1] + ULiteralExpression (value = 1) [1] = 1 + UReturnExpression [return it + b] = Nothing + UBinaryExpression (operator = +) [it + b] = Undetermined (depending on: (var b = 1)) + USimpleNameReferenceExpression (identifier = it) [it] = external it() + USimpleNameReferenceExpression (identifier = b) [b] = (var b = 1) + UDeclarationsExpression [var x: kotlin.jvm.functions.Function0 = { ...}] = Nothing + ULocalVariable (name = x) [var x: kotlin.jvm.functions.Function0 = { ...}] + ULambdaExpression [{ ...}] = Undetermined + UBlockExpression [{...}] = Undetermined + UDeclarationsExpression [@org.jetbrains.annotations.NotNull var vardbcd0724: = listOf(1, 2)...@org.jetbrains.annotations.NotNull var b: int = vardbcd0724.()] = Nothing + ULocalVariable (name = vardbcd0724) [@org.jetbrains.annotations.NotNull var vardbcd0724: = listOf(1, 2)] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 2)) [listOf(1, 2)] = external listOf(1, 2)(1, 2) + UIdentifier (Identifier (listOf)) [UIdentifier (Identifier (listOf))] + USimpleNameReferenceExpression (identifier = listOf, resolvesTo = null) [listOf] = external listOf(1, 2)(1, 2) + ULiteralExpression (value = 1) [1] = 1 + ULiteralExpression (value = 2) [2] = 2 + ULocalVariable (name = a) [@org.jetbrains.annotations.NotNull var a: int = vardbcd0724.()] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UQualifiedReferenceExpression [vardbcd0724.()] = external ()() + USimpleNameReferenceExpression (identifier = vardbcd0724) [vardbcd0724] = external vardbcd0724() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [()] = external ()() + UIdentifier (Identifier (component1)) [UIdentifier (Identifier (component1))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] = external ()() + ULocalVariable (name = b) [@org.jetbrains.annotations.NotNull var b: int = vardbcd0724.()] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UQualifiedReferenceExpression [vardbcd0724.()] = external ()() + USimpleNameReferenceExpression (identifier = vardbcd0724) [vardbcd0724] = external vardbcd0724() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [()] = external ()() + UIdentifier (Identifier (component2)) [UIdentifier (Identifier (component2))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] = external ()() + UDeclarationsExpression [var y: kotlin.jvm.functions.Function0 = { ...}] = Nothing + ULocalVariable (name = y) [var y: kotlin.jvm.functions.Function0 = { ...}] + ULambdaExpression [{ ...}] = Undetermined + UBlockExpression [{...}] = external listOf(1)(1) + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [listOf(1)] = external listOf(1)(1) + UIdentifier (Identifier (listOf)) [UIdentifier (Identifier (listOf))] + USimpleNameReferenceExpression (identifier = listOf, resolvesTo = null) [listOf] = external listOf(1)(1) + ULiteralExpression (value = 1) [1] = 1 + UMethod (name = bar) [private static final fun bar(@org.jetbrains.annotations.NotNull lmbd: kotlin.jvm.functions.Function1) : void {...}] + UParameter (name = lmbd) [@org.jetbrains.annotations.NotNull var lmbd: kotlin.jvm.functions.Function1] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = external invoke(1)(1) + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [invoke(1)] = external invoke(1)(1) + UIdentifier (Identifier (lmbd)) [UIdentifier (Identifier (lmbd))] + USimpleNameReferenceExpression (identifier = invoke, resolvesTo = null) [invoke] = external invoke(1)(1) + ULiteralExpression (value = 1) [1] = 1 diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/LambdaReturn.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/LambdaReturn.values.fir.txt new file mode 100644 index 00000000000..7b45c7399ff --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/LambdaReturn.values.fir.txt @@ -0,0 +1,4 @@ +UFile (package = org.jetbrains.uast.kotlin) [package org.jetbrains.uast.kotlin...] + UClass (name = LambdaReturnKt) [public final class LambdaReturnKt {...}] + UMethod (name = foo) [public static final fun foo() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/Lambdas.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/Lambdas.values.fe10.txt new file mode 100644 index 00000000000..41cf2f06827 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/Lambdas.values.fe10.txt @@ -0,0 +1,59 @@ +UFile (package = ) [import java.util.stream.Stream...] + UImportStatement (isOnDemand = false) [import java.util.stream.Stream] + UClass (name = LambdasKt) [public final class LambdasKt {...}] + UMethod (name = foo) [public static final fun foo() : void {...}] + UBlockExpression [{...}] = external filter({ var it: java.lang.String -> + + return it.isEmpty() +})(Undetermined) + UQualifiedReferenceExpression [Stream.empty().filter({ var it: java.lang.String ->...})] = external filter({ var it: java.lang.String -> + + return it.isEmpty() +})(Undetermined) + UQualifiedReferenceExpression [Stream.empty()] = external empty()() + USimpleNameReferenceExpression (identifier = Stream) [Stream] = external Stream() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [empty()] = external empty()() + UIdentifier (Identifier (empty)) [UIdentifier (Identifier (empty))] + USimpleNameReferenceExpression (identifier = empty, resolvesTo = null) [empty] = external empty()() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [filter({ var it: java.lang.String ->...})] = external filter({ var it: java.lang.String -> + + return it.isEmpty() +})(Undetermined) + UIdentifier (Identifier (filter)) [UIdentifier (Identifier (filter))] + USimpleNameReferenceExpression (identifier = filter, resolvesTo = null) [filter] = external filter({ var it: java.lang.String -> + + return it.isEmpty() +})(Undetermined) + ULambdaExpression [{ var it: java.lang.String ->...}] = Undetermined + UParameter (name = it) [var it: java.lang.String] + UBlockExpression [{...}] = Nothing + UReturnExpression [return it.isEmpty()] = Nothing + UQualifiedReferenceExpression [it.isEmpty()] = external isEmpty()() + USimpleNameReferenceExpression (identifier = it) [it] = external it() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [isEmpty()] = external isEmpty()() + UIdentifier (Identifier (isEmpty)) [UIdentifier (Identifier (isEmpty))] + USimpleNameReferenceExpression (identifier = isEmpty, resolvesTo = null) [isEmpty] = external isEmpty()() + UMethod (name = doSelectItem) [public static final fun doSelectItem(@org.jetbrains.annotations.NotNull selectItemFunction: kotlin.jvm.functions.Function0) : void {...}] + UParameter (name = selectItemFunction) [@org.jetbrains.annotations.NotNull var selectItemFunction: kotlin.jvm.functions.Function0] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = external invoke()() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [invoke()] = external invoke()() + UIdentifier (Identifier (selectItemFunction)) [UIdentifier (Identifier (selectItemFunction))] + USimpleNameReferenceExpression (identifier = invoke, resolvesTo = null) [invoke] = external invoke()() + UDeclarationsExpression [var baz: kotlin.jvm.functions.Function0 = fun () {...}] = Undetermined + ULocalVariable (name = baz) [var baz: kotlin.jvm.functions.Function0 = fun () {...}] + ULambdaExpression [fun () {...}] = Undetermined + UBlockExpression [{...}] = external ()() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [()] = external ()() + UIdentifier (Identifier (Local)) [UIdentifier (Identifier (Local))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] = external ()() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [invoke()] = external invoke()() + UIdentifier (Identifier (baz)) [UIdentifier (Identifier (baz))] + USimpleNameReferenceExpression (identifier = invoke, resolvesTo = null) [invoke] = external invoke()() + UMethod (name = lambdaInPlaceCall) [public static final fun lambdaInPlaceCall() : void {...}] + UBlockExpression [{...}] = Undetermined + UWhileExpression [while (invoke()) {...}] = Undetermined + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [invoke()] = external invoke()() + UIdentifier (Identifier ({)) [UIdentifier (Identifier ({))] + USimpleNameReferenceExpression (identifier = invoke, resolvesTo = null) [invoke] = external invoke()() + UBlockExpression [{...}] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/Lambdas.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/Lambdas.values.fir.txt new file mode 100644 index 00000000000..eb9309fec89 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/Lambdas.values.fir.txt @@ -0,0 +1,10 @@ +UFile (package = ) [import java.util.stream.Stream...] + UImportStatement (isOnDemand = false) [import java.util.stream.Stream] + UClass (name = LambdasKt) [public final class LambdasKt {...}] + UMethod (name = foo) [public static final fun foo() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = doSelectItem) [public static final fun doSelectItem(selectItemFunction: kotlin.jvm.functions.Function0) : void = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = selectItemFunction) [var selectItemFunction: kotlin.jvm.functions.Function0] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = lambdaInPlaceCall) [public static final fun lambdaInPlaceCall() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/LocalDeclarations.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/LocalDeclarations.values.fe10.txt new file mode 100644 index 00000000000..51263ce227c --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/LocalDeclarations.values.fe10.txt @@ -0,0 +1,38 @@ +UFile (package = ) [public final class LocalDeclarationsKt {...] + UClass (name = LocalDeclarationsKt) [public final class LocalDeclarationsKt {...}] + UMethod (name = foo) [public static final fun foo() : boolean {...}] + UBlockExpression [{...}] = Nothing + UDeclarationsExpression [public static final class Local {...}] = Undetermined + UClass (name = Local) [public static final class Local {...}] + UMethod (name = Local) [public fun Local() = UastEmptyExpression] + UDeclarationsExpression [var bar: = fun () {...}] = Undetermined + UVariable (name = bar) [var bar: = fun () {...}] + ULambdaExpression [fun () {...}] = Undetermined + UBlockExpression [{...}] = Nothing + UReturnExpression [return ()] = Undetermined + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] = external ()() + UIdentifier (Identifier (Local)) [UIdentifier (Identifier (Local))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Local) [] = external ()() + UDeclarationsExpression [var baz: kotlin.jvm.functions.Function0 = fun () {...}] = Undetermined + ULocalVariable (name = baz) [var baz: kotlin.jvm.functions.Function0 = fun () {...}] + ULambdaExpression [fun () {...}] = Undetermined + UBlockExpression [{...}] = external ()() + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] = external ()() + UIdentifier (Identifier (Local)) [UIdentifier (Identifier (Local))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Local) [] = external ()() + UDeclarationsExpression [var someLocalFun: kotlin.jvm.functions.Function2 = fun (@org.jetbrains.annotations.NotNull var text: java.lang.String) {...}] = Undetermined + UVariable (name = someLocalFun) [var someLocalFun: kotlin.jvm.functions.Function2 = 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] + UBlockExpression [{...}] = Nothing + UReturnExpression [return 42] = Undetermined + ULiteralExpression (value = 42) [42] = 42 + UReturnExpression [return bar() == ()] = Nothing + UBinaryExpression (operator = ==) [bar() == ()] = Undetermined + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [bar()] = external bar()() + UIdentifier (Identifier (bar)) [UIdentifier (Identifier (bar))] + USimpleNameReferenceExpression (identifier = bar, resolvesTo = null) [bar] = external bar()() + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] = external ()() + UIdentifier (Identifier (Local)) [UIdentifier (Identifier (Local))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Local) [] = external ()() diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/LocalDeclarations.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/LocalDeclarations.values.fir.txt new file mode 100644 index 00000000000..6e9b7e58801 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/LocalDeclarations.values.fir.txt @@ -0,0 +1,4 @@ +UFile (package = ) [public final class LocalDeclarationsKt {...] + UClass (name = LocalDeclarationsKt) [public final class LocalDeclarationsKt {...}] + UMethod (name = foo) [public static final fun foo() : boolean = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/LocalVariableWithAnnotation.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/LocalVariableWithAnnotation.values.fe10.txt new file mode 100644 index 00000000000..8200ff25da7 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/LocalVariableWithAnnotation.values.fe10.txt @@ -0,0 +1,9 @@ +UFile (package = ) [public final class LocalVariableWithAnnotationKt {...] + UClass (name = LocalVariableWithAnnotationKt) [public final class LocalVariableWithAnnotationKt {...}] + UMethod (name = foo) [public static final fun foo() : void {...}] + UBlockExpression [{...}] = Undetermined + UDeclarationsExpression [@TestAnnotation var bar: java.lang.String = "lorem ipsum"] = Undetermined + ULocalVariable (name = bar) [@TestAnnotation var bar: java.lang.String = "lorem ipsum"] + UAnnotation (fqName = TestAnnotation) [@TestAnnotation] + ULiteralExpression (value = "lorem ipsum") ["lorem ipsum"] = "lorem ipsum" + UClass (name = TestAnnotation) [public abstract annotation TestAnnotation {...}] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/LocalVariableWithAnnotation.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/LocalVariableWithAnnotation.values.fir.txt new file mode 100644 index 00000000000..5be449e1eb8 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/LocalVariableWithAnnotation.values.fir.txt @@ -0,0 +1,5 @@ +UFile (package = ) [public final class LocalVariableWithAnnotationKt {...] + UClass (name = LocalVariableWithAnnotationKt) [public final class LocalVariableWithAnnotationKt {...}] + UMethod (name = foo) [public static final fun foo() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UClass (name = TestAnnotation) [public abstract annotation TestAnnotation {...}] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/ManyAlternatives.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/ManyAlternatives.values.fe10.txt new file mode 100644 index 00000000000..0ea52645a73 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/ManyAlternatives.values.fe10.txt @@ -0,0 +1,17 @@ +UFile (package = ) [public final class ClassA {...] + UClass (name = ClassA) [public final class ClassA {...}] + UField (name = paramAndProp) [@org.jetbrains.annotations.NotNull private final var paramAndProp: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UField (name = writebleProp) [@org.jetbrains.annotations.NotNull private var writebleProp: int = 0] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + ULiteralExpression (value = 0) [0] = 0 + UMethod (name = getWritebleProp) [public final fun getWritebleProp() : int = UastEmptyExpression] + UMethod (name = setWritebleProp) [public final fun setWritebleProp(@null writebleProp: int) : void = UastEmptyExpression] + UParameter (name = writebleProp) [@null var writebleProp: int] + UAnnotation (fqName = null) [@null] + UMethod (name = getParamAndProp) [public final fun getParamAndProp() : java.lang.String = UastEmptyExpression] + UMethod (name = ClassA) [public fun ClassA(@org.jetbrains.annotations.NotNull justParam: int, @org.jetbrains.annotations.NotNull paramAndProp: java.lang.String) = UastEmptyExpression] + UParameter (name = justParam) [@org.jetbrains.annotations.NotNull var justParam: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = paramAndProp) [@org.jetbrains.annotations.NotNull var paramAndProp: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/ManyAlternatives.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/ManyAlternatives.values.fir.txt new file mode 100644 index 00000000000..e18bbadeec2 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/ManyAlternatives.values.fir.txt @@ -0,0 +1,12 @@ +UFile (package = ) [public final class ClassA {...] + UClass (name = ClassA) [public final class ClassA {...}] + UField (name = paramAndProp) [private final var paramAndProp: java.lang.String] + UField (name = writebleProp) [private var writebleProp: int = [!] UnknownKotlinExpression (INTEGER_CONSTANT)] + [!] UnknownKotlinExpression (INTEGER_CONSTANT) [[!] UnknownKotlinExpression (INTEGER_CONSTANT)] = Undetermined + UMethod (name = ClassA) [public fun ClassA(justParam: int, paramAndProp: java.lang.String) = UastEmptyExpression] + UParameter (name = justParam) [var justParam: int] + UParameter (name = paramAndProp) [var paramAndProp: java.lang.String] + UMethod (name = getParamAndProp) [public final fun getParamAndProp() : java.lang.String = UastEmptyExpression] + UMethod (name = getWritebleProp) [public final fun getWritebleProp() : int = UastEmptyExpression] + UMethod (name = setWritebleProp) [public final fun setWritebleProp(value: int) : void = UastEmptyExpression] + UParameter (name = value) [var value: int] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/MethodReference.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/MethodReference.values.fe10.txt new file mode 100644 index 00000000000..6ba20dd223f --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/MethodReference.values.fe10.txt @@ -0,0 +1,10 @@ +UFile (package = ) [public final class MethodReferenceKt {...] + UClass (name = MethodReferenceKt) [public final class MethodReferenceKt {...}] + UField (name = x) [@org.jetbrains.annotations.NotNull private static final var x: kotlin.reflect.KFunction = Foo::bar] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UCallableReferenceExpression (name = bar) [Foo::bar] = external Foo::bar() + UMethod (name = getX) [public static final fun getX() : kotlin.reflect.KFunction = UastEmptyExpression] + UClass (name = Foo) [public final class Foo {...}] + UMethod (name = bar) [public final fun bar() : void {...}] + UBlockExpression [{...}] = Undetermined + UMethod (name = Foo) [public fun Foo() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/MethodReference.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/MethodReference.values.fir.txt new file mode 100644 index 00000000000..f2bf5e2613d --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/MethodReference.values.fir.txt @@ -0,0 +1,9 @@ +UFile (package = ) [public final class MethodReferenceKt {...] + UClass (name = MethodReferenceKt) [public final class MethodReferenceKt {...}] + UField (name = x) [private static final var x: kotlin.reflect.KFunction = [!] UnknownKotlinExpression (CALLABLE_REFERENCE_EXPRESSION)] + [!] UnknownKotlinExpression (CALLABLE_REFERENCE_EXPRESSION) [[!] UnknownKotlinExpression (CALLABLE_REFERENCE_EXPRESSION)] = Undetermined + UMethod (name = getX) [public static final fun getX() : kotlin.reflect.KFunction = UastEmptyExpression] + UClass (name = Foo) [public final class Foo {...}] + UMethod (name = Foo) [public fun Foo() = UastEmptyExpression] + UMethod (name = bar) [public final fun bar() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/NameContainingFile.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/NameContainingFile.values.fe10.txt new file mode 100644 index 00000000000..d7ebdfa6ff0 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/NameContainingFile.values.fe10.txt @@ -0,0 +1,10 @@ +UFile (package = ) [public final class NameContainingFileKt {...] + UClass (name = NameContainingFileKt) [public final class NameContainingFileKt {...}] + UField (name = xyzzy) [@org.jetbrains.annotations.NotNull private static final var xyzzy: int = 0] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + ULiteralExpression (value = 0) [0] = 0 + UMethod (name = bar) [public static final fun bar() : void {...}] + UBlockExpression [{...}] = Undetermined + UMethod (name = getXyzzy) [public static final fun getXyzzy() : int = UastEmptyExpression] + UClass (name = Foo) [public final class Foo {...}] + UMethod (name = Foo) [public fun Foo() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/NameContainingFile.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/NameContainingFile.values.fir.txt new file mode 100644 index 00000000000..8123f7d81c3 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/NameContainingFile.values.fir.txt @@ -0,0 +1,9 @@ +UFile (package = ) [public final class NameContainingFileKt {...] + UClass (name = NameContainingFileKt) [public final class NameContainingFileKt {...}] + UField (name = xyzzy) [private static final var xyzzy: int = [!] UnknownKotlinExpression (INTEGER_CONSTANT)] + [!] UnknownKotlinExpression (INTEGER_CONSTANT) [[!] UnknownKotlinExpression (INTEGER_CONSTANT)] = Undetermined + UMethod (name = bar) [public static final fun bar() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = getXyzzy) [public static final fun getXyzzy() : int = UastEmptyExpression] + UClass (name = Foo) [public final class Foo {...}] + UMethod (name = Foo) [public fun Foo() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/NonTrivialIdentifiers.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/NonTrivialIdentifiers.values.fe10.txt new file mode 100644 index 00000000000..98387441f42 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/NonTrivialIdentifiers.values.fe10.txt @@ -0,0 +1,56 @@ +UFile (package = ) [public final class NonTrivialIdentifiersKt {...] + UClass (name = NonTrivialIdentifiersKt) [public final class NonTrivialIdentifiersKt {...}] + UMethod (name = main) [public static final fun main(@org.jetbrains.annotations.Nullable a: A) : void {...}] + UParameter (name = a) [@org.jetbrains.annotations.Nullable var a: A] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] + UBlockExpression [{...}] = external invoke({ + invoke({ + invoke() + }) +})(Undetermined) + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [invoke()] = external invoke()() + UIdentifier (Identifier (()) [UIdentifier (Identifier (())] + USimpleNameReferenceExpression (identifier = invoke, resolvesTo = null) [invoke] = external invoke()() + UDeclarationsExpression [var p: A = ()] = Undetermined + ULocalVariable (name = p) [var p: A = ()] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] = external ()() + UIdentifier (Identifier (A)) [UIdentifier (Identifier (A))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) [] = external ()() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [invoke({ ...})] = external invoke({ + invoke({ + invoke() + }) +})(Undetermined) + UIdentifier (Identifier ({)) [UIdentifier (Identifier ({))] + USimpleNameReferenceExpression (identifier = invoke, resolvesTo = null) [invoke] = external invoke({ + invoke({ + invoke() + }) +})(Undetermined) + ULambdaExpression [{ ...}] = Undetermined + UBlockExpression [{...}] = external invoke({ + invoke() +})(Undetermined) + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [invoke({ ...})] = external invoke({ + invoke() +})(Undetermined) + UIdentifier (Identifier (p)) [UIdentifier (Identifier (p))] + USimpleNameReferenceExpression (identifier = invoke, resolvesTo = null) [invoke] = external invoke({ + invoke() +})(Undetermined) + ULambdaExpression [{ ...}] = Undetermined + UBlockExpression [{...}] = external invoke()() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [invoke()] = external invoke()() + UIdentifier (Identifier (()) [UIdentifier (Identifier (())] + USimpleNameReferenceExpression (identifier = invoke, resolvesTo = null) [invoke] = external invoke()() + UClass (name = A) [public final class A {...}] + UMethod (name = invoke) [public final fun invoke() : void {...}] + UBlockExpression [{...}] = external invoke()() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [invoke()] = external invoke()() + UIdentifier (Identifier (()) [UIdentifier (Identifier (())] + USimpleNameReferenceExpression (identifier = invoke, resolvesTo = null) [invoke] = external invoke()() + UMethod (name = invoke) [public final fun invoke(@org.jetbrains.annotations.NotNull f: kotlin.jvm.functions.Function0) : void {...}] + UParameter (name = f) [@org.jetbrains.annotations.NotNull var f: kotlin.jvm.functions.Function0] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Undetermined + UMethod (name = A) [public fun A() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/NonTrivialIdentifiers.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/NonTrivialIdentifiers.values.fir.txt new file mode 100644 index 00000000000..d5dd2b2d788 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/NonTrivialIdentifiers.values.fir.txt @@ -0,0 +1,12 @@ +UFile (package = ) [public final class NonTrivialIdentifiersKt {...] + UClass (name = NonTrivialIdentifiersKt) [public final class NonTrivialIdentifiersKt {...}] + UMethod (name = main) [public static final fun main(a: A) : void = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = a) [var a: A] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UClass (name = A) [public final class A {...}] + UMethod (name = A) [public fun A() = UastEmptyExpression] + UMethod (name = invoke) [public final fun invoke() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = invoke) [public final fun invoke(f: kotlin.jvm.functions.Function0) : void = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = f) [var f: kotlin.jvm.functions.Function0] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/ParameterPropertyWithAnnotation.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/ParameterPropertyWithAnnotation.values.fe10.txt new file mode 100644 index 00000000000..808953ac024 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/ParameterPropertyWithAnnotation.values.fe10.txt @@ -0,0 +1,31 @@ +UFile (package = ) [public abstract annotation MyAnnotation {...] + UClass (name = MyAnnotation) [public abstract annotation MyAnnotation {...}] + UClass (name = MyAnnotation2) [public abstract annotation MyAnnotation2 {...}] + UClass (name = MyAnnotation3) [public abstract annotation MyAnnotation3 {...}] + UClass (name = MyAnnotation4) [public abstract annotation MyAnnotation4 {...}] + UClass (name = MyAnnotation5) [public abstract annotation MyAnnotation5 {...}] + UClass (name = Test1) [public final class Test1 {...}] + UField (name = bar) [@org.jetbrains.annotations.NotNull private var bar: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UMethod (name = getBar) [public final fun getBar() : int = UastEmptyExpression] + UMethod (name = setBar) [public final fun setBar(@null bar: int) : void = UastEmptyExpression] + UParameter (name = bar) [@null var bar: int] + UAnnotation (fqName = null) [@null] + UMethod (name = Test1) [public fun Test1(@org.jetbrains.annotations.NotNull @MyAnnotation bar: int) = UastEmptyExpression] + UParameter (name = bar) [@org.jetbrains.annotations.NotNull @MyAnnotation var bar: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UAnnotation (fqName = MyAnnotation) [@MyAnnotation] + UClass (name = Test2) [public final class Test2 {...}] + UField (name = bar) [@org.jetbrains.annotations.NotNull @MyAnnotation5 private var bar: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UAnnotation (fqName = MyAnnotation5) [@MyAnnotation5] + UMethod (name = getBar) [@MyAnnotation...public final fun getBar() : int = UastEmptyExpression] + UAnnotation (fqName = MyAnnotation) [@MyAnnotation] + UMethod (name = setBar) [@MyAnnotation2...public final fun setBar(@MyAnnotation3 @null bar: int) : void = UastEmptyExpression] + UAnnotation (fqName = MyAnnotation2) [@MyAnnotation2] + UParameter (name = bar) [@MyAnnotation3 @null var bar: int] + UAnnotation (fqName = MyAnnotation3) [@MyAnnotation3] + UAnnotation (fqName = null) [@null] + UMethod (name = Test2) [public fun Test2(@org.jetbrains.annotations.NotNull bar: int) = UastEmptyExpression] + UParameter (name = bar) [@org.jetbrains.annotations.NotNull var bar: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/ParameterPropertyWithAnnotation.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/ParameterPropertyWithAnnotation.values.fir.txt new file mode 100644 index 00000000000..fd979a51ceb --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/ParameterPropertyWithAnnotation.values.fir.txt @@ -0,0 +1,20 @@ +UFile (package = ) [public abstract annotation MyAnnotation {...] + UClass (name = MyAnnotation) [public abstract annotation MyAnnotation {...}] + UClass (name = MyAnnotation2) [public abstract annotation MyAnnotation2 {...}] + UClass (name = MyAnnotation3) [public abstract annotation MyAnnotation3 {...}] + UClass (name = MyAnnotation4) [public abstract annotation MyAnnotation4 {...}] + UClass (name = MyAnnotation5) [public abstract annotation MyAnnotation5 {...}] + UClass (name = Test1) [public final class Test1 {...}] + UField (name = bar) [private var bar: int] + UMethod (name = Test1) [public fun Test1(bar: int) = UastEmptyExpression] + UParameter (name = bar) [var bar: int] + UMethod (name = getBar) [public final fun getBar() : int = UastEmptyExpression] + UMethod (name = setBar) [public final fun setBar(value: int) : void = UastEmptyExpression] + UParameter (name = value) [var value: int] + UClass (name = Test2) [public final class Test2 {...}] + UField (name = bar) [private var bar: int] + UMethod (name = Test2) [public fun Test2(bar: int) = UastEmptyExpression] + UParameter (name = bar) [var bar: int] + UMethod (name = getBar) [public final fun getBar() : int = UastEmptyExpression] + UMethod (name = setBar) [public final fun setBar(value: int) : void = UastEmptyExpression] + UParameter (name = value) [var value: int] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/ParametersDisorder.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/ParametersDisorder.values.fe10.txt new file mode 100644 index 00000000000..44b5a5cad45 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/ParametersDisorder.values.fe10.txt @@ -0,0 +1,169 @@ +UFile (package = ) [public final class ParametersDisorderKt {...] + UClass (name = ParametersDisorderKt) [public final class ParametersDisorderKt {...}] + UMethod (name = global) [public static final fun global(@org.jetbrains.annotations.NotNull a: int, @org.jetbrains.annotations.NotNull b: float) : void {...}] + UParameter (name = a) [@org.jetbrains.annotations.NotNull var a: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = b) [@org.jetbrains.annotations.NotNull var b: float] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Undetermined + UMethod (name = withDefault) [public static final fun withDefault(@org.jetbrains.annotations.NotNull c: int, @org.jetbrains.annotations.NotNull d: java.lang.String) : void {...}] + UParameter (name = c) [@org.jetbrains.annotations.NotNull var c: int = 1] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + ULiteralExpression (value = 1) [1] = 1 + UParameter (name = d) [@org.jetbrains.annotations.NotNull var d: java.lang.String = "aaa"] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + ULiteralExpression (value = "aaa") ["aaa"] = "aaa" + UBlockExpression [{...}] = Undetermined + UMethod (name = withReceiver) [public static final fun withReceiver(@org.jetbrains.annotations.NotNull $this$withReceiver: java.lang.String, @org.jetbrains.annotations.NotNull a: int, @org.jetbrains.annotations.NotNull b: float) : void {...}] + UParameter (name = $this$withReceiver) [@org.jetbrains.annotations.NotNull var $this$withReceiver: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = a) [@org.jetbrains.annotations.NotNull var a: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = b) [@org.jetbrains.annotations.NotNull var b: float] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Undetermined + UMethod (name = call) [public static final fun call() : void {...}] + UBlockExpression [{...}] = external with((), { + "def".with2Receivers(8, 7.0) +})(external ()(), Undetermined) + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 2)) [global(2.2, 2)] = external global(2.2, 2)((float)2.200000047683716, 2) + UIdentifier (Identifier (global)) [UIdentifier (Identifier (global))] + USimpleNameReferenceExpression (identifier = global, resolvesTo = null) [global] = external global(2.2, 2)((float)2.200000047683716, 2) + ULiteralExpression (value = 2.2) [2.2] = (float)2.200000047683716 + ULiteralExpression (value = 2) [2] = 2 + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [withDefault("bbb")] = external withDefault("bbb")("bbb") + UIdentifier (Identifier (withDefault)) [UIdentifier (Identifier (withDefault))] + USimpleNameReferenceExpression (identifier = withDefault, resolvesTo = null) [withDefault] = external withDefault("bbb")("bbb") + ULiteralExpression (value = "bbb") ["bbb"] = "bbb" + UQualifiedReferenceExpression ["abc".withReceiver(1, 1.2)] = external withReceiver(1, 1.2)(1, (float)1.2000000476837158) + ULiteralExpression (value = "abc") ["abc"] = "abc" + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 2)) [withReceiver(1, 1.2)] = external withReceiver(1, 1.2)(1, (float)1.2000000476837158) + UIdentifier (Identifier (withReceiver)) [UIdentifier (Identifier (withReceiver))] + USimpleNameReferenceExpression (identifier = withReceiver, resolvesTo = null) [withReceiver] = external withReceiver(1, 1.2)(1, (float)1.2000000476837158) + ULiteralExpression (value = 1) [1] = 1 + ULiteralExpression (value = 1.2) [1.2] = (float)1.2000000476837158 + UQualifiedReferenceExpression [Math.atan2(1.3, 3.4)] = external atan2(1.3, 3.4)(1.3, 3.4) + USimpleNameReferenceExpression (identifier = Math) [Math] = external Math() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 2)) [atan2(1.3, 3.4)] = external atan2(1.3, 3.4)(1.3, 3.4) + UIdentifier (Identifier (atan2)) [UIdentifier (Identifier (atan2))] + USimpleNameReferenceExpression (identifier = atan2, resolvesTo = null) [atan2] = external atan2(1.3, 3.4)(1.3, 3.4) + ULiteralExpression (value = 1.3) [1.3] = 1.3 + ULiteralExpression (value = 3.4) [3.4] = 3.4 + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 2)) [("param1", "param2")] = external ("param1", "param2")("param1", "param2") + UIdentifier (Identifier (unresolvedMethod)) [UIdentifier (Identifier (unresolvedMethod))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] = external ("param1", "param2")("param1", "param2") + ULiteralExpression (value = "param1") ["param1"] = "param1" + ULiteralExpression (value = "param2") ["param2"] = "param2" + UQualifiedReferenceExpression [java.lang.String.format("%i %i %i", 1, 2, 3)] = external format("%i %i %i", 1, 2, 3)("%i %i %i", 1, 2, 3) + UQualifiedReferenceExpression [java.lang.String] = external String() + UQualifiedReferenceExpression [java.lang] = external lang() + USimpleNameReferenceExpression (identifier = java) [java] = external java() + USimpleNameReferenceExpression (identifier = lang) [lang] = external lang() + USimpleNameReferenceExpression (identifier = String) [String] = external String() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 4)) [format("%i %i %i", 1, 2, 3)] = external format("%i %i %i", 1, 2, 3)("%i %i %i", 1, 2, 3) + UIdentifier (Identifier (format)) [UIdentifier (Identifier (format))] + USimpleNameReferenceExpression (identifier = format, resolvesTo = null) [format] = external format("%i %i %i", 1, 2, 3)("%i %i %i", 1, 2, 3) + ULiteralExpression (value = "%i %i %i") ["%i %i %i"] = "%i %i %i" + ULiteralExpression (value = 1) [1] = 1 + ULiteralExpression (value = 2) [2] = 2 + ULiteralExpression (value = 3) [3] = 3 + UQualifiedReferenceExpression [java.lang.String.format("%i %i %i", arrayOf(1, 2, 3))] = external format("%i %i %i", arrayOf(1, 2, 3))("%i %i %i", external arrayOf(1, 2, 3)(1, 2, 3)) + UQualifiedReferenceExpression [java.lang.String] = external String() + UQualifiedReferenceExpression [java.lang] = external lang() + USimpleNameReferenceExpression (identifier = java) [java] = external java() + USimpleNameReferenceExpression (identifier = lang) [lang] = external lang() + USimpleNameReferenceExpression (identifier = String) [String] = external String() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 2)) [format("%i %i %i", arrayOf(1, 2, 3))] = external format("%i %i %i", arrayOf(1, 2, 3))("%i %i %i", external arrayOf(1, 2, 3)(1, 2, 3)) + UIdentifier (Identifier (format)) [UIdentifier (Identifier (format))] + USimpleNameReferenceExpression (identifier = format, resolvesTo = null) [format] = external format("%i %i %i", arrayOf(1, 2, 3))("%i %i %i", external arrayOf(1, 2, 3)(1, 2, 3)) + ULiteralExpression (value = "%i %i %i") ["%i %i %i"] = "%i %i %i" + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 3)) [arrayOf(1, 2, 3)] = external arrayOf(1, 2, 3)(1, 2, 3) + UIdentifier (Identifier (arrayOf)) [UIdentifier (Identifier (arrayOf))] + USimpleNameReferenceExpression (identifier = arrayOf, resolvesTo = null) [arrayOf] = external arrayOf(1, 2, 3)(1, 2, 3) + ULiteralExpression (value = 1) [1] = 1 + ULiteralExpression (value = 2) [2] = 2 + ULiteralExpression (value = 3) [3] = 3 + UQualifiedReferenceExpression [java.lang.String.format("%i %i %i", arrayOf(1, 2, 3), arrayOf(4, 5, 6))] = external format("%i %i %i", arrayOf(1, 2, 3), arrayOf(4, 5, 6))("%i %i %i", external arrayOf(1, 2, 3)(1, 2, 3), external arrayOf(4, 5, 6)(4, 5, 6)) + UQualifiedReferenceExpression [java.lang.String] = external String() + UQualifiedReferenceExpression [java.lang] = external lang() + USimpleNameReferenceExpression (identifier = java) [java] = external java() + USimpleNameReferenceExpression (identifier = lang) [lang] = external lang() + USimpleNameReferenceExpression (identifier = String) [String] = external String() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 3)) [format("%i %i %i", arrayOf(1, 2, 3), arrayOf(4, 5, 6))] = external format("%i %i %i", arrayOf(1, 2, 3), arrayOf(4, 5, 6))("%i %i %i", external arrayOf(1, 2, 3)(1, 2, 3), external arrayOf(4, 5, 6)(4, 5, 6)) + UIdentifier (Identifier (format)) [UIdentifier (Identifier (format))] + USimpleNameReferenceExpression (identifier = format, resolvesTo = null) [format] = external format("%i %i %i", arrayOf(1, 2, 3), arrayOf(4, 5, 6))("%i %i %i", external arrayOf(1, 2, 3)(1, 2, 3), external arrayOf(4, 5, 6)(4, 5, 6)) + ULiteralExpression (value = "%i %i %i") ["%i %i %i"] = "%i %i %i" + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 3)) [arrayOf(1, 2, 3)] = external arrayOf(1, 2, 3)(1, 2, 3) + UIdentifier (Identifier (arrayOf)) [UIdentifier (Identifier (arrayOf))] + USimpleNameReferenceExpression (identifier = arrayOf, resolvesTo = null) [arrayOf] = external arrayOf(1, 2, 3)(1, 2, 3) + ULiteralExpression (value = 1) [1] = 1 + ULiteralExpression (value = 2) [2] = 2 + ULiteralExpression (value = 3) [3] = 3 + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 3)) [arrayOf(4, 5, 6)] = external arrayOf(4, 5, 6)(4, 5, 6) + UIdentifier (Identifier (arrayOf)) [UIdentifier (Identifier (arrayOf))] + USimpleNameReferenceExpression (identifier = arrayOf, resolvesTo = null) [arrayOf] = external arrayOf(4, 5, 6)(4, 5, 6) + ULiteralExpression (value = 4) [4] = 4 + ULiteralExpression (value = 5) [5] = 5 + ULiteralExpression (value = 6) [6] = 6 + UQualifiedReferenceExpression [java.lang.String.format("%i %i %i", "".chunked(2).toTypedArray())] = external format("%i %i %i", "".chunked(2).toTypedArray())("%i %i %i", external toTypedArray()()) + UQualifiedReferenceExpression [java.lang.String] = external String() + UQualifiedReferenceExpression [java.lang] = external lang() + USimpleNameReferenceExpression (identifier = java) [java] = external java() + USimpleNameReferenceExpression (identifier = lang) [lang] = external lang() + USimpleNameReferenceExpression (identifier = String) [String] = external String() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 2)) [format("%i %i %i", "".chunked(2).toTypedArray())] = external format("%i %i %i", "".chunked(2).toTypedArray())("%i %i %i", external toTypedArray()()) + UIdentifier (Identifier (format)) [UIdentifier (Identifier (format))] + USimpleNameReferenceExpression (identifier = format, resolvesTo = null) [format] = external format("%i %i %i", "".chunked(2).toTypedArray())("%i %i %i", external toTypedArray()()) + ULiteralExpression (value = "%i %i %i") ["%i %i %i"] = "%i %i %i" + UQualifiedReferenceExpression ["".chunked(2).toTypedArray()] = external toTypedArray()() + UQualifiedReferenceExpression ["".chunked(2)] = external chunked(2)(2) + ULiteralExpression (value = "") [""] = "" + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [chunked(2)] = external chunked(2)(2) + UIdentifier (Identifier (chunked)) [UIdentifier (Identifier (chunked))] + USimpleNameReferenceExpression (identifier = chunked, resolvesTo = null) [chunked] = external chunked(2)(2) + ULiteralExpression (value = 2) [2] = 2 + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [toTypedArray()] = external toTypedArray()() + UIdentifier (Identifier (toTypedArray)) [UIdentifier (Identifier (toTypedArray))] + USimpleNameReferenceExpression (identifier = toTypedArray, resolvesTo = null) [toTypedArray] = external toTypedArray()() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 2)) [with((), { ...})] = external with((), { + "def".with2Receivers(8, 7.0) +})(external ()(), Undetermined) + UIdentifier (Identifier (with)) [UIdentifier (Identifier (with))] + USimpleNameReferenceExpression (identifier = with, resolvesTo = null) [with] = external with((), { + "def".with2Receivers(8, 7.0) +})(external ()(), Undetermined) + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] = external ()() + UIdentifier (Identifier (A)) [UIdentifier (Identifier (A))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) [] = external ()() + ULambdaExpression [{ ...}] = Undetermined + UBlockExpression [{...}] = external with2Receivers(8, 7.0)(8, (float)7.0) + UQualifiedReferenceExpression ["def".with2Receivers(8, 7.0)] = external with2Receivers(8, 7.0)(8, (float)7.0) + ULiteralExpression (value = "def") ["def"] = "def" + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 2)) [with2Receivers(8, 7.0)] = external with2Receivers(8, 7.0)(8, (float)7.0) + UIdentifier (Identifier (with2Receivers)) [UIdentifier (Identifier (with2Receivers))] + USimpleNameReferenceExpression (identifier = with2Receivers, resolvesTo = null) [with2Receivers] = external with2Receivers(8, 7.0)(8, (float)7.0) + ULiteralExpression (value = 8) [8] = 8 + ULiteralExpression (value = 7.0) [7.0] = (float)7.0 + UMethod (name = objectLiteral) [public static final fun objectLiteral() : void {...}] + UBlockExpression [{...}] = Undetermined + UObjectLiteralExpression [anonymous object : Parent(b = 1, a = "foo") { }] = Undetermined + ULiteralExpression (value = 1) [1] = 1 + ULiteralExpression (value = "foo") ["foo"] = "foo" + UClass (name = null) [final class null : Parent {...}] + UMethod (name = ) [private fun () = UastEmptyExpression] + UClass (name = A) [public final class A {...}] + UMethod (name = with2Receivers) [public final fun with2Receivers(@org.jetbrains.annotations.NotNull $this$with2Receivers: java.lang.String, @org.jetbrains.annotations.NotNull a: int, @org.jetbrains.annotations.NotNull b: float) : void {...}] + UParameter (name = $this$with2Receivers) [@org.jetbrains.annotations.NotNull var $this$with2Receivers: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = a) [@org.jetbrains.annotations.NotNull var a: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = b) [@org.jetbrains.annotations.NotNull var b: float] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Undetermined + UMethod (name = A) [public fun A() = UastEmptyExpression] + UClass (name = Parent) [public class Parent {...}] + UMethod (name = Parent) [public fun Parent(@org.jetbrains.annotations.NotNull a: java.lang.String, @org.jetbrains.annotations.NotNull b: int) = UastEmptyExpression] + UParameter (name = a) [@org.jetbrains.annotations.NotNull var a: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = b) [@org.jetbrains.annotations.NotNull var b: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/ParametersDisorder.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/ParametersDisorder.values.fir.txt new file mode 100644 index 00000000000..7d969d7c6af --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/ParametersDisorder.values.fir.txt @@ -0,0 +1,32 @@ +UFile (package = ) [public final class ParametersDisorderKt {...] + UClass (name = ParametersDisorderKt) [public final class ParametersDisorderKt {...}] + UMethod (name = global) [public static final fun global(a: int, b: float) : void = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = a) [var a: int] + UParameter (name = b) [var b: float] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = withDefault) [public static final fun withDefault(c: int, d: java.lang.String) : void = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = c) [var c: int = [!] UnknownKotlinExpression (INTEGER_CONSTANT)] + [!] UnknownKotlinExpression (INTEGER_CONSTANT) [[!] UnknownKotlinExpression (INTEGER_CONSTANT)] = Undetermined + UParameter (name = d) [var d: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] = Undetermined + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = withReceiver) [public static final fun withReceiver($this$withReceiver: java.lang.String, a: int, b: float) : void = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = $this$withReceiver) [var $this$withReceiver: java.lang.String] + UParameter (name = a) [var a: int] + UParameter (name = b) [var b: float] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = call) [public static final fun call() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = objectLiteral) [public static final fun objectLiteral() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UClass (name = A) [public final class A {...}] + UMethod (name = A) [public fun A() = UastEmptyExpression] + UMethod (name = with2Receivers) [public final fun with2Receivers($this$with2Receivers: java.lang.String, a: int, b: float) : void = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = $this$with2Receivers) [var $this$with2Receivers: java.lang.String] + UParameter (name = a) [var a: int] + UParameter (name = b) [var b: float] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UClass (name = Parent) [public class Parent {...}] + UMethod (name = Parent) [public fun Parent(a: java.lang.String, b: int) = UastEmptyExpression] + UParameter (name = a) [var a: java.lang.String] + UParameter (name = b) [var b: int] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/ParametersWithDefaultValues.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/ParametersWithDefaultValues.values.fe10.txt new file mode 100644 index 00000000000..4e1c8117453 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/ParametersWithDefaultValues.values.fe10.txt @@ -0,0 +1,14 @@ +UFile (package = ) [public final class ParametersWithDefaultValuesKt {...] + UClass (name = ParametersWithDefaultValuesKt) [public final class ParametersWithDefaultValuesKt {...}] + UMethod (name = foo) [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 {...}] + UParameter (name = a) [@org.jetbrains.annotations.NotNull var a: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = b) [@org.jetbrains.annotations.NotNull var b: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = c) [@org.jetbrains.annotations.NotNull var c: int = 0] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + ULiteralExpression (value = 0) [0] = 0 + UParameter (name = flag) [@org.jetbrains.annotations.NotNull var flag: boolean = false] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + ULiteralExpression (value = false) [false] = false + UBlockExpression [{...}] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/ParametersWithDefaultValues.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/ParametersWithDefaultValues.values.fir.txt new file mode 100644 index 00000000000..9e497e84462 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/ParametersWithDefaultValues.values.fir.txt @@ -0,0 +1,10 @@ +UFile (package = ) [public final class ParametersWithDefaultValuesKt {...] + UClass (name = ParametersWithDefaultValuesKt) [public final class ParametersWithDefaultValuesKt {...}] + UMethod (name = foo) [public static final fun foo(a: int, b: java.lang.String, c: int, flag: boolean) : void = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = a) [var a: int] + UParameter (name = b) [var b: java.lang.String] + UParameter (name = c) [var c: int = [!] UnknownKotlinExpression (INTEGER_CONSTANT)] + [!] UnknownKotlinExpression (INTEGER_CONSTANT) [[!] UnknownKotlinExpression (INTEGER_CONSTANT)] = Undetermined + UParameter (name = flag) [var flag: boolean = [!] UnknownKotlinExpression (BOOLEAN_CONSTANT)] + [!] UnknownKotlinExpression (BOOLEAN_CONSTANT) [[!] UnknownKotlinExpression (BOOLEAN_CONSTANT)] = Undetermined + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/PropertyAccessors.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/PropertyAccessors.values.fe10.txt new file mode 100644 index 00000000000..5edac4f731c --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/PropertyAccessors.values.fe10.txt @@ -0,0 +1,23 @@ +UFile (package = ) [public final class PropertyTest {...] + UClass (name = PropertyTest) [public final class PropertyTest {...}] + UMethod (name = getStringRepresentation) [public final fun getStringRepresentation() : java.lang.String {...}] + UBlockExpression [{...}] = Nothing + UReturnExpression [return this.toString()] = Nothing + UQualifiedReferenceExpression [this.toString()] = external toString()() + UThisExpression (label = null) [this] = Undetermined + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [toString()] = external toString()() + UIdentifier (Identifier (toString)) [UIdentifier (Identifier (toString))] + USimpleNameReferenceExpression (identifier = toString, resolvesTo = null) [toString] = external toString()() + UMethod (name = setStringRepresentation) [public final fun setStringRepresentation(@org.jetbrains.annotations.NotNull value: java.lang.String) : void {...}] + UParameter (name = value) [@org.jetbrains.annotations.NotNull var value: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = external setDataFromString(value)(Undetermined) + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [setDataFromString(value)] = external setDataFromString(value)(Undetermined) + UIdentifier (Identifier (setDataFromString)) [UIdentifier (Identifier (setDataFromString))] + USimpleNameReferenceExpression (identifier = setDataFromString, resolvesTo = null) [setDataFromString] = external setDataFromString(value)(Undetermined) + USimpleNameReferenceExpression (identifier = value) [value] = Undetermined + UMethod (name = setDataFromString) [public final fun setDataFromString(@org.jetbrains.annotations.NotNull data: java.lang.String) : void {...}] + UParameter (name = data) [@org.jetbrains.annotations.NotNull var data: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Undetermined + UMethod (name = PropertyTest) [public fun PropertyTest() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/PropertyAccessors.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/PropertyAccessors.values.fir.txt new file mode 100644 index 00000000000..58383da32f3 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/PropertyAccessors.values.fir.txt @@ -0,0 +1,11 @@ +UFile (package = ) [public final class PropertyTest {...] + UClass (name = PropertyTest) [public final class PropertyTest {...}] + UMethod (name = PropertyTest) [public fun PropertyTest() = UastEmptyExpression] + UMethod (name = getStringRepresentation) [public final fun getStringRepresentation() : java.lang.String = [!] UnknownKotlinExpression (DOT_QUALIFIED_EXPRESSION)] + [!] UnknownKotlinExpression (DOT_QUALIFIED_EXPRESSION) [[!] UnknownKotlinExpression (DOT_QUALIFIED_EXPRESSION)] = Undetermined + UMethod (name = setStringRepresentation) [public final fun setStringRepresentation(value: java.lang.String) : void = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = value) [var value: java.lang.String] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = setDataFromString) [public final fun setDataFromString(data: java.lang.String) : void = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = data) [var data: java.lang.String] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/PropertyDelegate.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/PropertyDelegate.values.fe10.txt new file mode 100644 index 00000000000..2f7531c3b8a --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/PropertyDelegate.values.fe10.txt @@ -0,0 +1,48 @@ +UFile (package = ) [public final class PropertyDelegateKt {...] + UClass (name = PropertyDelegateKt) [public final class PropertyDelegateKt {...}] + UField (name = sdCardPath$delegate) [@org.jetbrains.annotations.NotNull private static final var sdCardPath$delegate: kotlin.Lazy] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [lazy({ ...})] = external lazy({ + return "/sdcard" +})(Undetermined) + UIdentifier (Identifier (lazy)) [UIdentifier (Identifier (lazy))] + USimpleNameReferenceExpression (identifier = lazy, resolvesTo = null) [lazy] = external lazy({ + return "/sdcard" +})(Undetermined) + ULambdaExpression [{ ...}] = Undetermined + UBlockExpression [{...}] = Nothing + UReturnExpression [return "/sdcard"] = Nothing + ULiteralExpression (value = "/sdcard") ["/sdcard"] = "/sdcard" + UField (name = annotatedDelegate$delegate) [@org.jetbrains.annotations.NotNull @kotlin.Suppress private static final var annotatedDelegate$delegate: kotlin.Lazy] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UAnnotation (fqName = kotlin.Suppress) [@kotlin.Suppress] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [lazy({ ...})] = external lazy({ + return 1 + 1 +})(Undetermined) + UIdentifier (Identifier (lazy)) [UIdentifier (Identifier (lazy))] + USimpleNameReferenceExpression (identifier = lazy, resolvesTo = null) [lazy] = external lazy({ + return 1 + 1 +})(Undetermined) + ULambdaExpression [{ ...}] = Undetermined + UBlockExpression [{...}] = Nothing + UReturnExpression [return 1 + 1] = Nothing + UBinaryExpression (operator = +) [1 + 1] = 2 + ULiteralExpression (value = 1) [1] = 1 + ULiteralExpression (value = 1) [1] = 1 + UMethod (name = getSdCardPath) [public static final fun getSdCardPath() : java.lang.String = UastEmptyExpression] + UMethod (name = localPropertyTest) [public static final fun localPropertyTest() : void {...}] + UBlockExpression [{...}] = Undetermined + UDeclarationsExpression [var sdCardPathLocal: java.lang.String] = Undetermined + ULocalVariable (name = sdCardPathLocal) [var sdCardPathLocal: java.lang.String] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [lazy({ ...})] = external lazy({ + return "/sdcard" +})(Undetermined) + UIdentifier (Identifier (lazy)) [UIdentifier (Identifier (lazy))] + USimpleNameReferenceExpression (identifier = lazy, resolvesTo = null) [lazy] = external lazy({ + return "/sdcard" +})(Undetermined) + ULambdaExpression [{ ...}] = Undetermined + UBlockExpression [{...}] = Nothing + UReturnExpression [return "/sdcard"] = Nothing + ULiteralExpression (value = "/sdcard") ["/sdcard"] = "/sdcard" + UMethod (name = getAnnotatedDelegate) [public static final fun getAnnotatedDelegate() : int = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/PropertyDelegate.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/PropertyDelegate.values.fir.txt new file mode 100644 index 00000000000..50f306fa6ae --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/PropertyDelegate.values.fir.txt @@ -0,0 +1,6 @@ +UFile (package = ) [public final class PropertyDelegateKt {...] + UClass (name = PropertyDelegateKt) [public final class PropertyDelegateKt {...}] + UMethod (name = getSdCardPath) [public static final fun getSdCardPath() : java.lang.String = UastEmptyExpression] + UMethod (name = localPropertyTest) [public static final fun localPropertyTest() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = getAnnotatedDelegate) [public static final fun getAnnotatedDelegate() : int = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/PropertyInitializer.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/PropertyInitializer.values.fe10.txt new file mode 100644 index 00000000000..1242576931f --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/PropertyInitializer.values.fe10.txt @@ -0,0 +1,17 @@ +UFile (package = ) [public final class TestPropertyInitializer {...] + UClass (name = TestPropertyInitializer) [public final class TestPropertyInitializer {...}] + UField (name = withSetter) [@org.jetbrains.annotations.NotNull private var withSetter: java.lang.String = "/sdcard"] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + ULiteralExpression (value = "/sdcard") ["/sdcard"] = "/sdcard" + UMethod (name = getWithSetter) [public final fun getWithSetter() : java.lang.String {...}] + UBlockExpression [{...}] = Nothing + UReturnExpression [return field] = Nothing + USimpleNameReferenceExpression (identifier = field) [field] = external field() + UMethod (name = setWithSetter) [public final fun setWithSetter(@org.jetbrains.annotations.NotNull p: java.lang.String) : void {...}] + UParameter (name = p) [@org.jetbrains.annotations.NotNull var p: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Undetermined + UBinaryExpression (operator = =) [field = p] = Undetermined + USimpleNameReferenceExpression (identifier = field) [field] = external field() + USimpleNameReferenceExpression (identifier = p) [p] = Undetermined + UMethod (name = TestPropertyInitializer) [public fun TestPropertyInitializer() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/PropertyInitializer.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/PropertyInitializer.values.fir.txt new file mode 100644 index 00000000000..6a9965f448b --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/PropertyInitializer.values.fir.txt @@ -0,0 +1,8 @@ +UFile (package = ) [public final class TestPropertyInitializer {...] + UClass (name = TestPropertyInitializer) [public final class TestPropertyInitializer {...}] + UMethod (name = TestPropertyInitializer) [public fun TestPropertyInitializer() = UastEmptyExpression] + UMethod (name = getWithSetter) [public final fun getWithSetter() : java.lang.String = [!] UnknownKotlinExpression (REFERENCE_EXPRESSION)] + [!] UnknownKotlinExpression (REFERENCE_EXPRESSION) [[!] UnknownKotlinExpression (REFERENCE_EXPRESSION)] = Undetermined + UMethod (name = setWithSetter) [public final fun setWithSetter(p: java.lang.String) : void = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = p) [var p: java.lang.String] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/PropertyInitializerWithoutSetter.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/PropertyInitializerWithoutSetter.values.fe10.txt new file mode 100644 index 00000000000..0f182916925 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/PropertyInitializerWithoutSetter.values.fe10.txt @@ -0,0 +1,12 @@ +UFile (package = ) [public final class PropertyInitializerWithoutSetterKt {...] + UClass (name = PropertyInitializerWithoutSetterKt) [public final class PropertyInitializerWithoutSetterKt {...}] + UField (name = withoutSetter) [@org.jetbrains.annotations.NotNull private static var withoutSetter: java.lang.String = "/sdcard"] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + ULiteralExpression (value = "/sdcard") ["/sdcard"] = "/sdcard" + UMethod (name = getWithoutSetter) [public static final fun getWithoutSetter() : java.lang.String {...}] + UBlockExpression [{...}] = Nothing + UReturnExpression [return field] = Nothing + USimpleNameReferenceExpression (identifier = field) [field] = external field() + UMethod (name = setWithoutSetter) [public static final fun setWithoutSetter(@org.jetbrains.annotations.NotNull withoutSetter: java.lang.String) : void = UastEmptyExpression] + UParameter (name = withoutSetter) [@org.jetbrains.annotations.NotNull var withoutSetter: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/PropertyInitializerWithoutSetter.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/PropertyInitializerWithoutSetter.values.fir.txt new file mode 100644 index 00000000000..7c4d925d15e --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/PropertyInitializerWithoutSetter.values.fir.txt @@ -0,0 +1,8 @@ +UFile (package = ) [public final class PropertyInitializerWithoutSetterKt {...] + UClass (name = PropertyInitializerWithoutSetterKt) [public final class PropertyInitializerWithoutSetterKt {...}] + UField (name = withoutSetter) [private static var withoutSetter: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] = Undetermined + UMethod (name = getWithoutSetter) [public static final fun getWithoutSetter() : java.lang.String = [!] UnknownKotlinExpression (REFERENCE_EXPRESSION)] + [!] UnknownKotlinExpression (REFERENCE_EXPRESSION) [[!] UnknownKotlinExpression (REFERENCE_EXPRESSION)] = Undetermined + UMethod (name = setWithoutSetter) [public static final fun setWithoutSetter(value: java.lang.String) : void = UastEmptyExpression] + UParameter (name = value) [var value: java.lang.String] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/PropertyReferences.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/PropertyReferences.values.fe10.txt new file mode 100644 index 00000000000..7e03ed28863 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/PropertyReferences.values.fe10.txt @@ -0,0 +1,82 @@ +UFile (package = ) [public final class PropertyReferencesKt {...] + UClass (name = PropertyReferencesKt) [public final class PropertyReferencesKt {...}] + UMethod (name = properties) [public static final fun properties() : void {...}] + UBlockExpression [{...}] = external mutableProp() + UDeclarationsExpression [var a: A = (17)] = Undetermined + ULocalVariable (name = a) [var a: A = (17)] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [(17)] = external (17)(17) + UIdentifier (Identifier (A)) [UIdentifier (Identifier (A))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) [] = external (17)(17) + ULiteralExpression (value = 17) [17] = 17 + UDeclarationsExpression [var x: int = -a.mutableProp] = Undetermined + ULocalVariable (name = x) [var x: int = -a.mutableProp] + UPrefixExpression (operator = -) [-a.mutableProp] = Undetermined + UQualifiedReferenceExpression [a.mutableProp] = external mutableProp() + USimpleNameReferenceExpression (identifier = a) [a] = (var a = external (17)(17)) + USimpleNameReferenceExpression (identifier = mutableProp) [mutableProp] = external mutableProp() + UBinaryExpression (operator = =) [a.mutableProp = 1] = Undetermined + UQualifiedReferenceExpression [a.mutableProp] = external mutableProp() + USimpleNameReferenceExpression (identifier = a) [a] = (var a = external (17)(17)) + USimpleNameReferenceExpression (identifier = mutableProp) [mutableProp] = external mutableProp() + ULiteralExpression (value = 1) [1] = 1 + UBinaryExpression (operator = +=) [a.mutableProp += x] = Undetermined + UQualifiedReferenceExpression [a.mutableProp] = external mutableProp() + USimpleNameReferenceExpression (identifier = a) [a] = (var a = external (17)(17)) + USimpleNameReferenceExpression (identifier = mutableProp) [mutableProp] = external mutableProp() + USimpleNameReferenceExpression (identifier = x) [x] = (var x = Undetermined) + UPrefixExpression (operator = ++) [++a.mutableProp] = Undetermined + UQualifiedReferenceExpression [a.mutableProp] = external mutableProp() + USimpleNameReferenceExpression (identifier = a) [a] = (var a = external (17)(17)) + USimpleNameReferenceExpression (identifier = mutableProp) [mutableProp] = external mutableProp() + UPostfixExpression (operator = --) [a.mutableProp--] = external mutableProp() + UQualifiedReferenceExpression [a.mutableProp] = external mutableProp() + USimpleNameReferenceExpression (identifier = a) [a] = (var a = external (17)(17)) + USimpleNameReferenceExpression (identifier = mutableProp) [mutableProp] = external mutableProp() + UMethod (name = ext) [public static final fun ext(@org.jetbrains.annotations.NotNull $this$ext: A) : void {...}] + UParameter (name = $this$ext) [@org.jetbrains.annotations.NotNull var $this$ext: A] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = external mutableProp() + UDeclarationsExpression [var x: int = -mutableProp] = Undetermined + ULocalVariable (name = x) [var x: int = -mutableProp] + UPrefixExpression (operator = -) [-mutableProp] = Undetermined + USimpleNameReferenceExpression (identifier = mutableProp) [mutableProp] = external mutableProp() + UBinaryExpression (operator = =) [mutableProp = 1] = Undetermined + USimpleNameReferenceExpression (identifier = mutableProp) [mutableProp] = external mutableProp() + ULiteralExpression (value = 1) [1] = 1 + UBinaryExpression (operator = +=) [mutableProp += x] = Undetermined + USimpleNameReferenceExpression (identifier = mutableProp) [mutableProp] = external mutableProp() + USimpleNameReferenceExpression (identifier = x) [x] = (var x = Undetermined) + UPrefixExpression (operator = ++) [++mutableProp] = Undetermined + USimpleNameReferenceExpression (identifier = mutableProp) [mutableProp] = external mutableProp() + UPostfixExpression (operator = --) [mutableProp--] = external mutableProp() + USimpleNameReferenceExpression (identifier = mutableProp) [mutableProp] = external mutableProp() + UClass (name = A) [public final class A {...}] + UField (name = privateProp) [@org.jetbrains.annotations.NotNull private var privateProp: int = 0] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + ULiteralExpression (value = 0) [0] = 0 + UField (name = mutableProp) [@org.jetbrains.annotations.NotNull private var mutableProp: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UMethod (name = getMutableProp) [public final fun getMutableProp() : int = UastEmptyExpression] + UMethod (name = setMutableProp) [public final fun setMutableProp(@null mutableProp: int) : void = UastEmptyExpression] + UParameter (name = mutableProp) [@null var mutableProp: int] + UAnnotation (fqName = null) [@null] + UMethod (name = add) [public final fun add(@org.jetbrains.annotations.NotNull x: int) : int {...}] + UParameter (name = x) [@org.jetbrains.annotations.NotNull var x: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UDeclarationsExpression [var result: int = privateProp] = Undetermined + ULocalVariable (name = result) [var result: int = privateProp] + USimpleNameReferenceExpression (identifier = privateProp) [privateProp] = external privateProp() + UBinaryExpression (operator = =) [privateProp = x] = Undetermined + USimpleNameReferenceExpression (identifier = privateProp) [privateProp] = external privateProp() + USimpleNameReferenceExpression (identifier = x) [x] = Undetermined + UReturnExpression [return privateProp] = Nothing + USimpleNameReferenceExpression (identifier = privateProp) [privateProp] = external privateProp() + UMethod (name = A) [public fun A(@org.jetbrains.annotations.NotNull init: int) {...}] + UParameter (name = init) [@org.jetbrains.annotations.NotNull var init: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Undetermined + UBlockExpression [{...}] = Undetermined + UBinaryExpression (operator = =) [mutableProp = init] = Undetermined + USimpleNameReferenceExpression (identifier = mutableProp) [mutableProp] = external mutableProp() + USimpleNameReferenceExpression (identifier = init) [init] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/PropertyReferences.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/PropertyReferences.values.fir.txt new file mode 100644 index 00000000000..cd5f949e712 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/PropertyReferences.values.fir.txt @@ -0,0 +1,19 @@ +UFile (package = ) [public final class PropertyReferencesKt {...] + UClass (name = PropertyReferencesKt) [public final class PropertyReferencesKt {...}] + UMethod (name = properties) [public static final fun properties() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = ext) [public static final fun ext($this$ext: A) : void = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = $this$ext) [var $this$ext: A] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UClass (name = A) [public final class A {...}] + UField (name = privateProp) [private var privateProp: int = [!] UnknownKotlinExpression (INTEGER_CONSTANT)] + [!] UnknownKotlinExpression (INTEGER_CONSTANT) [[!] UnknownKotlinExpression (INTEGER_CONSTANT)] = Undetermined + UField (name = mutableProp) [private var mutableProp: int] + UMethod (name = A) [public fun A(init: int) = UastEmptyExpression] + UParameter (name = init) [var init: int] + UMethod (name = getMutableProp) [public final fun getMutableProp() : int = UastEmptyExpression] + UMethod (name = setMutableProp) [public final fun setMutableProp(value: int) : void = UastEmptyExpression] + UParameter (name = value) [var value: int] + UMethod (name = add) [public final fun add(x: int) : int = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = x) [var x: int] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/PropertyWithAnnotation.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/PropertyWithAnnotation.values.fe10.txt new file mode 100644 index 00000000000..5d0da1618e8 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/PropertyWithAnnotation.values.fe10.txt @@ -0,0 +1,28 @@ +UFile (package = ) [public final class PropertyWithAnnotationKt {...] + UClass (name = PropertyWithAnnotationKt) [public final class PropertyWithAnnotationKt {...}] + UField (name = prop1) [@org.jetbrains.annotations.NotNull @TestAnnotation private static final var prop1: int = 0] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UAnnotation (fqName = TestAnnotation) [@TestAnnotation] + ULiteralExpression (value = 0) [0] = 0 + UField (name = prop3) [@org.jetbrains.annotations.NotNull private static var prop3: int = 0] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + ULiteralExpression (value = 0) [0] = 0 + UMethod (name = getProp1) [public static final fun getProp1() : int = UastEmptyExpression] + UMethod (name = getProp2) [@TestAnnotation...}] + UAnnotation (fqName = TestAnnotation) [@TestAnnotation] + UBlockExpression [{...}] = Nothing + UReturnExpression [return 0] = Nothing + ULiteralExpression (value = 0) [0] = 0 + UMethod (name = getProp3) [public static final fun getProp3() : int {...}] + UBlockExpression [{...}] = Nothing + UReturnExpression [return 0] = Nothing + ULiteralExpression (value = 0) [0] = 0 + UMethod (name = setProp3) [@TestAnnotation...}] + UAnnotation (fqName = TestAnnotation) [@TestAnnotation] + UParameter (name = value) [@org.jetbrains.annotations.NotNull var value: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Undetermined + UBinaryExpression (operator = =) [field = value] = Undetermined + USimpleNameReferenceExpression (identifier = field) [field] = external field() + USimpleNameReferenceExpression (identifier = value) [value] = Undetermined + UClass (name = TestAnnotation) [public abstract annotation TestAnnotation {...}] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/PropertyWithAnnotation.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/PropertyWithAnnotation.values.fir.txt new file mode 100644 index 00000000000..5ea7cc5e8d4 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/PropertyWithAnnotation.values.fir.txt @@ -0,0 +1,13 @@ +UFile (package = ) [public final class PropertyWithAnnotationKt {...] + UClass (name = PropertyWithAnnotationKt) [public final class PropertyWithAnnotationKt {...}] + UField (name = prop1) [private static final var prop1: int = [!] UnknownKotlinExpression (INTEGER_CONSTANT)] + [!] UnknownKotlinExpression (INTEGER_CONSTANT) [[!] UnknownKotlinExpression (INTEGER_CONSTANT)] = Undetermined + UMethod (name = getProp1) [public static final fun getProp1() : int = UastEmptyExpression] + UMethod (name = getProp2) [public static final fun getProp2() : int = [!] UnknownKotlinExpression (INTEGER_CONSTANT)] + [!] UnknownKotlinExpression (INTEGER_CONSTANT) [[!] UnknownKotlinExpression (INTEGER_CONSTANT)] = Undetermined + UMethod (name = getProp3) [public static final fun getProp3() : int = [!] UnknownKotlinExpression (INTEGER_CONSTANT)] + [!] UnknownKotlinExpression (INTEGER_CONSTANT) [[!] UnknownKotlinExpression (INTEGER_CONSTANT)] = Undetermined + UMethod (name = setProp3) [public static final fun setProp3(value: int) : void = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = value) [var value: int] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UClass (name = TestAnnotation) [public abstract annotation TestAnnotation {...}] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/QualifiedConstructorCall.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/QualifiedConstructorCall.values.fe10.txt new file mode 100644 index 00000000000..b0cbc7957da --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/QualifiedConstructorCall.values.fe10.txt @@ -0,0 +1,17 @@ +UFile (package = A.B.C) [package A.B.C...] + UClass (name = Foo) [public final class Foo {...}] + UMethod (name = Foo) [public fun Foo() = UastEmptyExpression] + UClass (name = Bar) [public final class Bar {...}] + UMethod (name = getFoo) [public final fun getFoo() : A.B.C.Foo {...}] + UBlockExpression [{...}] = Nothing + UReturnExpression [return A.B.C.()] = Nothing + UQualifiedReferenceExpression [A.B.C.()] = external ()() + UQualifiedReferenceExpression [A.B.C] = external C() + UQualifiedReferenceExpression [A.B] = external B() + USimpleNameReferenceExpression (identifier = A) [A] = external A() + USimpleNameReferenceExpression (identifier = B) [B] = external B() + USimpleNameReferenceExpression (identifier = C) [C] = external C() + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] = external ()() + UIdentifier (Identifier (Foo)) [UIdentifier (Identifier (Foo))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Foo) [] = external ()() + UMethod (name = Bar) [public fun Bar() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/QualifiedConstructorCall.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/QualifiedConstructorCall.values.fir.txt new file mode 100644 index 00000000000..fc64a2ba9b0 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/QualifiedConstructorCall.values.fir.txt @@ -0,0 +1,7 @@ +UFile (package = A.B.C) [package A.B.C...] + UClass (name = Foo) [public final class Foo {...}] + UMethod (name = Foo) [public fun Foo() = UastEmptyExpression] + UClass (name = Bar) [public final class Bar {...}] + UMethod (name = Bar) [public fun Bar() = UastEmptyExpression] + UMethod (name = getFoo) [public final fun getFoo() : A.B.C.Foo = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/ReceiverFun.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/ReceiverFun.values.fe10.txt new file mode 100644 index 00000000000..56471fe5eb6 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/ReceiverFun.values.fe10.txt @@ -0,0 +1,25 @@ +UFile (package = ) [public final class ReceiverFunKt {...] + UClass (name = ReceiverFunKt) [public final class ReceiverFunKt {...}] + UMethod (name = foo) [public static final fun foo(@MyReceiverAnnotation @org.jetbrains.annotations.NotNull $this$foo: java.lang.String) : int {...}] + UParameter (name = $this$foo) [@MyReceiverAnnotation @org.jetbrains.annotations.NotNull var $this$foo: java.lang.String] + UAnnotation (fqName = MyReceiverAnnotation) [@MyReceiverAnnotation] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UReturnExpression [return this.length] = Nothing + UQualifiedReferenceExpression [this.length] = external length() + UThisExpression (label = null) [this] = Undetermined + USimpleNameReferenceExpression (identifier = length) [length] = external length() + UMethod (name = getRx) [public static final fun getRx(@MyReceiverAnnotation(name = "RegExp") @org.jetbrains.annotations.NotNull $this$getRx: java.lang.String) : kotlin.text.Regex {...}] + UParameter (name = $this$getRx) [@MyReceiverAnnotation(name = "RegExp") @org.jetbrains.annotations.NotNull var $this$getRx: java.lang.String] + UAnnotation (fqName = MyReceiverAnnotation) [@MyReceiverAnnotation(name = "RegExp")] + UNamedExpression (name = name) [name = "RegExp"] = Undetermined + ULiteralExpression (value = "RegExp") ["RegExp"] = "RegExp" + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UReturnExpression [return toRegex()] = Nothing + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [toRegex()] = external toRegex()() + UIdentifier (Identifier (toRegex)) [UIdentifier (Identifier (toRegex))] + USimpleNameReferenceExpression (identifier = toRegex, resolvesTo = null) [toRegex] = external toRegex()() + UClass (name = MyReceiverAnnotation) [public abstract annotation MyReceiverAnnotation {...}] + UAnnotationMethod (name = name) [public abstract fun name() : java.lang.String = UastEmptyExpression] + ULiteralExpression (value = "") [""] = "" diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/ReceiverFun.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/ReceiverFun.values.fir.txt new file mode 100644 index 00000000000..89ac0594d0f --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/ReceiverFun.values.fir.txt @@ -0,0 +1,10 @@ +UFile (package = ) [public final class ReceiverFunKt {...] + UClass (name = ReceiverFunKt) [public final class ReceiverFunKt {...}] + UMethod (name = foo) [public static final fun foo($this$foo: java.lang.String) : int = [!] UnknownKotlinExpression (DOT_QUALIFIED_EXPRESSION)] + UParameter (name = $this$foo) [var $this$foo: java.lang.String] + [!] UnknownKotlinExpression (DOT_QUALIFIED_EXPRESSION) [[!] UnknownKotlinExpression (DOT_QUALIFIED_EXPRESSION)] = Undetermined + UMethod (name = getRx) [public static final fun getRx($this$rx: java.lang.String) : kotlin.text.Regex = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = $this$rx) [var $this$rx: java.lang.String] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UClass (name = MyReceiverAnnotation) [public abstract annotation MyReceiverAnnotation {...}] + UMethod (name = name) [public abstract fun name() : java.lang.String = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/Reified.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/Reified.values.fe10.txt new file mode 100644 index 00000000000..be2f814b944 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/Reified.values.fe10.txt @@ -0,0 +1,44 @@ +UFile (package = test.pkg) [package test.pkg...] + UClass (name = ReifiedKt) [public final class ReifiedKt {...}] + UMethod (name = systemService2) [public static final fun systemService2(@org.jetbrains.annotations.NotNull $this$systemService2: test.pkg.Context) : error.NonExistentClass {...}] + UParameter (name = $this$systemService2) [@org.jetbrains.annotations.NotNull var $this$systemService2: test.pkg.Context] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UReturnExpression [return (java.lang.String.java)] = Nothing + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [(java.lang.String.java)] = external (java.lang.String.java)(external java()) + UIdentifier (Identifier (getSystemService)) [UIdentifier (Identifier (getSystemService))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] = external (java.lang.String.java)(external java()) + UQualifiedReferenceExpression [java.lang.String.java] = external java() + UClassLiteralExpression [java.lang.String] = java.lang.String + USimpleNameReferenceExpression (identifier = java) [java] = external java() + UMethod (name = systemService1) [static fun systemService1(@org.jetbrains.annotations.NotNull $this$systemService1: test.pkg.Context) : {...}] + UParameter (name = $this$systemService1) [@org.jetbrains.annotations.NotNull var $this$systemService1: test.pkg.Context] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UReturnExpression [return (T.java)] = Nothing + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [(T.java)] = external (T.java)(external java()) + UIdentifier (Identifier (getSystemService)) [UIdentifier (Identifier (getSystemService))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] = external (T.java)(external java()) + UQualifiedReferenceExpression [T.java] = external java() + UClassLiteralExpression [T] = T + USimpleNameReferenceExpression (identifier = java) [java] = external java() + UClass (name = Context) [public final class Context {...}] + UMethod (name = ownSystemService2) [public final fun ownSystemService2() : error.NonExistentClass {...}] + UBlockExpression [{...}] = Nothing + UReturnExpression [return (java.lang.String.java)] = Nothing + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [(java.lang.String.java)] = external (java.lang.String.java)(external java()) + UIdentifier (Identifier (getSystemService)) [UIdentifier (Identifier (getSystemService))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] = external (java.lang.String.java)(external java()) + UQualifiedReferenceExpression [java.lang.String.java] = external java() + UClassLiteralExpression [java.lang.String] = java.lang.String + USimpleNameReferenceExpression (identifier = java) [java] = external java() + UMethod (name = Context) [public fun Context() = UastEmptyExpression] + UMethod (name = ownSystemService1) [fun ownSystemService1() : {...}] + UBlockExpression [{...}] = Nothing + UReturnExpression [return (T.java)] = Nothing + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [(T.java)] = external (T.java)(external java()) + UIdentifier (Identifier (getSystemService)) [UIdentifier (Identifier (getSystemService))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] = external (T.java)(external java()) + UQualifiedReferenceExpression [T.java] = external java() + UClassLiteralExpression [T] = T + USimpleNameReferenceExpression (identifier = java) [java] = external java() diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/Reified.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/Reified.values.fir.txt new file mode 100644 index 00000000000..97a55152fb2 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/Reified.values.fir.txt @@ -0,0 +1,4 @@ +UFile (package = test.pkg) [package test.pkg...] + UClass (name = ReifiedKt) [public final class ReifiedKt {...}] + UClass (name = Context) [public final class Context {...}] + UMethod (name = Context) [public fun Context() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/ReifiedParameters.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/ReifiedParameters.values.fe10.txt new file mode 100644 index 00000000000..02915d61132 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/ReifiedParameters.values.fe10.txt @@ -0,0 +1,57 @@ +UFile (package = ) [public final class ReifiedParametersKt {...] + UClass (name = ReifiedParametersKt) [public final class ReifiedParametersKt {...}] + UMethod (name = functionWithLambda) [static fun functionWithLambda(@org.jetbrains.annotations.Nullable t: T, @org.jetbrains.annotations.NotNull process: kotlin.jvm.functions.Function1) : int {...}] + UParameter (name = t) [@org.jetbrains.annotations.Nullable var t: T] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] + UParameter (name = process) [@org.jetbrains.annotations.NotNull var process: kotlin.jvm.functions.Function1] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UReturnExpression [return invoke(t)] = Nothing + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [invoke(t)] = external invoke(t)(Undetermined) + UIdentifier (Identifier (process)) [UIdentifier (Identifier (process))] + USimpleNameReferenceExpression (identifier = invoke, resolvesTo = null) [invoke] = external invoke(t)(Undetermined) + USimpleNameReferenceExpression (identifier = t) [t] = Undetermined + UMethod (name = functionWithVararg) [static fun functionWithVararg(@org.jetbrains.annotations.Nullable i: int, @org.jetbrains.annotations.Nullable t: T) : T {...}] + UParameter (name = i) [@org.jetbrains.annotations.Nullable var i: int] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] + UParameter (name = t) [@org.jetbrains.annotations.Nullable var t: T] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] + UBlockExpression [{...}] = Nothing + UReturnExpression [return t[0]] = Nothing + UArrayAccessExpression [t[0]] = Undetermined + USimpleNameReferenceExpression (identifier = t) [t] = Undetermined + ULiteralExpression (value = 0) [0] = 0 + UMethod (name = functionWithReceiver) [static fun functionWithReceiver(@org.jetbrains.annotations.Nullable $this$functionWithReceiver: T, @org.jetbrains.annotations.Nullable i: int) : T {...}] + UParameter (name = $this$functionWithReceiver) [@org.jetbrains.annotations.Nullable var $this$functionWithReceiver: T] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] + UParameter (name = i) [@org.jetbrains.annotations.Nullable var i: int] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] + UBlockExpression [{...}] = Nothing + UReturnExpression [return this] = Nothing + UThisExpression (label = null) [this] = Undetermined + UMethod (name = name with spaces) [static fun name with spaces(@org.jetbrains.annotations.Nullable $this$name with spaces: T, @org.jetbrains.annotations.Nullable i: int) : T {...}] + UParameter (name = $this$name with spaces) [@org.jetbrains.annotations.Nullable var $this$name with spaces: T] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] + UParameter (name = i) [@org.jetbrains.annotations.Nullable var i: int] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] + UBlockExpression [{...}] = Nothing + UReturnExpression [return this] = Nothing + UThisExpression (label = null) [this] = Undetermined + UMethod (name = functionWithParamAnnotation) [static fun functionWithParamAnnotation(@org.jetbrains.annotations.Nullable @kotlin.Suppress(names = "s") t: T) : T {...}] + UParameter (name = t) [@org.jetbrains.annotations.Nullable @kotlin.Suppress(names = "s") var t: T] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] + UAnnotation (fqName = kotlin.Suppress) [@kotlin.Suppress(names = "s")] + UNamedExpression (name = names) [names = "s"] = Nothing + ULiteralExpression (value = "s") ["s"] = "s" + UBlockExpression [{...}] = Nothing + UReturnExpression [return t] = Nothing + USimpleNameReferenceExpression (identifier = t) [t] = Undetermined + UMethod (name = functionUnresolved) [static fun functionUnresolved(@org.jetbrains.annotations.NotNull @kotlin.Suppress(names = "s") t: ) : T {...}] + UParameter (name = t) [@org.jetbrains.annotations.NotNull @kotlin.Suppress(names = "s") var t: ] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UAnnotation (fqName = kotlin.Suppress) [@kotlin.Suppress(names = "s")] + UNamedExpression (name = names) [names = "s"] = Nothing + ULiteralExpression (value = "s") ["s"] = "s" + UBlockExpression [{...}] = Nothing + UReturnExpression [return t] = Nothing + USimpleNameReferenceExpression (identifier = t) [t] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/ReifiedParameters.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/ReifiedParameters.values.fir.txt new file mode 100644 index 00000000000..f3531fa5917 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/ReifiedParameters.values.fir.txt @@ -0,0 +1,2 @@ +UFile (package = ) [public final class ReifiedParametersKt {...] + UClass (name = ReifiedParametersKt) [public final class ReifiedParametersKt {...}] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/ReifiedResolve.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/ReifiedResolve.values.fe10.txt new file mode 100644 index 00000000000..df9e6689da0 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/ReifiedResolve.values.fe10.txt @@ -0,0 +1,50 @@ +UFile (package = ) [public final class ReifiedResolveKt {...] + UClass (name = ReifiedResolveKt) [public final class ReifiedResolveKt {...}] + UMethod (name = bar) [public static final fun bar(@org.jetbrains.annotations.NotNull init: kotlin.jvm.functions.Function1) : T {...}] + UParameter (name = init) [@org.jetbrains.annotations.NotNull var init: kotlin.jvm.functions.Function1 = { ...}] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + ULambdaExpression [{ ...}] = Undetermined + UBlockExpression [{...}] = Undetermined + UBlockExpression [{...}] = external TODO("message")("message") + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [TODO("message")] = external TODO("message")("message") + UIdentifier (Identifier (TODO)) [UIdentifier (Identifier (TODO))] + USimpleNameReferenceExpression (identifier = TODO, resolvesTo = null) [TODO] = external TODO("message")("message") + ULiteralExpression (value = "message") ["message"] = "message" + UMethod (name = resolve) [public static final fun resolve() : void {...}] + UBlockExpression [{...}] = Undetermined + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [foo()] = external foo()() + UIdentifier (Identifier (foo)) [UIdentifier (Identifier (foo))] + USimpleNameReferenceExpression (identifier = foo, resolvesTo = null) [foo] = external foo()() + UDeclarationsExpression [var x: java.lang.String = foo()] = Undetermined + ULocalVariable (name = x) [var x: java.lang.String = foo()] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [foo()] = external foo()() + UIdentifier (Identifier (foo)) [UIdentifier (Identifier (foo))] + USimpleNameReferenceExpression (identifier = foo, resolvesTo = null) [foo] = external foo()() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [bar()] = external bar()() + UIdentifier (Identifier (bar)) [UIdentifier (Identifier (bar))] + USimpleNameReferenceExpression (identifier = bar, resolvesTo = null) [bar] = external bar()() + UDeclarationsExpression [var y: java.lang.String = bar()] = Undetermined + ULocalVariable (name = y) [var y: java.lang.String = bar()] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [bar()] = external bar()() + UIdentifier (Identifier (bar)) [UIdentifier (Identifier (bar))] + USimpleNameReferenceExpression (identifier = bar, resolvesTo = null) [bar] = external bar()() + UDeclarationsExpression [var z: java.util.List = listOf("foo").filterIsInstance()] = Undetermined + ULocalVariable (name = z) [var z: java.util.List = listOf("foo").filterIsInstance()] + UQualifiedReferenceExpression [listOf("foo").filterIsInstance()] = external filterIsInstance()() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [listOf("foo")] = external listOf("foo")("foo") + UIdentifier (Identifier (listOf)) [UIdentifier (Identifier (listOf))] + USimpleNameReferenceExpression (identifier = listOf, resolvesTo = null) [listOf] = external listOf("foo")("foo") + ULiteralExpression (value = "foo") ["foo"] = "foo" + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [filterIsInstance()] = external filterIsInstance()() + UIdentifier (Identifier (filterIsInstance)) [UIdentifier (Identifier (filterIsInstance))] + USimpleNameReferenceExpression (identifier = filterIsInstance, resolvesTo = null) [filterIsInstance] = external filterIsInstance()() + UMethod (name = foo) [static fun foo(@org.jetbrains.annotations.NotNull init: kotlin.jvm.functions.Function1) : T {...}] + UParameter (name = init) [@org.jetbrains.annotations.NotNull var init: kotlin.jvm.functions.Function1 = { ...}] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + ULambdaExpression [{ ...}] = Undetermined + UBlockExpression [{...}] = Undetermined + UBlockExpression [{...}] = external TODO("message")("message") + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [TODO("message")] = external TODO("message")("message") + UIdentifier (Identifier (TODO)) [UIdentifier (Identifier (TODO))] + USimpleNameReferenceExpression (identifier = TODO, resolvesTo = null) [TODO] = external TODO("message")("message") + ULiteralExpression (value = "message") ["message"] = "message" diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/ReifiedResolve.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/ReifiedResolve.values.fir.txt new file mode 100644 index 00000000000..27d169d6927 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/ReifiedResolve.values.fir.txt @@ -0,0 +1,4 @@ +UFile (package = ) [public final class ReifiedResolveKt {...] + UClass (name = ReifiedResolveKt) [public final class ReifiedResolveKt {...}] + UMethod (name = resolve) [public static final fun resolve() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/ReifiedReturnType.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/ReifiedReturnType.values.fe10.txt new file mode 100644 index 00000000000..7708d8a42e3 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/ReifiedReturnType.values.fe10.txt @@ -0,0 +1,163 @@ +UFile (package = ) [public final class ReifiedReturnTypeKt {...] + UClass (name = ReifiedReturnTypeKt) [public final class ReifiedReturnTypeKt {...}] + UMethod (name = function1) [public static final fun function1(@org.jetbrains.annotations.Nullable t: T, @org.jetbrains.annotations.NotNull i: int, @org.jetbrains.annotations.NotNull s: java.lang.String) : void {...}] + UParameter (name = t) [@org.jetbrains.annotations.Nullable var t: T] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] + UParameter (name = i) [@org.jetbrains.annotations.NotNull var i: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = s) [@org.jetbrains.annotations.NotNull var s: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Undetermined + UMethod (name = function2) [public static final fun function2(@org.jetbrains.annotations.Nullable t: T, @org.jetbrains.annotations.NotNull i: int, @org.jetbrains.annotations.NotNull s: java.lang.String) : T {...}] + UParameter (name = t) [@org.jetbrains.annotations.Nullable var t: T] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] + UParameter (name = i) [@org.jetbrains.annotations.NotNull var i: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = s) [@org.jetbrains.annotations.NotNull var s: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UReturnExpression [return t] = Nothing + USimpleNameReferenceExpression (identifier = t) [t] = Undetermined + UMethod (name = function2CharSequence) [public static final fun function2CharSequence(@org.jetbrains.annotations.NotNull t: T, @org.jetbrains.annotations.NotNull i: int, @org.jetbrains.annotations.NotNull s: java.lang.String) : T {...}] + UParameter (name = t) [@org.jetbrains.annotations.NotNull var t: T] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = i) [@org.jetbrains.annotations.NotNull var i: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = s) [@org.jetbrains.annotations.NotNull var s: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UReturnExpression [return t] = Nothing + USimpleNameReferenceExpression (identifier = t) [t] = Undetermined + UMethod (name = copyWhenGreater) [public static final fun copyWhenGreater(@org.jetbrains.annotations.NotNull list: java.util.List, @org.jetbrains.annotations.NotNull threshold: T, @org.jetbrains.annotations.NotNull threshold2: B) : B {...}] + UParameter (name = list) [@org.jetbrains.annotations.NotNull var list: java.util.List] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = threshold) [@org.jetbrains.annotations.NotNull var threshold: T] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = threshold2) [@org.jetbrains.annotations.NotNull var threshold2: B] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UReturnExpression [return threshold2] = Nothing + USimpleNameReferenceExpression (identifier = threshold2) [threshold2] = Undetermined + UMethod (name = function3) [static fun function3(@org.jetbrains.annotations.Nullable t: T, @org.jetbrains.annotations.NotNull i: int, @org.jetbrains.annotations.NotNull s: java.lang.String) : void {...}] + UParameter (name = t) [@org.jetbrains.annotations.Nullable var t: T] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] + UParameter (name = i) [@org.jetbrains.annotations.NotNull var i: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = s) [@org.jetbrains.annotations.NotNull var s: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Undetermined + UMethod (name = function4) [static fun function4(@org.jetbrains.annotations.Nullable t: T, @org.jetbrains.annotations.NotNull i: int, @org.jetbrains.annotations.NotNull s: java.lang.String) : T {...}] + UParameter (name = t) [@org.jetbrains.annotations.Nullable var t: T] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] + UParameter (name = i) [@org.jetbrains.annotations.NotNull var i: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = s) [@org.jetbrains.annotations.NotNull var s: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UReturnExpression [return t] = Nothing + USimpleNameReferenceExpression (identifier = t) [t] = Undetermined + UMethod (name = function5) [static fun function5(@org.jetbrains.annotations.Nullable t: T, @org.jetbrains.annotations.NotNull i: int, @org.jetbrains.annotations.NotNull s: java.lang.String) : int {...}] + UParameter (name = t) [@org.jetbrains.annotations.Nullable var t: T] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] + UParameter (name = i) [@org.jetbrains.annotations.NotNull var i: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = s) [@org.jetbrains.annotations.NotNull var s: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UReturnExpression [return 42] = Nothing + ULiteralExpression (value = 42) [42] = 42 + UMethod (name = function6) [static fun function6(@org.jetbrains.annotations.Nullable $this$function6: T, @org.jetbrains.annotations.Nullable t: T, @org.jetbrains.annotations.NotNull i: int, @org.jetbrains.annotations.NotNull s: java.lang.String) : T {...}] + UParameter (name = $this$function6) [@org.jetbrains.annotations.Nullable var $this$function6: T] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] + UParameter (name = t) [@org.jetbrains.annotations.Nullable var t: T] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] + UParameter (name = i) [@org.jetbrains.annotations.NotNull var i: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = s) [@org.jetbrains.annotations.NotNull var s: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UReturnExpression [return t] = Nothing + USimpleNameReferenceExpression (identifier = t) [t] = Undetermined + UMethod (name = function7) [static fun function7(@org.jetbrains.annotations.Nullable t: T, @org.jetbrains.annotations.NotNull i: int, @org.jetbrains.annotations.NotNull s: java.lang.String) : T {...}] + UParameter (name = t) [@org.jetbrains.annotations.Nullable var t: T] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] + UParameter (name = i) [@org.jetbrains.annotations.NotNull var i: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = s) [@org.jetbrains.annotations.NotNull var s: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UReturnExpression [return t] = Nothing + USimpleNameReferenceExpression (identifier = t) [t] = Undetermined + UMethod (name = function8) [static fun function8(@org.jetbrains.annotations.Nullable t: T, @org.jetbrains.annotations.NotNull i: int, @org.jetbrains.annotations.NotNull s: java.lang.String) : T {...}] + UParameter (name = t) [@org.jetbrains.annotations.Nullable var t: T] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] + UParameter (name = i) [@org.jetbrains.annotations.NotNull var i: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = s) [@org.jetbrains.annotations.NotNull var s: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UReturnExpression [return t] = Nothing + USimpleNameReferenceExpression (identifier = t) [t] = Undetermined + UMethod (name = function9) [static fun function9(@org.jetbrains.annotations.Nullable t: T, @org.jetbrains.annotations.NotNull i: int, @org.jetbrains.annotations.NotNull s: java.lang.String) : T {...}] + UParameter (name = t) [@org.jetbrains.annotations.Nullable var t: T] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] + UParameter (name = i) [@org.jetbrains.annotations.NotNull var i: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = s) [@org.jetbrains.annotations.NotNull var s: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UReturnExpression [return t] = Nothing + USimpleNameReferenceExpression (identifier = t) [t] = Undetermined + UMethod (name = function10) [static fun function10(@org.jetbrains.annotations.Nullable t: T, @org.jetbrains.annotations.NotNull i: int, @org.jetbrains.annotations.NotNull s: java.lang.String) : T {...}] + UParameter (name = t) [@org.jetbrains.annotations.Nullable var t: T] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] + UParameter (name = i) [@org.jetbrains.annotations.NotNull var i: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = s) [@org.jetbrains.annotations.NotNull var s: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UReturnExpression [return t] = Nothing + USimpleNameReferenceExpression (identifier = t) [t] = Undetermined + UMethod (name = function11) [static fun function11(@org.jetbrains.annotations.Nullable $this$function11: T, @org.jetbrains.annotations.Nullable t: T, @org.jetbrains.annotations.NotNull i: int, @org.jetbrains.annotations.NotNull s: java.lang.String) : T {...}] + UParameter (name = $this$function11) [@org.jetbrains.annotations.Nullable var $this$function11: T] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] + UParameter (name = t) [@org.jetbrains.annotations.Nullable var t: T] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] + UParameter (name = i) [@org.jetbrains.annotations.NotNull var i: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = s) [@org.jetbrains.annotations.NotNull var s: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UReturnExpression [return t] = Nothing + USimpleNameReferenceExpression (identifier = t) [t] = Undetermined + UMethod (name = function11CharSequence) [static fun function11CharSequence(@org.jetbrains.annotations.NotNull $this$function11CharSequence: T, @org.jetbrains.annotations.NotNull t: T, @org.jetbrains.annotations.NotNull i: int, @org.jetbrains.annotations.NotNull s: java.lang.String) : T {...}] + UParameter (name = $this$function11CharSequence) [@org.jetbrains.annotations.NotNull var $this$function11CharSequence: T] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = t) [@org.jetbrains.annotations.NotNull var t: T] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = i) [@org.jetbrains.annotations.NotNull var i: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = s) [@org.jetbrains.annotations.NotNull var s: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UReturnExpression [return t] = Nothing + USimpleNameReferenceExpression (identifier = t) [t] = Undetermined + UMethod (name = function12CharSequence) [static fun function12CharSequence(@org.jetbrains.annotations.NotNull $this$function12CharSequence: T, @org.jetbrains.annotations.NotNull t: B, @org.jetbrains.annotations.NotNull i: T, @org.jetbrains.annotations.NotNull s: java.lang.String) : B {...}] + UParameter (name = $this$function12CharSequence) [@org.jetbrains.annotations.NotNull var $this$function12CharSequence: T] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = t) [@org.jetbrains.annotations.NotNull var t: B] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = i) [@org.jetbrains.annotations.NotNull var i: T] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = s) [@org.jetbrains.annotations.NotNull var s: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UReturnExpression [return t] = Nothing + USimpleNameReferenceExpression (identifier = t) [t] = Undetermined + UClass (name = Foo) [public final class Foo {...}] + UMethod (name = Foo) [public fun Foo() = UastEmptyExpression] + UMethod (name = foo) [fun foo() : Z {...}] + UBlockExpression [{...}] = external TODO()() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [TODO()] = external TODO()() + UIdentifier (Identifier (TODO)) [UIdentifier (Identifier (TODO))] + USimpleNameReferenceExpression (identifier = TODO, resolvesTo = null) [TODO] = external TODO()() diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/ReifiedReturnType.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/ReifiedReturnType.values.fir.txt new file mode 100644 index 00000000000..fe772a7b8b5 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/ReifiedReturnType.values.fir.txt @@ -0,0 +1,9 @@ +UFile (package = ) [public final class ReifiedReturnTypeKt {...] + UClass (name = ReifiedReturnTypeKt) [public final class ReifiedReturnTypeKt {...}] + UMethod (name = copyWhenGreater) [public static final fun copyWhenGreater(list: java.util.List, threshold: T, threshold2: B) : B = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = list) [var list: java.util.List] + UParameter (name = threshold) [var threshold: T] + UParameter (name = threshold2) [var threshold2: B] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UClass (name = Foo) [public final class Foo {...}] + UMethod (name = Foo) [public fun Foo() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/Resolve.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/Resolve.values.fe10.txt new file mode 100644 index 00000000000..2005ec95a30 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/Resolve.values.fe10.txt @@ -0,0 +1,156 @@ +UFile (package = ) [public final class ResolveKt {...] + UClass (name = ResolveKt) [public final class ResolveKt {...}] + UMethod (name = bar) [public static final fun bar() : void {...}] + UBlockExpression [{...}] = external (1, 2)(1, 2) + UQualifiedReferenceExpression [().foo()] = external foo()() + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] = external ()() + UIdentifier (Identifier (A)) [UIdentifier (Identifier (A))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) [] = external ()() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [foo()] = external foo()() + UIdentifier (Identifier (foo)) [UIdentifier (Identifier (foo))] + USimpleNameReferenceExpression (identifier = foo, resolvesTo = null) [foo] = external foo()() + UQualifiedReferenceExpression [().inlineFoo()] = external inlineFoo()() + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] = external ()() + UIdentifier (Identifier (A)) [UIdentifier (Identifier (A))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) [] = external ()() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [inlineFoo()] = external inlineFoo()() + UIdentifier (Identifier (inlineFoo)) [UIdentifier (Identifier (inlineFoo))] + USimpleNameReferenceExpression (identifier = inlineFoo, resolvesTo = null) [inlineFoo] = external inlineFoo()() + UQualifiedReferenceExpression [listOf(()).forEach({ var it: A ->...})] = external forEach({ var it: A -> + + println(it) +})(Undetermined) + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [listOf(())] = external listOf(())(external ()()) + UIdentifier (Identifier (listOf)) [UIdentifier (Identifier (listOf))] + USimpleNameReferenceExpression (identifier = listOf, resolvesTo = null) [listOf] = external listOf(())(external ()()) + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] = external ()() + UIdentifier (Identifier (A)) [UIdentifier (Identifier (A))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) [] = external ()() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [forEach({ var it: A ->...})] = external forEach({ var it: A -> + + println(it) +})(Undetermined) + UIdentifier (Identifier (forEach)) [UIdentifier (Identifier (forEach))] + USimpleNameReferenceExpression (identifier = forEach, resolvesTo = null) [forEach] = external forEach({ var it: A -> + + println(it) +})(Undetermined) + ULambdaExpression [{ var it: A ->...}] = Undetermined + UParameter (name = it) [var it: A] + UBlockExpression [{...}] = external println(it)(external it()) + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [println(it)] = external println(it)(external it()) + UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] + USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] = external println(it)(external it()) + USimpleNameReferenceExpression (identifier = it) [it] = external it() + UQualifiedReferenceExpression [listOf("").joinToString()] = external joinToString()() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [listOf("")] = external listOf("")("") + UIdentifier (Identifier (listOf)) [UIdentifier (Identifier (listOf))] + USimpleNameReferenceExpression (identifier = listOf, resolvesTo = null) [listOf] = external listOf("")("") + ULiteralExpression (value = "") [""] = "" + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [joinToString()] = external joinToString()() + UIdentifier (Identifier (joinToString)) [UIdentifier (Identifier (joinToString))] + USimpleNameReferenceExpression (identifier = joinToString, resolvesTo = null) [joinToString] = external joinToString()() + UQualifiedReferenceExpression [listOf("").size] = external size() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [listOf("")] = external listOf("")("") + UIdentifier (Identifier (listOf)) [UIdentifier (Identifier (listOf))] + USimpleNameReferenceExpression (identifier = listOf, resolvesTo = null) [listOf] = external listOf("")("") + ULiteralExpression (value = "") [""] = "" + USimpleNameReferenceExpression (identifier = size) [size] = external size() + UQualifiedReferenceExpression [listOf("").indices] = external indices() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [listOf("")] = external listOf("")("") + UIdentifier (Identifier (listOf)) [UIdentifier (Identifier (listOf))] + USimpleNameReferenceExpression (identifier = listOf, resolvesTo = null) [listOf] = external listOf("")("") + ULiteralExpression (value = "") [""] = "" + USimpleNameReferenceExpression (identifier = indices) [indices] = external indices() + UDeclarationsExpression [var date: java.util.Date = java.util.()] = Undetermined + ULocalVariable (name = date) [var date: java.util.Date = java.util.()] + UQualifiedReferenceExpression [java.util.()] = external ()() + UQualifiedReferenceExpression [java.util] = external util() + USimpleNameReferenceExpression (identifier = java) [java] = external java() + USimpleNameReferenceExpression (identifier = util) [util] = external util() + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] = external ()() + UIdentifier (Identifier (Date)) [UIdentifier (Identifier (Date))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Date) [] = external ()() + UBinaryExpression (operator = =) [date.time = 1000] = Undetermined + UQualifiedReferenceExpression [date.time] = external time() + USimpleNameReferenceExpression (identifier = date) [date] = (var date = external ()()) + USimpleNameReferenceExpression (identifier = time) [time] = external time() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [setTime(1000)] = external setTime(1000)((long)1000) + UIdentifier (Identifier (time)) [UIdentifier (Identifier (time))] + ULiteralExpression (value = 1000) [1000] = (long)1000 + ULiteralExpression (value = 1000) [1000] = (long)1000 + UQualifiedReferenceExpression [listOf("").last()] = external last()() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [listOf("")] = external listOf("")("") + UIdentifier (Identifier (listOf)) [UIdentifier (Identifier (listOf))] + USimpleNameReferenceExpression (identifier = listOf, resolvesTo = null) [listOf] = external listOf("")("") + ULiteralExpression (value = "") [""] = "" + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [last()] = external last()() + UIdentifier (Identifier (last)) [UIdentifier (Identifier (last))] + USimpleNameReferenceExpression (identifier = last, resolvesTo = null) [last] = external last()() + UQualifiedReferenceExpression [mutableMapOf(1 "1").entries.first().setValue("123")] = external setValue("123")("123") + UQualifiedReferenceExpression [mutableMapOf(1 "1").entries.first()] = external first()() + UQualifiedReferenceExpression [mutableMapOf(1 "1").entries] = external entries() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [mutableMapOf(1 "1")] = external mutableMapOf(1 "1")(Undetermined) + UIdentifier (Identifier (mutableMapOf)) [UIdentifier (Identifier (mutableMapOf))] + USimpleNameReferenceExpression (identifier = mutableMapOf, resolvesTo = null) [mutableMapOf] = external mutableMapOf(1 "1")(Undetermined) + UBinaryExpression (operator = ) [1 "1"] = Undetermined + ULiteralExpression (value = 1) [1] = 1 + ULiteralExpression (value = "1") ["1"] = "1" + USimpleNameReferenceExpression (identifier = entries) [entries] = external entries() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [first()] = external first()() + UIdentifier (Identifier (first)) [UIdentifier (Identifier (first))] + USimpleNameReferenceExpression (identifier = first, resolvesTo = null) [first] = external first()() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [setValue("123")] = external setValue("123")("123") + UIdentifier (Identifier (setValue)) [UIdentifier (Identifier (setValue))] + USimpleNameReferenceExpression (identifier = setValue, resolvesTo = null) [setValue] = external setValue("123")("123") + ULiteralExpression (value = "123") ["123"] = "123" + UDeclarationsExpression [var intRange: kotlin.ranges.LongRange = 0 .. 3] = Undetermined + ULocalVariable (name = intRange) [var intRange: kotlin.ranges.LongRange = 0 .. 3] + UBinaryExpression (operator = ..) [0 .. 3] = (long)0..(long)3 + ULiteralExpression (value = 0) [0] = (long)0 + ULiteralExpression (value = 3) [3] = (long)3 + UQualifiedReferenceExpression [intRange.contains(2 as int)] = external contains(2 as int)(2) + USimpleNameReferenceExpression (identifier = intRange) [intRange] = (var intRange = (long)0..(long)3) + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [contains(2 as int)] = external contains(2 as int)(2) + UIdentifier (Identifier (contains)) [UIdentifier (Identifier (contains))] + USimpleNameReferenceExpression (identifier = contains, resolvesTo = null) [contains] = external contains(2 as int)(2) + UBinaryExpressionWithType [2 as int] = 2 + ULiteralExpression (value = 2) [2] = 2 + UTypeReferenceExpression (name = int) [int] = Undetermined + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 2)) [(1, 2)] = external (1, 2)(1, 2) + UIdentifier (Identifier (IntRange)) [UIdentifier (Identifier (IntRange))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: IntRange) [] = external (1, 2)(1, 2) + ULiteralExpression (value = 1) [1] = 1 + ULiteralExpression (value = 2) [2] = 2 + UMethod (name = barT) [public static final fun barT(@org.jetbrains.annotations.NotNull t: T) : void {...}] + UParameter (name = t) [@org.jetbrains.annotations.NotNull var t: T] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = external foo()() + UQualifiedReferenceExpression [t.foo()] = external foo()() + USimpleNameReferenceExpression (identifier = t) [t] = Undetermined + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [foo()] = external foo()() + UIdentifier (Identifier (foo)) [UIdentifier (Identifier (foo))] + USimpleNameReferenceExpression (identifier = foo, resolvesTo = null) [foo] = external foo()() + UMethod (name = barTL) [public static final fun barTL(@org.jetbrains.annotations.NotNull listT: T) : void {...}] + UParameter (name = listT) [@org.jetbrains.annotations.NotNull var listT: T] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Undetermined + UQualifiedReferenceExpression [listT.isEmpty()] = external isEmpty()() + USimpleNameReferenceExpression (identifier = listT) [listT] = Undetermined + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [isEmpty()] = external isEmpty()() + UIdentifier (Identifier (isEmpty)) [UIdentifier (Identifier (isEmpty))] + USimpleNameReferenceExpression (identifier = isEmpty, resolvesTo = null) [isEmpty] = external isEmpty()() + UForEachExpression [for (a : listT) {...}] = Undetermined + USimpleNameReferenceExpression (identifier = listT) [listT] = Undetermined + UBlockExpression [{...}] = external foo()() + UQualifiedReferenceExpression [a.foo()] = external foo()() + USimpleNameReferenceExpression (identifier = a) [a] = external a() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [foo()] = external foo()() + UIdentifier (Identifier (foo)) [UIdentifier (Identifier (foo))] + USimpleNameReferenceExpression (identifier = foo, resolvesTo = null) [foo] = external foo()() + UClass (name = A) [public class A {...}] + UMethod (name = foo) [public final fun foo() : void {...}] + UBlockExpression [{...}] = Undetermined + UMethod (name = inlineFoo) [public final fun inlineFoo() : void {...}] + UBlockExpression [{...}] = Undetermined + UMethod (name = A) [public fun A() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/Resolve.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/Resolve.values.fir.txt new file mode 100644 index 00000000000..04459fd1456 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/Resolve.values.fir.txt @@ -0,0 +1,14 @@ +UFile (package = ) [public final class ResolveKt {...] + UClass (name = ResolveKt) [public final class ResolveKt {...}] + UMethod (name = bar) [public static final fun bar() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = barT) [public static final fun barT(t: T) : void = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = t) [var t: T] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = barTL) [public static final fun barTL(listT: T) : void = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = listT) [var listT: T] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UClass (name = A) [public class A {...}] + UMethod (name = A) [public fun A() = UastEmptyExpression] + UMethod (name = foo) [public final fun foo() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/SAM.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/SAM.values.fe10.txt new file mode 100644 index 00000000000..01069b15358 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/SAM.values.fe10.txt @@ -0,0 +1,180 @@ +UFile (package = ) [import java.lang.Thread...] + UImportStatement (isOnDemand = false) [import java.lang.Thread] + UImportStatement (isOnDemand = false) [import java.lang.Runnable] + UImportStatement (isOnDemand = false) [import java.util.concurrent.Callable] + UImportStatement (isOnDemand = false) [import java.util.function.Supplier] + UClass (name = SAMKt) [public final class SAMKt {...}] + UField (name = notSam) [@org.jetbrains.annotations.NotNull private static final var notSam: kotlin.jvm.functions.Function0 = { ...}] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + ULambdaExpression [{ ...}] = Undetermined + UBlockExpression [{...}] = Undetermined + UField (name = foo) [@org.jetbrains.annotations.NotNull private static var foo: java.lang.Runnable = { ...}] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + ULambdaExpression [{ ...}] = Undetermined + UBlockExpression [{...}] = Undetermined + UField (name = baz) [@org.jetbrains.annotations.NotNull private static final var baz: java.lang.Runnable = java.lang.Runnable({ ...})] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UQualifiedReferenceExpression [java.lang.Runnable({ ...})] = external Runnable({ + +})(Undetermined) + UQualifiedReferenceExpression [java.lang] = external lang() + USimpleNameReferenceExpression (identifier = java) [java] = external java() + USimpleNameReferenceExpression (identifier = lang) [lang] = external lang() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [Runnable({ ...})] = external Runnable({ + +})(Undetermined) + UIdentifier (Identifier (Runnable)) [UIdentifier (Identifier (Runnable))] + USimpleNameReferenceExpression (identifier = Runnable, resolvesTo = PsiClass: Runnable) [Runnable] = external Runnable({ + +})(Undetermined) + ULambdaExpression [{ ...}] = Undetermined + UBlockExpression [{...}] = Undetermined + UMethod (name = getNotSam) [public static final fun getNotSam() : kotlin.jvm.functions.Function0 = UastEmptyExpression] + UMethod (name = getFoo) [public static final fun getFoo() : java.lang.Runnable = UastEmptyExpression] + UMethod (name = setFoo) [public static final fun setFoo(@org.jetbrains.annotations.NotNull foo: java.lang.Runnable) : void = UastEmptyExpression] + UParameter (name = foo) [@org.jetbrains.annotations.NotNull var foo: java.lang.Runnable] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UMethod (name = bar) [public static final fun bar() : java.lang.Runnable {...}] + UBlockExpression [{...}] = Nothing + UBinaryExpression (operator = =) [foo = { ...}] = Undetermined + USimpleNameReferenceExpression (identifier = foo) [foo] = external foo() + ULambdaExpression [{ ...}] = Undetermined + UBlockExpression [{...}] = Undetermined + UDeclarationsExpression [var a: java.lang.Runnable = { ...} as java.lang.Runnable] = Undetermined + ULocalVariable (name = a) [var a: java.lang.Runnable = { ...} as java.lang.Runnable] + UBinaryExpressionWithType [{ ...} as java.lang.Runnable] = Undetermined + ULambdaExpression [{ ...}] = Undetermined + UBlockExpression [{...}] = Undetermined + UTypeReferenceExpression (name = java.lang.Runnable) [java.lang.Runnable] = Undetermined + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [runRunnable({ ...})] = external runRunnable({ + +})(Undetermined) + UIdentifier (Identifier (runRunnable)) [UIdentifier (Identifier (runRunnable))] + USimpleNameReferenceExpression (identifier = runRunnable, resolvesTo = null) [runRunnable] = external runRunnable({ + +})(Undetermined) + ULambdaExpression [{ ...}] = Undetermined + UBlockExpression [{...}] = Undetermined + UReturnExpression [return { ...}] = Nothing + ULambdaExpression [{ ...}] = Undetermined + UBlockExpression [{...}] = Undetermined + UMethod (name = getBaz) [public static final fun getBaz() : java.lang.Runnable = UastEmptyExpression] + UMethod (name = runRunnable) [public static final fun runRunnable(@org.jetbrains.annotations.NotNull r: java.lang.Runnable) : error.NonExistentClass {...}] + UParameter (name = r) [@org.jetbrains.annotations.NotNull var r: java.lang.Runnable] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UReturnExpression [return ()] = Nothing + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [()] = external ()() + UIdentifier (Identifier (r)) [UIdentifier (Identifier (r))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] = external ()() + UMethod (name = test1) [public static final fun test1() : void {...}] + UBlockExpression [{...}] = Undetermined + UDeclarationsExpression [var thread1: java.lang.Thread = ({ ...})] = Undetermined + ULocalVariable (name = thread1) [var thread1: java.lang.Thread = ({ ...})] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [({ ...})] = external ({ + println("hello1") +})(Undetermined) + UIdentifier (Identifier (Thread)) [UIdentifier (Identifier (Thread))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Thread) [] = external ({ + println("hello1") +})(Undetermined) + ULambdaExpression [{ ...}] = Undetermined + UBlockExpression [{...}] = external println("hello1")("hello1") + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [println("hello1")] = external println("hello1")("hello1") + UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] + USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] = external println("hello1")("hello1") + ULiteralExpression (value = "hello1") ["hello1"] = "hello1" + UMethod (name = test2) [public static final fun test2() : void {...}] + UBlockExpression [{...}] = Undetermined + UDeclarationsExpression [var thread2: java.lang.Thread = (Runnable({ ...}))] = Undetermined + ULocalVariable (name = thread2) [var thread2: java.lang.Thread = (Runnable({ ...}))] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [(Runnable({ ...}))] = external (Runnable({ + println("hello2") +}))(external Runnable({ + println("hello2") +})(Undetermined)) + UIdentifier (Identifier (Thread)) [UIdentifier (Identifier (Thread))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Thread) [] = external (Runnable({ + println("hello2") +}))(external Runnable({ + println("hello2") +})(Undetermined)) + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [Runnable({ ...})] = external Runnable({ + println("hello2") +})(Undetermined) + UIdentifier (Identifier (Runnable)) [UIdentifier (Identifier (Runnable))] + USimpleNameReferenceExpression (identifier = Runnable, resolvesTo = PsiClass: Runnable) [Runnable] = external Runnable({ + println("hello2") +})(Undetermined) + ULambdaExpression [{ ...}] = Undetermined + UBlockExpression [{...}] = external println("hello2")("hello2") + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [println("hello2")] = external println("hello2")("hello2") + UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] + USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] = external println("hello2")("hello2") + ULiteralExpression (value = "hello2") ["hello2"] = "hello2" + UMethod (name = test3) [public static final fun test3() : void {...}] + UBlockExpression [{...}] = external ambiguousSamAcceptor(Callable({ + return "Callable" +}))(external Callable({ + return "Callable" +})(Undetermined)) + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [ambiguousSamAcceptor(Supplier({ ...}))] = external ambiguousSamAcceptor(Supplier({ + return "Supplier" +}))(external Supplier({ + return "Supplier" +})(Undetermined)) + UIdentifier (Identifier (ambiguousSamAcceptor)) [UIdentifier (Identifier (ambiguousSamAcceptor))] + USimpleNameReferenceExpression (identifier = ambiguousSamAcceptor, resolvesTo = null) [ambiguousSamAcceptor] = external ambiguousSamAcceptor(Supplier({ + return "Supplier" +}))(external Supplier({ + return "Supplier" +})(Undetermined)) + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [Supplier({ ...})] = external Supplier({ + return "Supplier" +})(Undetermined) + UIdentifier (Identifier (Supplier)) [UIdentifier (Identifier (Supplier))] + USimpleNameReferenceExpression (identifier = Supplier, resolvesTo = PsiClass: Supplier) [Supplier] = external Supplier({ + return "Supplier" +})(Undetermined) + ULambdaExpression [{ ...}] = Undetermined + UBlockExpression [{...}] = Nothing + UReturnExpression [return "Supplier"] = Nothing + ULiteralExpression (value = "Supplier") ["Supplier"] = "Supplier" + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [ambiguousSamAcceptor(Callable({ ...}))] = external ambiguousSamAcceptor(Callable({ + return "Callable" +}))(external Callable({ + return "Callable" +})(Undetermined)) + UIdentifier (Identifier (ambiguousSamAcceptor)) [UIdentifier (Identifier (ambiguousSamAcceptor))] + USimpleNameReferenceExpression (identifier = ambiguousSamAcceptor, resolvesTo = null) [ambiguousSamAcceptor] = external ambiguousSamAcceptor(Callable({ + return "Callable" +}))(external Callable({ + return "Callable" +})(Undetermined)) + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [Callable({ ...})] = external Callable({ + return "Callable" +})(Undetermined) + UIdentifier (Identifier (Callable)) [UIdentifier (Identifier (Callable))] + USimpleNameReferenceExpression (identifier = Callable, resolvesTo = PsiClass: Callable) [Callable] = external Callable({ + return "Callable" +})(Undetermined) + ULambdaExpression [{ ...}] = Undetermined + UBlockExpression [{...}] = Nothing + UReturnExpression [return "Callable"] = Nothing + ULiteralExpression (value = "Callable") ["Callable"] = "Callable" + UMethod (name = ambiguousSamAcceptor) [public static final fun ambiguousSamAcceptor(@org.jetbrains.annotations.NotNull s: java.util.function.Supplier) : java.lang.String {...}] + UParameter (name = s) [@org.jetbrains.annotations.NotNull var s: java.util.function.Supplier] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UReturnExpression [return TODO()] = Nothing + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [TODO()] = external TODO()() + UIdentifier (Identifier (TODO)) [UIdentifier (Identifier (TODO))] + USimpleNameReferenceExpression (identifier = TODO, resolvesTo = null) [TODO] = external TODO()() + UMethod (name = ambiguousSamAcceptor) [public static final fun ambiguousSamAcceptor(@org.jetbrains.annotations.NotNull s: java.util.concurrent.Callable) : java.lang.String {...}] + UParameter (name = s) [@org.jetbrains.annotations.NotNull var s: java.util.concurrent.Callable] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UReturnExpression [return TODO()] = Nothing + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [TODO()] = external TODO()() + UIdentifier (Identifier (TODO)) [UIdentifier (Identifier (TODO))] + USimpleNameReferenceExpression (identifier = TODO, resolvesTo = null) [TODO] = external TODO()() diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/SAM.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/SAM.values.fir.txt new file mode 100644 index 00000000000..e0e4953f7d8 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/SAM.values.fir.txt @@ -0,0 +1,34 @@ +UFile (package = ) [import java.lang.Thread...] + UImportStatement (isOnDemand = false) [import java.lang.Thread] + UImportStatement (isOnDemand = false) [import java.lang.Runnable] + UImportStatement (isOnDemand = false) [import java.util.concurrent.Callable] + UImportStatement (isOnDemand = false) [import java.util.function.Supplier] + UClass (name = SAMKt) [public final class SAMKt {...}] + UField (name = notSam) [private static final var notSam: kotlin.jvm.functions.Function0 = [!] UnknownKotlinExpression (LAMBDA_EXPRESSION)] + [!] UnknownKotlinExpression (LAMBDA_EXPRESSION) [[!] UnknownKotlinExpression (LAMBDA_EXPRESSION)] = Undetermined + UField (name = foo) [private static var foo: java.lang.Runnable = [!] UnknownKotlinExpression (LAMBDA_EXPRESSION)] + [!] UnknownKotlinExpression (LAMBDA_EXPRESSION) [[!] UnknownKotlinExpression (LAMBDA_EXPRESSION)] = Undetermined + UField (name = baz) [private static final var baz: java.lang.Runnable = [!] UnknownKotlinExpression (DOT_QUALIFIED_EXPRESSION)] + [!] UnknownKotlinExpression (DOT_QUALIFIED_EXPRESSION) [[!] UnknownKotlinExpression (DOT_QUALIFIED_EXPRESSION)] = Undetermined + UMethod (name = getNotSam) [public static final fun getNotSam() : kotlin.jvm.functions.Function0 = UastEmptyExpression] + UMethod (name = getFoo) [public static final fun getFoo() : java.lang.Runnable = UastEmptyExpression] + UMethod (name = setFoo) [public static final fun setFoo(value: java.lang.Runnable) : void = UastEmptyExpression] + UParameter (name = value) [var value: java.lang.Runnable] + UMethod (name = bar) [public static final fun bar() : java.lang.Runnable = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = getBaz) [public static final fun getBaz() : java.lang.Runnable = UastEmptyExpression] + UMethod (name = runRunnable) [public static final fun runRunnable(r: java.lang.Runnable) : error.NonExistentClass = [!] UnknownKotlinExpression (CALL_EXPRESSION)] + UParameter (name = r) [var r: java.lang.Runnable] + [!] UnknownKotlinExpression (CALL_EXPRESSION) [[!] UnknownKotlinExpression (CALL_EXPRESSION)] = Undetermined + UMethod (name = test1) [public static final fun test1() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = test2) [public static final fun test2() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = test3) [public static final fun test3() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = ambiguousSamAcceptor) [public static final fun ambiguousSamAcceptor(s: java.util.function.Supplier) : java.lang.String = [!] UnknownKotlinExpression (CALL_EXPRESSION)] + UParameter (name = s) [var s: java.util.function.Supplier] + [!] UnknownKotlinExpression (CALL_EXPRESSION) [[!] UnknownKotlinExpression (CALL_EXPRESSION)] = Undetermined + UMethod (name = ambiguousSamAcceptor) [public static final fun ambiguousSamAcceptor(s: java.util.concurrent.Callable) : java.lang.String = [!] UnknownKotlinExpression (CALL_EXPRESSION)] + UParameter (name = s) [var s: java.util.concurrent.Callable] + [!] UnknownKotlinExpression (CALL_EXPRESSION) [[!] UnknownKotlinExpression (CALL_EXPRESSION)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/Simple.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/Simple.values.fe10.txt new file mode 100644 index 00000000000..24a7ff0f4aa --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/Simple.values.fe10.txt @@ -0,0 +1,13 @@ +UFile (package = ) [public final class Simple {...] + UClass (name = Simple) [public final class Simple {...}] + UField (name = property) [@org.jetbrains.annotations.NotNull private final var property: java.lang.String = "Mary"] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + ULiteralExpression (value = "Mary") ["Mary"] = "Mary" + UMethod (name = method) [public final fun method() : void {...}] + UBlockExpression [{...}] = external println("Hello, world!")("Hello, world!") + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [println("Hello, world!")] = external println("Hello, world!")("Hello, world!") + UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] + USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] = external println("Hello, world!")("Hello, world!") + ULiteralExpression (value = "Hello, world!") ["Hello, world!"] = "Hello, world!" + UMethod (name = getProperty) [public final fun getProperty() : java.lang.String = UastEmptyExpression] + UMethod (name = Simple) [public fun Simple() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/Simple.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/Simple.values.fir.txt new file mode 100644 index 00000000000..1b5cfd8a155 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/Simple.values.fir.txt @@ -0,0 +1,8 @@ +UFile (package = ) [public final class Simple {...] + UClass (name = Simple) [public final class Simple {...}] + UField (name = property) [private final var property: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] = Undetermined + UMethod (name = Simple) [public fun Simple() = UastEmptyExpression] + UMethod (name = method) [public final fun method() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = getProperty) [public final fun getProperty() : java.lang.String = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/SimpleAnnotated.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/SimpleAnnotated.values.fe10.txt new file mode 100644 index 00000000000..87a20153cfe --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/SimpleAnnotated.values.fe10.txt @@ -0,0 +1,19 @@ +UFile (package = ) [public final class SimpleAnnotated {...] + UClass (name = SimpleAnnotated) [public final class SimpleAnnotated {...}] + UField (name = property) [@org.jetbrains.annotations.NotNull @kotlin.SinceKotlin(version = "1.0") private final var property: java.lang.String = "Mary"] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UAnnotation (fqName = kotlin.SinceKotlin) [@kotlin.SinceKotlin(version = "1.0")] + UNamedExpression (name = version) [version = "1.0"] = Undetermined + ULiteralExpression (value = "1.0") ["1.0"] = "1.0" + ULiteralExpression (value = "Mary") ["Mary"] = "Mary" + UMethod (name = method) [@kotlin.Suppress(names = "abc")...}] + UAnnotation (fqName = kotlin.Suppress) [@kotlin.Suppress(names = "abc")] + UNamedExpression (name = names) [names = "abc"] = Undetermined + ULiteralExpression (value = "abc") ["abc"] = "abc" + UBlockExpression [{...}] = external println("Hello, world!")("Hello, world!") + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [println("Hello, world!")] = external println("Hello, world!")("Hello, world!") + UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] + USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] = external println("Hello, world!")("Hello, world!") + ULiteralExpression (value = "Hello, world!") ["Hello, world!"] = "Hello, world!" + UMethod (name = getProperty) [public final fun getProperty() : java.lang.String = UastEmptyExpression] + UMethod (name = SimpleAnnotated) [public fun SimpleAnnotated() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/SimpleAnnotated.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/SimpleAnnotated.values.fir.txt new file mode 100644 index 00000000000..70a339f5572 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/SimpleAnnotated.values.fir.txt @@ -0,0 +1,8 @@ +UFile (package = ) [public final class SimpleAnnotated {...] + UClass (name = SimpleAnnotated) [public final class SimpleAnnotated {...}] + UField (name = property) [private final var property: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] = Undetermined + UMethod (name = SimpleAnnotated) [public fun SimpleAnnotated() = UastEmptyExpression] + UMethod (name = method) [public final fun method() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = getProperty) [public final fun getProperty() : java.lang.String = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/StringTemplate.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/StringTemplate.values.fe10.txt new file mode 100644 index 00000000000..dfb30923343 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/StringTemplate.values.fe10.txt @@ -0,0 +1,23 @@ +UFile (package = ) [public final class StringTemplateKt {...] + UClass (name = StringTemplateKt) [public final class StringTemplateKt {...}] + UField (name = foo) [@org.jetbrains.annotations.NotNull private static final var foo: java.lang.String = "lorem"] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + ULiteralExpression (value = "lorem") ["lorem"] = "lorem" + UField (name = bar) [@org.jetbrains.annotations.NotNull private static final var bar: java.lang.String = "ipsum"] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + ULiteralExpression (value = "ipsum") ["ipsum"] = "ipsum" + UField (name = baz) [@org.jetbrains.annotations.NotNull private static final var baz: java.lang.String = "dolor"] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + ULiteralExpression (value = "dolor") ["dolor"] = "dolor" + UField (name = foobarbaz) [@org.jetbrains.annotations.NotNull private static final var foobarbaz: java.lang.String = foo + " " + bar + " " + baz] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UPolyadicExpression (operator = +) [foo + " " + bar + " " + baz] = Undetermined + USimpleNameReferenceExpression (identifier = foo) [foo] = external foo() + ULiteralExpression (value = " ") [" "] = " " + USimpleNameReferenceExpression (identifier = bar) [bar] = external bar() + ULiteralExpression (value = " ") [" "] = " " + USimpleNameReferenceExpression (identifier = baz) [baz] = external baz() + UMethod (name = getFoo) [public static final fun getFoo() : java.lang.String = UastEmptyExpression] + UMethod (name = getBar) [public static final fun getBar() : java.lang.String = UastEmptyExpression] + UMethod (name = getBaz) [public static final fun getBaz() : java.lang.String = UastEmptyExpression] + UMethod (name = getFoobarbaz) [public static final fun getFoobarbaz() : java.lang.String = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/StringTemplate.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/StringTemplate.values.fir.txt new file mode 100644 index 00000000000..db7c1e541e0 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/StringTemplate.values.fir.txt @@ -0,0 +1,14 @@ +UFile (package = ) [public final class StringTemplateKt {...] + UClass (name = StringTemplateKt) [public final class StringTemplateKt {...}] + UField (name = foo) [private static final var foo: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] = Undetermined + UField (name = bar) [private static final var bar: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] = Undetermined + UField (name = baz) [private static final var baz: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] = Undetermined + UField (name = foobarbaz) [private static final var foobarbaz: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] = Undetermined + UMethod (name = getFoo) [public static final fun getFoo() : java.lang.String = UastEmptyExpression] + UMethod (name = getBar) [public static final fun getBar() : java.lang.String = UastEmptyExpression] + UMethod (name = getBaz) [public static final fun getBaz() : java.lang.String = UastEmptyExpression] + UMethod (name = getFoobarbaz) [public static final fun getFoobarbaz() : java.lang.String = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/StringTemplateComplex.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/StringTemplateComplex.values.fe10.txt new file mode 100644 index 00000000000..f8b6b9f738c --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/StringTemplateComplex.values.fe10.txt @@ -0,0 +1,74 @@ +UFile (package = ) [public final class StringTemplateComplexKt {...] + UClass (name = StringTemplateComplexKt) [public final class StringTemplateComplexKt {...}] + UField (name = muchRecur) [@org.jetbrains.annotations.NotNull private static final var muchRecur: java.lang.String = "abc"] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + ULiteralExpression (value = "abc") ["abc"] = "abc" + UField (name = case4) [@org.jetbrains.annotations.NotNull private static final var case4: java.lang.String = "a " + "literal" + " z"] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UPolyadicExpression (operator = +) ["a " + "literal" + " z"] = "a literal z" + ULiteralExpression (value = "a ") ["a "] = "a " + ULiteralExpression (value = "literal") ["literal"] = "literal" + ULiteralExpression (value = " z") [" z"] = " z" + UField (name = case5) [@org.jetbrains.annotations.NotNull private static final var case5: java.lang.String = "a " + "literal" + " " + "literal" + " z"] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UPolyadicExpression (operator = +) ["a " + "literal" + " " + "literal" + " z"] = "a literal literal z" + ULiteralExpression (value = "a ") ["a "] = "a " + ULiteralExpression (value = "literal") ["literal"] = "literal" + ULiteralExpression (value = " ") [" "] = " " + ULiteralExpression (value = "literal") ["literal"] = "literal" + ULiteralExpression (value = " z") [" z"] = " z" + UField (name = literalInLiteral) [@org.jetbrains.annotations.NotNull private static final var literalInLiteral: java.lang.String = "a " + "literal" + case4 + " z"] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UPolyadicExpression (operator = +) ["a " + "literal" + case4 + " z"] = Undetermined + ULiteralExpression (value = "a ") ["a "] = "a " + UPolyadicExpression (operator = +) ["literal" + case4] = Undetermined + ULiteralExpression (value = "literal") ["literal"] = "literal" + USimpleNameReferenceExpression (identifier = case4) [case4] = external case4() + ULiteralExpression (value = " z") [" z"] = " z" + UField (name = literalInLiteral2) [@org.jetbrains.annotations.NotNull private static final var literalInLiteral2: java.lang.String = "a " + "literal" + case4.repeat(4) + " z"] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UPolyadicExpression (operator = +) ["a " + "literal" + case4.repeat(4) + " z"] = Undetermined + ULiteralExpression (value = "a ") ["a "] = "a " + UQualifiedReferenceExpression ["literal" + case4.repeat(4)] = external repeat(4)(4) + UPolyadicExpression (operator = +) ["literal" + case4] = Undetermined + ULiteralExpression (value = "literal") ["literal"] = "literal" + USimpleNameReferenceExpression (identifier = case4) [case4] = external case4() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [repeat(4)] = external repeat(4)(4) + UIdentifier (Identifier (repeat)) [UIdentifier (Identifier (repeat))] + USimpleNameReferenceExpression (identifier = repeat, resolvesTo = null) [repeat] = external repeat(4)(4) + ULiteralExpression (value = 4) [4] = 4 + ULiteralExpression (value = " z") [" z"] = " z" + UField (name = empty) [@org.jetbrains.annotations.NotNull private static final var empty: java.lang.String = ""] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + ULiteralExpression (value = "") [""] = "" + UMethod (name = getMuchRecur) [public static final fun getMuchRecur() : java.lang.String = UastEmptyExpression] + UMethod (name = getCase4) [public static final fun getCase4() : java.lang.String = UastEmptyExpression] + UMethod (name = getCase5) [public static final fun getCase5() : java.lang.String = UastEmptyExpression] + UMethod (name = getLiteralInLiteral) [public static final fun getLiteralInLiteral() : java.lang.String = UastEmptyExpression] + UMethod (name = getLiteralInLiteral2) [public static final fun getLiteralInLiteral2() : java.lang.String = UastEmptyExpression] + UMethod (name = getEmpty) [public static final fun getEmpty() : java.lang.String = UastEmptyExpression] + UMethod (name = simpleForTemplate) [public static final fun simpleForTemplate(@org.jetbrains.annotations.NotNull i: int) : java.lang.String {...}] + UParameter (name = i) [@org.jetbrains.annotations.NotNull var i: int = 0] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + ULiteralExpression (value = 0) [0] = 0 + UBlockExpression [{...}] = Nothing + UReturnExpression [return i] = Nothing + USimpleNameReferenceExpression (identifier = i) [i] = Undetermined + UMethod (name = foo) [public static final fun foo() : void {...}] + UBlockExpression [{...}] = Undetermined + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [println(baz)] = external println(baz)(external baz()) + UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] + USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] = external println(baz)(external baz()) + USimpleNameReferenceExpression (identifier = baz) [baz] = external baz() + UDeclarationsExpression [var template1: java.lang.String = simpleForTemplate()] = Undetermined + ULocalVariable (name = template1) [var template1: java.lang.String = simpleForTemplate()] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [simpleForTemplate()] = external simpleForTemplate()() + UIdentifier (Identifier (simpleForTemplate)) [UIdentifier (Identifier (simpleForTemplate))] + USimpleNameReferenceExpression (identifier = simpleForTemplate, resolvesTo = null) [simpleForTemplate] = external simpleForTemplate()() + UDeclarationsExpression [var template2: java.lang.String = "." + simpleForTemplate()] = Undetermined + ULocalVariable (name = template2) [var template2: java.lang.String = "." + simpleForTemplate()] + UPolyadicExpression (operator = +) ["." + simpleForTemplate()] = Undetermined + ULiteralExpression (value = ".") ["."] = "." + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [simpleForTemplate()] = external simpleForTemplate()() + UIdentifier (Identifier (simpleForTemplate)) [UIdentifier (Identifier (simpleForTemplate))] + USimpleNameReferenceExpression (identifier = simpleForTemplate, resolvesTo = null) [simpleForTemplate] = external simpleForTemplate()() diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/StringTemplateComplex.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/StringTemplateComplex.values.fir.txt new file mode 100644 index 00000000000..d255948ceb0 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/StringTemplateComplex.values.fir.txt @@ -0,0 +1,26 @@ +UFile (package = ) [public final class StringTemplateComplexKt {...] + UClass (name = StringTemplateComplexKt) [public final class StringTemplateComplexKt {...}] + UField (name = muchRecur) [private static final var muchRecur: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] = Undetermined + UField (name = case4) [private static final var case4: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] = Undetermined + UField (name = case5) [private static final var case5: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] = Undetermined + UField (name = literalInLiteral) [private static final var literalInLiteral: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] = Undetermined + UField (name = literalInLiteral2) [private static final var literalInLiteral2: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] = Undetermined + UField (name = empty) [private static final var empty: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] = Undetermined + UMethod (name = getMuchRecur) [public static final fun getMuchRecur() : java.lang.String = UastEmptyExpression] + UMethod (name = getCase4) [public static final fun getCase4() : java.lang.String = UastEmptyExpression] + UMethod (name = getCase5) [public static final fun getCase5() : java.lang.String = UastEmptyExpression] + UMethod (name = getLiteralInLiteral) [public static final fun getLiteralInLiteral() : java.lang.String = UastEmptyExpression] + UMethod (name = getLiteralInLiteral2) [public static final fun getLiteralInLiteral2() : java.lang.String = UastEmptyExpression] + UMethod (name = getEmpty) [public static final fun getEmpty() : java.lang.String = UastEmptyExpression] + UMethod (name = simpleForTemplate) [public static final fun simpleForTemplate(i: int) : java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + UParameter (name = i) [var i: int = [!] UnknownKotlinExpression (INTEGER_CONSTANT)] + [!] UnknownKotlinExpression (INTEGER_CONSTANT) [[!] UnknownKotlinExpression (INTEGER_CONSTANT)] = Undetermined + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] = Undetermined + UMethod (name = foo) [public static final fun foo() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/StringTemplateComplexForUInjectionHost.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/StringTemplateComplexForUInjectionHost.values.fe10.txt new file mode 100644 index 00000000000..fb5e6f99ba1 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/StringTemplateComplexForUInjectionHost.values.fe10.txt @@ -0,0 +1,74 @@ +UFile (package = ) [public final class StringTemplateComplexForUInjectionHostKt {...] + UClass (name = StringTemplateComplexForUInjectionHostKt) [public final class StringTemplateComplexForUInjectionHostKt {...}] + UField (name = muchRecur) [@org.jetbrains.annotations.NotNull private static final var muchRecur: java.lang.String = "abc"] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + ULiteralExpression (value = "abc") ["abc"] = "abc" + UField (name = case4) [@org.jetbrains.annotations.NotNull private static final var case4: java.lang.String = "a " + "literal" + " z"] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UPolyadicExpression (operator = +) ["a " + "literal" + " z"] = "a literal z" + ULiteralExpression (value = "a ") ["a "] = "a " + ULiteralExpression (value = "literal") ["literal"] = "literal" + ULiteralExpression (value = " z") [" z"] = " z" + UField (name = case5) [@org.jetbrains.annotations.NotNull private static final var case5: java.lang.String = "a " + "literal" + " " + "literal" + " z"] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UPolyadicExpression (operator = +) ["a " + "literal" + " " + "literal" + " z"] = "a literal literal z" + ULiteralExpression (value = "a ") ["a "] = "a " + ULiteralExpression (value = "literal") ["literal"] = "literal" + ULiteralExpression (value = " ") [" "] = " " + ULiteralExpression (value = "literal") ["literal"] = "literal" + ULiteralExpression (value = " z") [" z"] = " z" + UField (name = literalInLiteral) [@org.jetbrains.annotations.NotNull private static final var literalInLiteral: java.lang.String = "a " + "literal" + case4 + " z"] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UPolyadicExpression (operator = +) ["a " + "literal" + case4 + " z"] = Undetermined + ULiteralExpression (value = "a ") ["a "] = "a " + UPolyadicExpression (operator = +) ["literal" + case4] = Undetermined + ULiteralExpression (value = "literal") ["literal"] = "literal" + USimpleNameReferenceExpression (identifier = case4) [case4] = external case4() + ULiteralExpression (value = " z") [" z"] = " z" + UField (name = literalInLiteral2) [@org.jetbrains.annotations.NotNull private static final var literalInLiteral2: java.lang.String = "a " + "literal" + case4.repeat(4) + " z"] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UPolyadicExpression (operator = +) ["a " + "literal" + case4.repeat(4) + " z"] = Undetermined + ULiteralExpression (value = "a ") ["a "] = "a " + UQualifiedReferenceExpression ["literal" + case4.repeat(4)] = external repeat(4)(4) + UPolyadicExpression (operator = +) ["literal" + case4] = Undetermined + ULiteralExpression (value = "literal") ["literal"] = "literal" + USimpleNameReferenceExpression (identifier = case4) [case4] = external case4() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [repeat(4)] = external repeat(4)(4) + UIdentifier (Identifier (repeat)) [UIdentifier (Identifier (repeat))] + USimpleNameReferenceExpression (identifier = repeat, resolvesTo = null) [repeat] = external repeat(4)(4) + ULiteralExpression (value = 4) [4] = 4 + ULiteralExpression (value = " z") [" z"] = " z" + UField (name = empty) [@org.jetbrains.annotations.NotNull private static final var empty: java.lang.String = ""] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + ULiteralExpression (value = "") [""] = "" + UMethod (name = getMuchRecur) [public static final fun getMuchRecur() : java.lang.String = UastEmptyExpression] + UMethod (name = getCase4) [public static final fun getCase4() : java.lang.String = UastEmptyExpression] + UMethod (name = getCase5) [public static final fun getCase5() : java.lang.String = UastEmptyExpression] + UMethod (name = getLiteralInLiteral) [public static final fun getLiteralInLiteral() : java.lang.String = UastEmptyExpression] + UMethod (name = getLiteralInLiteral2) [public static final fun getLiteralInLiteral2() : java.lang.String = UastEmptyExpression] + UMethod (name = getEmpty) [public static final fun getEmpty() : java.lang.String = UastEmptyExpression] + UMethod (name = simpleForTemplate) [public static final fun simpleForTemplate(@org.jetbrains.annotations.NotNull i: int) : java.lang.String {...}] + UParameter (name = i) [@org.jetbrains.annotations.NotNull var i: int = 0] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + ULiteralExpression (value = 0) [0] = 0 + UBlockExpression [{...}] = Nothing + UReturnExpression [return i] = Nothing + USimpleNameReferenceExpression (identifier = i) [i] = Undetermined + UMethod (name = foo) [public static final fun foo() : void {...}] + UBlockExpression [{...}] = Undetermined + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [println(baz)] = external println(baz)(external baz()) + UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] + USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] = external println(baz)(external baz()) + USimpleNameReferenceExpression (identifier = baz) [baz] = external baz() + UDeclarationsExpression [var template1: java.lang.String = simpleForTemplate()] = Undetermined + ULocalVariable (name = template1) [var template1: java.lang.String = simpleForTemplate()] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [simpleForTemplate()] = external simpleForTemplate()() + UIdentifier (Identifier (simpleForTemplate)) [UIdentifier (Identifier (simpleForTemplate))] + USimpleNameReferenceExpression (identifier = simpleForTemplate, resolvesTo = null) [simpleForTemplate] = external simpleForTemplate()() + UDeclarationsExpression [var template2: java.lang.String = "." + simpleForTemplate()] = Undetermined + ULocalVariable (name = template2) [var template2: java.lang.String = "." + simpleForTemplate()] + UPolyadicExpression (operator = +) ["." + simpleForTemplate()] = Undetermined + ULiteralExpression (value = ".") ["."] = "." + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [simpleForTemplate()] = external simpleForTemplate()() + UIdentifier (Identifier (simpleForTemplate)) [UIdentifier (Identifier (simpleForTemplate))] + USimpleNameReferenceExpression (identifier = simpleForTemplate, resolvesTo = null) [simpleForTemplate] = external simpleForTemplate()() diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/StringTemplateComplexForUInjectionHost.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/StringTemplateComplexForUInjectionHost.values.fir.txt new file mode 100644 index 00000000000..c6be9b9fb79 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/StringTemplateComplexForUInjectionHost.values.fir.txt @@ -0,0 +1,26 @@ +UFile (package = ) [public final class StringTemplateComplexForUInjectionHostKt {...] + UClass (name = StringTemplateComplexForUInjectionHostKt) [public final class StringTemplateComplexForUInjectionHostKt {...}] + UField (name = muchRecur) [private static final var muchRecur: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] = Undetermined + UField (name = case4) [private static final var case4: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] = Undetermined + UField (name = case5) [private static final var case5: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] = Undetermined + UField (name = literalInLiteral) [private static final var literalInLiteral: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] = Undetermined + UField (name = literalInLiteral2) [private static final var literalInLiteral2: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] = Undetermined + UField (name = empty) [private static final var empty: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] = Undetermined + UMethod (name = getMuchRecur) [public static final fun getMuchRecur() : java.lang.String = UastEmptyExpression] + UMethod (name = getCase4) [public static final fun getCase4() : java.lang.String = UastEmptyExpression] + UMethod (name = getCase5) [public static final fun getCase5() : java.lang.String = UastEmptyExpression] + UMethod (name = getLiteralInLiteral) [public static final fun getLiteralInLiteral() : java.lang.String = UastEmptyExpression] + UMethod (name = getLiteralInLiteral2) [public static final fun getLiteralInLiteral2() : java.lang.String = UastEmptyExpression] + UMethod (name = getEmpty) [public static final fun getEmpty() : java.lang.String = UastEmptyExpression] + UMethod (name = simpleForTemplate) [public static final fun simpleForTemplate(i: int) : java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + UParameter (name = i) [var i: int = [!] UnknownKotlinExpression (INTEGER_CONSTANT)] + [!] UnknownKotlinExpression (INTEGER_CONSTANT) [[!] UnknownKotlinExpression (INTEGER_CONSTANT)] = Undetermined + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] = Undetermined + UMethod (name = foo) [public static final fun foo() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/StringTemplateInClass.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/StringTemplateInClass.values.fe10.txt new file mode 100644 index 00000000000..af5a4f503f5 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/StringTemplateInClass.values.fe10.txt @@ -0,0 +1,12 @@ +UFile (package = ) [public final class Demo {...] + UClass (name = Demo) [public final class Demo {...}] + UField (name = foo) [@org.jetbrains.annotations.NotNull private final var foo: error.NonExistentClass = X.("lorem")] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UQualifiedReferenceExpression [X.("lorem")] = external ("lorem")("lorem") + USimpleNameReferenceExpression (identifier = X) [X] = external X() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [("lorem")] = external ("lorem")("lorem") + UIdentifier (Identifier (bar)) [UIdentifier (Identifier (bar))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] = external ("lorem")("lorem") + ULiteralExpression (value = "lorem") ["lorem"] = "lorem" + UMethod (name = getFoo) [public final fun getFoo() : error.NonExistentClass = UastEmptyExpression] + UMethod (name = Demo) [public fun Demo() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/StringTemplateInClass.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/StringTemplateInClass.values.fir.txt new file mode 100644 index 00000000000..2ed828ac21a --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/StringTemplateInClass.values.fir.txt @@ -0,0 +1,6 @@ +UFile (package = ) [public final class Demo {...] + UClass (name = Demo) [public final class Demo {...}] + UField (name = foo) [private final var foo: error.NonExistentClass = [!] UnknownKotlinExpression (DOT_QUALIFIED_EXPRESSION)] + [!] UnknownKotlinExpression (DOT_QUALIFIED_EXPRESSION) [[!] UnknownKotlinExpression (DOT_QUALIFIED_EXPRESSION)] = Undetermined + UMethod (name = Demo) [public fun Demo() = UastEmptyExpression] + UMethod (name = getFoo) [public final fun getFoo() : error.NonExistentClass = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/StringTemplateWithVar.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/StringTemplateWithVar.values.fe10.txt new file mode 100644 index 00000000000..ba8fc3fb6af --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/StringTemplateWithVar.values.fe10.txt @@ -0,0 +1,12 @@ +UFile (package = ) [public final class StringTemplateWithVarKt {...] + UClass (name = StringTemplateWithVarKt) [public final class StringTemplateWithVarKt {...}] + UField (name = bar) [@org.jetbrains.annotations.NotNull private static final var bar: java.lang.String = "bar"] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + ULiteralExpression (value = "bar") ["bar"] = "bar" + UField (name = f) [@org.jetbrains.annotations.NotNull private static final var f: java.lang.String = "foo" + bar] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UPolyadicExpression (operator = +) ["foo" + bar] = Undetermined + ULiteralExpression (value = "foo") ["foo"] = "foo" + USimpleNameReferenceExpression (identifier = bar) [bar] = external bar() + UMethod (name = getBar) [public static final fun getBar() : java.lang.String = UastEmptyExpression] + UMethod (name = getF) [public static final fun getF() : java.lang.String = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/StringTemplateWithVar.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/StringTemplateWithVar.values.fir.txt new file mode 100644 index 00000000000..19346edfeec --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/StringTemplateWithVar.values.fir.txt @@ -0,0 +1,8 @@ +UFile (package = ) [public final class StringTemplateWithVarKt {...] + UClass (name = StringTemplateWithVarKt) [public final class StringTemplateWithVarKt {...}] + UField (name = bar) [private static final var bar: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] = Undetermined + UField (name = f) [private static final var f: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] = Undetermined + UMethod (name = getBar) [public static final fun getBar() : java.lang.String = UastEmptyExpression] + UMethod (name = getF) [public static final fun getF() : java.lang.String = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/SuperCalls.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/SuperCalls.values.fe10.txt new file mode 100644 index 00000000000..b61a024e826 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/SuperCalls.values.fe10.txt @@ -0,0 +1,100 @@ +UFile (package = ) [public final class SuperCallsKt {...] + UClass (name = SuperCallsKt) [public final class SuperCallsKt {...}] + UField (name = anon) [@org.jetbrains.annotations.NotNull private static final var anon: A = anonymous object : A("textForAnon") {...}] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UObjectLiteralExpression [anonymous object : A("textForAnon") {...}] = Undetermined + ULiteralExpression (value = "textForAnon") ["textForAnon"] = "textForAnon" + UClass (name = null) [final class null : A {...}] + UMethod (name = bar) [public final fun bar() : void {...}] + UBlockExpression [{...}] = external cons(anonymous object : A("inner literal") { })(Undetermined) + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [cons(anonymous object : A("inner literal") { })] = external cons(anonymous object : A("inner literal") { })(Undetermined) + UIdentifier (Identifier (cons)) [UIdentifier (Identifier (cons))] + USimpleNameReferenceExpression (identifier = cons, resolvesTo = null) [cons] = external cons(anonymous object : A("inner literal") { })(Undetermined) + UObjectLiteralExpression [anonymous object : A("inner literal") { }] = Undetermined + ULiteralExpression (value = "inner literal") ["inner literal"] = "inner literal" + UClass (name = null) [final class null : A {...}] + UMethod (name = ) [private fun () = UastEmptyExpression] + UMethod (name = ) [private fun () = UastEmptyExpression] + UClass (name = InnerClass) [public final class InnerClass : A {...}] + UMethod (name = InnerClass) [public fun InnerClass() {...}] + UBlockExpression [{...}] = external ("inner class")("inner class") + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [("inner class")] = external ("inner class")("inner class") + UIdentifier (Identifier (A)) [UIdentifier (Identifier (A))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) [] = external ("inner class")("inner class") + ULiteralExpression (value = "inner class") ["inner class"] = "inner class" + UMethod (name = getAnon) [public static final fun getAnon() : A = UastEmptyExpression] + UMethod (name = cons) [public static final fun cons(@org.jetbrains.annotations.NotNull a: A) : void {...}] + UParameter (name = a) [@org.jetbrains.annotations.NotNull var a: A] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Undetermined + UClass (name = A) [public class A {...}] + UField (name = str) [@org.jetbrains.annotations.NotNull private final var str: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UMethod (name = foo) [public fun foo(@org.jetbrains.annotations.NotNull a: long) : void {...}] + UParameter (name = a) [@org.jetbrains.annotations.NotNull var a: long] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Undetermined + UMethod (name = getStr) [public final fun getStr() : java.lang.String = UastEmptyExpression] + UMethod (name = A) [public fun A(@org.jetbrains.annotations.NotNull str: java.lang.String) = UastEmptyExpression] + UParameter (name = str) [@org.jetbrains.annotations.NotNull var str: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UMethod (name = A) [public fun A(@org.jetbrains.annotations.NotNull i: int) {...}] + UParameter (name = i) [@org.jetbrains.annotations.NotNull var i: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = external (i.toString())(external toString()()) + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [(i.toString())] = external (i.toString())(external toString()()) + UIdentifier (Identifier (this)) [UIdentifier (Identifier (this))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) [] = external (i.toString())(external toString()()) + UQualifiedReferenceExpression [i.toString()] = external toString()() + USimpleNameReferenceExpression (identifier = i) [i] = Undetermined + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [toString()] = external toString()() + UIdentifier (Identifier (toString)) [UIdentifier (Identifier (toString))] + USimpleNameReferenceExpression (identifier = toString, resolvesTo = null) [toString] = external toString()() + UClass (name = B) [public final class B : A {...}] + UMethod (name = B) [public fun B(@org.jetbrains.annotations.NotNull param: java.lang.String) {...}] + UParameter (name = param) [@org.jetbrains.annotations.NotNull var param: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = external (param)(Undetermined) + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [(param)] = external (param)(Undetermined) + UIdentifier (Identifier (A)) [UIdentifier (Identifier (A))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) [] = external (param)(Undetermined) + USimpleNameReferenceExpression (identifier = param) [param] = Undetermined + UClass (name = C) [public final class C : A {...}] + UMethod (name = foo) [public fun foo(@org.jetbrains.annotations.NotNull a: long) : void {...}] + UParameter (name = a) [@org.jetbrains.annotations.NotNull var a: long] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = external foo(a)(Undetermined) + UQualifiedReferenceExpression [super.foo(a)] = external foo(a)(Undetermined) + USuperExpression (label = null) [super] = Undetermined + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [foo(a)] = external foo(a)(Undetermined) + UIdentifier (Identifier (foo)) [UIdentifier (Identifier (foo))] + USimpleNameReferenceExpression (identifier = foo, resolvesTo = null) [foo] = external foo(a)(Undetermined) + USimpleNameReferenceExpression (identifier = a) [a] = Undetermined + UMethod (name = C) [public fun C(@org.jetbrains.annotations.NotNull p: java.lang.String) {...}] + UParameter (name = p) [@org.jetbrains.annotations.NotNull var p: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = external (p)(Undetermined) + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [(p)] = external (p)(Undetermined) + UIdentifier (Identifier (super)) [UIdentifier (Identifier (super))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) [] = external (p)(Undetermined) + USimpleNameReferenceExpression (identifier = p) [p] = Undetermined + UMethod (name = C) [public fun C(@org.jetbrains.annotations.NotNull i: int) {...}] + UParameter (name = i) [@org.jetbrains.annotations.NotNull var i: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = external println()() + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [(i)] = external (i)(Undetermined) + UIdentifier (Identifier (super)) [UIdentifier (Identifier (super))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) [] = external (i)(Undetermined) + USimpleNameReferenceExpression (identifier = i) [i] = Undetermined + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [println()] = external println()() + UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] + USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] = external println()() + UClass (name = O) [public final class O : A {...}] + UField (name = INSTANCE) [@null public static final var INSTANCE: O] + UAnnotation (fqName = null) [@null] + UMethod (name = O) [private fun O() {...}] + UBlockExpression [{...}] = external ("text")("text") + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [("text")] = external ("text")("text") + UIdentifier (Identifier (A)) [UIdentifier (Identifier (A))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) [] = external ("text")("text") + ULiteralExpression (value = "text") ["text"] = "text" diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/SuperCalls.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/SuperCalls.values.fir.txt new file mode 100644 index 00000000000..74d70cd756c --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/SuperCalls.values.fir.txt @@ -0,0 +1,33 @@ +UFile (package = ) [public final class SuperCallsKt {...] + UClass (name = SuperCallsKt) [public final class SuperCallsKt {...}] + UField (name = anon) [private static final var anon: A = [!] UnknownKotlinExpression (OBJECT_LITERAL)] + [!] UnknownKotlinExpression (OBJECT_LITERAL) [[!] UnknownKotlinExpression (OBJECT_LITERAL)] = Undetermined + UMethod (name = getAnon) [public static final fun getAnon() : A = UastEmptyExpression] + UMethod (name = cons) [public static final fun cons(a: A) : void = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = a) [var a: A] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UClass (name = A) [public class A {...}] + UField (name = str) [private final var str: java.lang.String] + UMethod (name = A) [public fun A(str: java.lang.String) = UastEmptyExpression] + UParameter (name = str) [var str: java.lang.String] + UMethod (name = A) [public fun A(i: int) = UastEmptyExpression] + UParameter (name = i) [var i: int] + UMethod (name = getStr) [public final fun getStr() : java.lang.String = UastEmptyExpression] + UMethod (name = foo) [public fun foo(a: long) : void = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = a) [var a: long] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UClass (name = B) [public final class B : null {...}] + UMethod (name = B) [public fun B(param: java.lang.String) = UastEmptyExpression] + UParameter (name = param) [var param: java.lang.String] + UClass (name = C) [public final class C : null {...}] + UMethod (name = C) [public fun C(p: java.lang.String) = UastEmptyExpression] + UParameter (name = p) [var p: java.lang.String] + UMethod (name = C) [public fun C(i: int) = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = i) [var i: int] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = foo) [public fun foo(a: long) : void = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = a) [var a: long] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UClass (name = O) [public final class O : null {...}] + UField (name = INSTANCE) [public static final var INSTANCE: O] + UMethod (name = O) [private fun O() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/Suspend.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/Suspend.values.fe10.txt new file mode 100644 index 00000000000..5b37925d087 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/Suspend.values.fe10.txt @@ -0,0 +1,32 @@ +UFile (package = test.pkg) [package test.pkg...] + UClass (name = SuspendKt) [public final class SuspendKt {...}] + UMethod (name = top) [public static final fun top(@org.jetbrains.annotations.NotNull $completion: kotlin.coroutines.Continuation) : java.lang.Object {...}] + UParameter (name = $completion) [@org.jetbrains.annotations.NotNull var $completion: kotlin.coroutines.Continuation] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UReturnExpression [return ().inner()] = Nothing + UQualifiedReferenceExpression [().inner()] = external inner()() + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] = external ()() + UIdentifier (Identifier (Context)) [UIdentifier (Identifier (Context))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Context) [] = external ()() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [inner()] = external inner()() + UIdentifier (Identifier (inner)) [UIdentifier (Identifier (inner))] + USimpleNameReferenceExpression (identifier = inner, resolvesTo = null) [inner] = external inner()() + UClass (name = Context) [public final class Context {...}] + UMethod (name = inner) [public final fun inner(@org.jetbrains.annotations.NotNull $completion: kotlin.coroutines.Continuation) : java.lang.Object {...}] + UParameter (name = $completion) [@org.jetbrains.annotations.NotNull var $completion: kotlin.coroutines.Continuation] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UReturnExpression [return suspendPrivate()] = Nothing + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [suspendPrivate()] = external suspendPrivate()() + UIdentifier (Identifier (suspendPrivate)) [UIdentifier (Identifier (suspendPrivate))] + USimpleNameReferenceExpression (identifier = suspendPrivate, resolvesTo = null) [suspendPrivate] = external suspendPrivate()() + UMethod (name = suspendPrivate) [private final fun suspendPrivate(@null $completion: kotlin.coroutines.Continuation) : java.lang.Object {...}] + UParameter (name = $completion) [@null var $completion: kotlin.coroutines.Continuation] + UAnnotation (fqName = null) [@null] + UBlockExpression [{...}] = Nothing + UReturnExpression [return inner()] = Nothing + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [inner()] = external inner()() + UIdentifier (Identifier (inner)) [UIdentifier (Identifier (inner))] + USimpleNameReferenceExpression (identifier = inner, resolvesTo = null) [inner] = external inner()() + UMethod (name = Context) [public fun Context() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/Suspend.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/Suspend.values.fir.txt new file mode 100644 index 00000000000..e023bbcd05b --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/Suspend.values.fir.txt @@ -0,0 +1,10 @@ +UFile (package = test.pkg) [package test.pkg...] + UClass (name = SuspendKt) [public final class SuspendKt {...}] + UMethod (name = top) [public static final fun top() : int = [!] UnknownKotlinExpression (DOT_QUALIFIED_EXPRESSION)] + [!] UnknownKotlinExpression (DOT_QUALIFIED_EXPRESSION) [[!] UnknownKotlinExpression (DOT_QUALIFIED_EXPRESSION)] = Undetermined + UClass (name = Context) [public final class Context {...}] + UMethod (name = Context) [public fun Context() = UastEmptyExpression] + UMethod (name = inner) [public final fun inner() : int = [!] UnknownKotlinExpression (CALL_EXPRESSION)] + [!] UnknownKotlinExpression (CALL_EXPRESSION) [[!] UnknownKotlinExpression (CALL_EXPRESSION)] = Undetermined + UMethod (name = suspendPrivate) [private final fun suspendPrivate() : int = [!] UnknownKotlinExpression (CALL_EXPRESSION)] + [!] UnknownKotlinExpression (CALL_EXPRESSION) [[!] UnknownKotlinExpression (CALL_EXPRESSION)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/TryCatch.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/TryCatch.values.fe10.txt new file mode 100644 index 00000000000..ba37356bcd0 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/TryCatch.values.fe10.txt @@ -0,0 +1,59 @@ +UFile (package = ) [public final class TryCatch {...] + UClass (name = TryCatch) [public final class TryCatch {...}] + UMethod (name = catches) [public final fun catches() : void {...}] + UBlockExpression [{...}] = external finalizer()() + UTryExpression [try {...}] = external finalizer()() + UBlockExpression [{...}] = external body()() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [body()] = external body()() + UIdentifier (Identifier (body)) [UIdentifier (Identifier (body))] + USimpleNameReferenceExpression (identifier = body, resolvesTo = null) [body] = external body()() + UCatchClause (e) [catch (@org.jetbrains.annotations.NotNull var e: java.lang.Throwable) {...}] + UParameter (name = e) [@org.jetbrains.annotations.NotNull var e: java.lang.Throwable] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = external catcher()() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [catcher()] = external catcher()() + UIdentifier (Identifier (catcher)) [UIdentifier (Identifier (catcher))] + USimpleNameReferenceExpression (identifier = catcher, resolvesTo = null) [catcher] = external catcher()() + UBlockExpression [{...}] = external finalizer()() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [finalizer()] = external finalizer()() + UIdentifier (Identifier (finalizer)) [UIdentifier (Identifier (finalizer))] + USimpleNameReferenceExpression (identifier = finalizer, resolvesTo = null) [finalizer] = external finalizer()() + UMethod (name = body) [public final fun body() : void {...}] + UBlockExpression [{...}] = Undetermined + UMethod (name = catcher) [public final fun catcher() : void {...}] + UBlockExpression [{...}] = Undetermined + UMethod (name = finalizer) [public final fun finalizer() : void {...}] + UBlockExpression [{...}] = Undetermined + UMethod (name = TryCatch) [public fun TryCatch() = UastEmptyExpression] + UClass (name = TryCatchAnnotations) [public final class TryCatchAnnotations {...}] + UMethod (name = catches) [@java.lang.SuppressWarnings(value = "Something")...}] + UAnnotation (fqName = java.lang.SuppressWarnings) [@java.lang.SuppressWarnings(value = "Something")] + UNamedExpression (name = value) [value = "Something"] = Undetermined + ULiteralExpression (value = "Something") ["Something"] = "Something" + UBlockExpression [{...}] = external finalizer()() + UTryExpression [try {...}] = external finalizer()() + UBlockExpression [{...}] = external body()() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [body()] = external body()() + UIdentifier (Identifier (body)) [UIdentifier (Identifier (body))] + USimpleNameReferenceExpression (identifier = body, resolvesTo = null) [body] = external body()() + UCatchClause (e) [catch (@org.jetbrains.annotations.NotNull @java.lang.SuppressWarnings(value = "Something") var e: java.lang.Throwable) {...}] + UParameter (name = e) [@org.jetbrains.annotations.NotNull @java.lang.SuppressWarnings(value = "Something") var e: java.lang.Throwable] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UAnnotation (fqName = java.lang.SuppressWarnings) [@java.lang.SuppressWarnings(value = "Something")] + UNamedExpression (name = value) [value = "Something"] = Undetermined + ULiteralExpression (value = "Something") ["Something"] = "Something" + UBlockExpression [{...}] = external catcher()() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [catcher()] = external catcher()() + UIdentifier (Identifier (catcher)) [UIdentifier (Identifier (catcher))] + USimpleNameReferenceExpression (identifier = catcher, resolvesTo = null) [catcher] = external catcher()() + UBlockExpression [{...}] = external finalizer()() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [finalizer()] = external finalizer()() + UIdentifier (Identifier (finalizer)) [UIdentifier (Identifier (finalizer))] + USimpleNameReferenceExpression (identifier = finalizer, resolvesTo = null) [finalizer] = external finalizer()() + UMethod (name = body) [public final fun body() : void {...}] + UBlockExpression [{...}] = Undetermined + UMethod (name = catcher) [public final fun catcher() : void {...}] + UBlockExpression [{...}] = Undetermined + UMethod (name = finalizer) [public final fun finalizer() : void {...}] + UBlockExpression [{...}] = Undetermined + UMethod (name = TryCatchAnnotations) [public fun TryCatchAnnotations() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/TryCatch.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/TryCatch.values.fir.txt new file mode 100644 index 00000000000..9e279ca46d1 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/TryCatch.values.fir.txt @@ -0,0 +1,21 @@ +UFile (package = ) [public final class TryCatch {...] + UClass (name = TryCatch) [public final class TryCatch {...}] + UMethod (name = TryCatch) [public fun TryCatch() = UastEmptyExpression] + UMethod (name = catches) [public final fun catches() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = body) [public final fun body() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = catcher) [public final fun catcher() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = finalizer) [public final fun finalizer() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UClass (name = TryCatchAnnotations) [public final class TryCatchAnnotations {...}] + UMethod (name = TryCatchAnnotations) [public fun TryCatchAnnotations() = UastEmptyExpression] + UMethod (name = catches) [public final fun catches() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = body) [public final fun body() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = catcher) [public final fun catcher() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = finalizer) [public final fun finalizer() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/TypeAliasExpansionWithOtherAliasInArgument.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/TypeAliasExpansionWithOtherAliasInArgument.values.fe10.txt new file mode 100644 index 00000000000..6e7b3650f5b --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/TypeAliasExpansionWithOtherAliasInArgument.values.fe10.txt @@ -0,0 +1,18 @@ +UFile (package = ) [public final class TypeAliasExpansionWithOtherAliasInArgumentKt {...] + UClass (name = TypeAliasExpansionWithOtherAliasInArgumentKt) [public final class TypeAliasExpansionWithOtherAliasInArgumentKt {...}] + UMethod (name = foo) [public static final fun foo(@org.jetbrains.annotations.NotNull $this$foo: kotlin.jvm.functions.Function1,kotlin.Unit>, @org.jetbrains.annotations.NotNull x: kotlin.jvm.functions.Function1,kotlin.Unit>) : kotlin.jvm.functions.Function1,kotlin.Unit> {...}] + UParameter (name = $this$foo) [@org.jetbrains.annotations.NotNull var $this$foo: kotlin.jvm.functions.Function1,kotlin.Unit>] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = x) [@org.jetbrains.annotations.NotNull var x: kotlin.jvm.functions.Function1,kotlin.Unit>] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UReturnExpression [return null] = Nothing + ULiteralExpression (value = null) [null] = null + UMethod (name = bar) [public static final fun bar(@org.jetbrains.annotations.NotNull $this$bar: java.util.Map, @org.jetbrains.annotations.NotNull x: java.util.Map) : java.util.Map {...}] + UParameter (name = $this$bar) [@org.jetbrains.annotations.NotNull var $this$bar: java.util.Map] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = x) [@org.jetbrains.annotations.NotNull var x: java.util.Map] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UReturnExpression [return null] = Nothing + ULiteralExpression (value = null) [null] = null diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/TypeAliasExpansionWithOtherAliasInArgument.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/TypeAliasExpansionWithOtherAliasInArgument.values.fir.txt new file mode 100644 index 00000000000..726218d35d7 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/TypeAliasExpansionWithOtherAliasInArgument.values.fir.txt @@ -0,0 +1,10 @@ +UFile (package = ) [public final class TypeAliasExpansionWithOtherAliasInArgumentKt {...] + UClass (name = TypeAliasExpansionWithOtherAliasInArgumentKt) [public final class TypeAliasExpansionWithOtherAliasInArgumentKt {...}] + UMethod (name = foo) [public static final fun foo($this$foo: kotlin.jvm.functions.Function1, x: kotlin.jvm.functions.Function1) : kotlin.jvm.functions.Function1 = [!] UnknownKotlinExpression (NULL)] + UParameter (name = $this$foo) [var $this$foo: kotlin.jvm.functions.Function1] + UParameter (name = x) [var x: kotlin.jvm.functions.Function1] + [!] UnknownKotlinExpression (NULL) [[!] UnknownKotlinExpression (NULL)] = Undetermined + UMethod (name = bar) [public static final fun bar($this$bar: java.util.Map, x: java.util.Map) : java.util.Map = [!] UnknownKotlinExpression (NULL)] + UParameter (name = $this$bar) [var $this$bar: java.util.Map] + UParameter (name = x) [var x: java.util.Map] + [!] UnknownKotlinExpression (NULL) [[!] UnknownKotlinExpression (NULL)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/TypeAliases.values.txt b/plugins/uast-kotlin-fir/testData/legacyValues/TypeAliases.values.txt new file mode 100644 index 00000000000..3f63e5488fa --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/TypeAliases.values.txt @@ -0,0 +1,4 @@ +UFile (package = ) [public final class TypeAliasesKt {...] + UClass (name = TypeAliasesKt) [public final class TypeAliasesKt {...}] + UClass (name = A) [public final class A {...}] + UMethod (name = A) [public fun A() = UastEmptyExpression] \ No newline at end of file diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/TypeInAnnotation.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/TypeInAnnotation.values.fe10.txt new file mode 100644 index 00000000000..a8ad79bc197 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/TypeInAnnotation.values.fe10.txt @@ -0,0 +1,5 @@ +UFile (package = ) [public final class C {...] + UClass (name = C) [public final class C {...}] + UMethod (name = foo) [public final fun foo() : void {...}] + UBlockExpression [{...}] = Undetermined + UMethod (name = C) [public fun C() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/TypeInAnnotation.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/TypeInAnnotation.values.fir.txt new file mode 100644 index 00000000000..1517b1379a4 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/TypeInAnnotation.values.fir.txt @@ -0,0 +1,5 @@ +UFile (package = ) [public final class C {...] + UClass (name = C) [public final class C {...}] + UMethod (name = C) [public fun C() = UastEmptyExpression] + UMethod (name = foo) [public final fun foo() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/TypeReferences.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/TypeReferences.values.fe10.txt new file mode 100644 index 00000000000..6afc2625d28 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/TypeReferences.values.fe10.txt @@ -0,0 +1,81 @@ +UFile (package = ) [public final class TypeReferencesKt {...] + UClass (name = TypeReferencesKt) [public final class TypeReferencesKt {...}] + UMethod (name = foo) [public static final fun foo(@org.jetbrains.annotations.NotNull parameter: int) : java.lang.String {...}] + UParameter (name = parameter) [@org.jetbrains.annotations.NotNull var parameter: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UDeclarationsExpression [var varWithType: java.lang.String = "Not Null"] = Undetermined + ULocalVariable (name = varWithType) [var varWithType: java.lang.String = "Not Null"] + ULiteralExpression (value = "Not Null") ["Not Null"] = "Not Null" + UDeclarationsExpression [var varWithoutType: java.lang.String = "lorem ipsum"] = Undetermined + ULocalVariable (name = varWithoutType) [var varWithoutType: java.lang.String = "lorem ipsum"] + ULiteralExpression (value = "lorem ipsum") ["lorem ipsum"] = "lorem ipsum" + UDeclarationsExpression [var result: java.lang.String = varWithType + varWithoutType] = Undetermined + ULocalVariable (name = result) [var result: java.lang.String = varWithType + varWithoutType] + UBinaryExpression (operator = +) [varWithType + varWithoutType] = "Not Nulllorem ipsum" (depending on: (var varWithType = "Not Null"), (var varWithoutType = "lorem ipsum")) + USimpleNameReferenceExpression (identifier = varWithType) [varWithType] = (var varWithType = "Not Null") + USimpleNameReferenceExpression (identifier = varWithoutType) [varWithoutType] = (var varWithoutType = "lorem ipsum") + UReturnExpression [return result] = Nothing + USimpleNameReferenceExpression (identifier = result) [result] = (var result = "Not Nulllorem ipsum" (depending on: (var varWithType = "Not Null"), (var varWithoutType = "lorem ipsum"))) + UMethod (name = parameterizedFoo) [public static final fun parameterizedFoo(@org.jetbrains.annotations.Nullable arg: T) : void {...}] + UParameter (name = arg) [@org.jetbrains.annotations.Nullable var arg: T] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] + UBlockExpression [{...}] = external parameterizedFoo(emptyList())(external emptyList()()) + UDeclarationsExpression [var a: T = arg] = Undetermined + ULocalVariable (name = a) [var a: T = arg] + USimpleNameReferenceExpression (identifier = arg) [arg] = Undetermined + UDeclarationsExpression [var at: T = elvis {...}] = Undetermined + ULocalVariable (name = at) [var at: T = elvis {...}] + UExpressionList (elvis) [elvis {...}] = Undetermined + UDeclarationsExpression [var var708e23eb: T = arg] = Undetermined + ULocalVariable (name = var708e23eb) [var var708e23eb: T = arg] + USimpleNameReferenceExpression (identifier = arg) [arg] = Undetermined + UIfExpression [if (var708e23eb != null) var708e23eb else return] = Undetermined + UBinaryExpression (operator = !=) [var708e23eb != null] = Undetermined + USimpleNameReferenceExpression (identifier = var708e23eb) [var708e23eb] = Undetermined + ULiteralExpression (value = null) [null] = null + USimpleNameReferenceExpression (identifier = var708e23eb) [var708e23eb] = Undetermined + UReturnExpression [return] = Nothing + UDeclarationsExpression [var tl: java.util.List = listOf(at)] = Undetermined + ULocalVariable (name = tl) [var tl: java.util.List = listOf(at)] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [listOf(at)] = external listOf(at)((var at = Undetermined)) + UIdentifier (Identifier (listOf)) [UIdentifier (Identifier (listOf))] + USimpleNameReferenceExpression (identifier = listOf, resolvesTo = null) [listOf] = external listOf(at)((var at = Undetermined)) + USimpleNameReferenceExpression (identifier = at) [at] = (var at = Undetermined) + UDeclarationsExpression [var tsl: java.util.List = tl.map({ var it: T ->...})] = Undetermined + ULocalVariable (name = tsl) [var tsl: java.util.List = tl.map({ var it: T ->...})] + UQualifiedReferenceExpression [tl.map({ var it: T ->...})] = external map({ var it: T -> + + return it.toString() +})(Undetermined) + USimpleNameReferenceExpression (identifier = tl) [tl] = (var tl = external listOf(at)((var at = Undetermined))) + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [map({ var it: T ->...})] = external map({ var it: T -> + + return it.toString() +})(Undetermined) + UIdentifier (Identifier (map)) [UIdentifier (Identifier (map))] + USimpleNameReferenceExpression (identifier = map, resolvesTo = null) [map] = external map({ var it: T -> + + return it.toString() +})(Undetermined) + ULambdaExpression [{ var it: T ->...}] = Undetermined + UParameter (name = it) [var it: T] + UBlockExpression [{...}] = Nothing + UReturnExpression [return it.toString()] = Undetermined + UQualifiedReferenceExpression [it.toString()] = external toString()() + USimpleNameReferenceExpression (identifier = it) [it] = external it() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [toString()] = external toString()() + UIdentifier (Identifier (toString)) [UIdentifier (Identifier (toString))] + USimpleNameReferenceExpression (identifier = toString, resolvesTo = null) [toString] = external toString()() + UDeclarationsExpression [var lls: java.util.List>] = Undetermined + ULocalVariable (name = lls) [var lls: java.util.List>] + UDeclarationsExpression [var llsAliased: java.util.List>] = Undetermined + ULocalVariable (name = llsAliased) [var llsAliased: java.util.List>] + UDeclarationsExpression [var llt: java.util.List>] = Undetermined + ULocalVariable (name = llt) [var llt: java.util.List>] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [parameterizedFoo(emptyList())] = external parameterizedFoo(emptyList())(external emptyList()()) + UIdentifier (Identifier (parameterizedFoo)) [UIdentifier (Identifier (parameterizedFoo))] + USimpleNameReferenceExpression (identifier = parameterizedFoo, resolvesTo = null) [parameterizedFoo] = external parameterizedFoo(emptyList())(external emptyList()()) + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [emptyList()] = external emptyList()() + UIdentifier (Identifier (emptyList)) [UIdentifier (Identifier (emptyList))] + USimpleNameReferenceExpression (identifier = emptyList, resolvesTo = null) [emptyList] = external emptyList()() diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/TypeReferences.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/TypeReferences.values.fir.txt new file mode 100644 index 00000000000..54ef3abcc4a --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/TypeReferences.values.fir.txt @@ -0,0 +1,8 @@ +UFile (package = ) [public final class TypeReferencesKt {...] + UClass (name = TypeReferencesKt) [public final class TypeReferencesKt {...}] + UMethod (name = foo) [public static final fun foo(parameter: int) : java.lang.String = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = parameter) [var parameter: int] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UMethod (name = parameterizedFoo) [public static final fun parameterizedFoo(arg: T) : void = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = arg) [var arg: T] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/UnexpectedContainerException.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/UnexpectedContainerException.values.fe10.txt new file mode 100644 index 00000000000..63c41ea7098 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/UnexpectedContainerException.values.fe10.txt @@ -0,0 +1,64 @@ +UFile (package = ) [public abstract interface Callback {...] + UClass (name = Callback) [public abstract interface Callback {...}] + UMethod (name = onError) [public abstract fun onError(@org.jetbrains.annotations.NotNull throwable: java.lang.Throwable) : void = UastEmptyExpression] + UParameter (name = throwable) [@org.jetbrains.annotations.NotNull var throwable: java.lang.Throwable] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UClass (name = Model) [public final class Model {...}] + UMethod (name = crashMe) [public final fun crashMe(@org.jetbrains.annotations.NotNull clazz: java.lang.Class, @org.jetbrains.annotations.NotNull factory: kotlin.jvm.functions.Function0) : void {...}] + UParameter (name = clazz) [@org.jetbrains.annotations.NotNull var clazz: java.lang.Class] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UParameter (name = factory) [@org.jetbrains.annotations.NotNull var factory: kotlin.jvm.functions.Function0] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UThrowExpression [throw ()] = Nothing + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] = external ()() + UIdentifier (Identifier (UnsupportedOperationException)) [UIdentifier (Identifier (UnsupportedOperationException))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: UnsupportedOperationException) [] = external ()() + UMethod (name = Model) [public fun Model() {...}] + UBlockExpression [{...}] = external crashMe(Callback.java, { + return anonymous object : Callback { + override fun onError(throwable: Throwable) { + throw UnsupportedOperationException("") + } + } +})(external java(), Undetermined) + UBlockExpression [{...}] = external crashMe(Callback.java, { + return anonymous object : Callback { + override fun onError(throwable: Throwable) { + throw UnsupportedOperationException("") + } + } +})(external java(), Undetermined) + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 2)) [crashMe(Callback.java, { ...})] = external crashMe(Callback.java, { + return anonymous object : Callback { + override fun onError(throwable: Throwable) { + throw UnsupportedOperationException("") + } + } +})(external java(), Undetermined) + UIdentifier (Identifier (crashMe)) [UIdentifier (Identifier (crashMe))] + USimpleNameReferenceExpression (identifier = crashMe, resolvesTo = null) [crashMe] = external crashMe(Callback.java, { + return anonymous object : Callback { + override fun onError(throwable: Throwable) { + throw UnsupportedOperationException("") + } + } +})(external java(), Undetermined) + UQualifiedReferenceExpression [Callback.java] = external java() + UClassLiteralExpression [Callback] = Callback + USimpleNameReferenceExpression (identifier = java) [java] = external java() + ULambdaExpression [{ ...}] = Undetermined + UBlockExpression [{...}] = Nothing + UReturnExpression [return anonymous object : Callback {... }] = Nothing + UObjectLiteralExpression [anonymous object : Callback {... }] = Undetermined + UClass (name = null) [final class null : Callback {...}] + UMethod (name = onError) [public fun onError(@org.jetbrains.annotations.NotNull throwable: java.lang.Throwable) : void {...}] + UParameter (name = throwable) [@org.jetbrains.annotations.NotNull var throwable: java.lang.Throwable] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UThrowExpression [throw ("")] = Nothing + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [("")] = external ("")("") + UIdentifier (Identifier (UnsupportedOperationException)) [UIdentifier (Identifier (UnsupportedOperationException))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: UnsupportedOperationException) [] = external ("")("") + ULiteralExpression (value = "") [""] = "" + UMethod (name = ) [private fun () = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/UnexpectedContainerException.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/UnexpectedContainerException.values.fir.txt new file mode 100644 index 00000000000..a51160c16e1 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/UnexpectedContainerException.values.fir.txt @@ -0,0 +1,10 @@ +UFile (package = ) [public abstract interface Callback {...] + UClass (name = Callback) [public abstract interface Callback {...}] + UMethod (name = onError) [public abstract fun onError(throwable: java.lang.Throwable) : void = UastEmptyExpression] + UParameter (name = throwable) [var throwable: java.lang.Throwable] + UClass (name = Model) [public final class Model {...}] + UMethod (name = Model) [public fun Model() = UastEmptyExpression] + UMethod (name = crashMe) [public final fun crashMe(clazz: java.lang.Class, factory: kotlin.jvm.functions.Function0) : void = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = clazz) [var clazz: java.lang.Class] + UParameter (name = factory) [var factory: kotlin.jvm.functions.Function0] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/WhenAndDestructing.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/WhenAndDestructing.values.fe10.txt new file mode 100644 index 00000000000..dec30b3108d --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/WhenAndDestructing.values.fe10.txt @@ -0,0 +1,48 @@ +UFile (package = ) [public final class WhenAndDestructingKt {...] + UClass (name = WhenAndDestructingKt) [public final class WhenAndDestructingKt {...}] + UMethod (name = getElementsAdditionalResolve) [public static final fun getElementsAdditionalResolve(@org.jetbrains.annotations.NotNull string: java.lang.String) : java.lang.String {...}] + UParameter (name = string) [@org.jetbrains.annotations.NotNull var string: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UDeclarationsExpression [var arr: java.util.List = listOf("1", "2")] = Undetermined + ULocalVariable (name = arr) [var arr: java.util.List = listOf("1", "2")] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 2)) [listOf("1", "2")] = external listOf("1", "2")("1", "2") + UIdentifier (Identifier (listOf)) [UIdentifier (Identifier (listOf))] + USimpleNameReferenceExpression (identifier = listOf, resolvesTo = null) [listOf] = external listOf("1", "2")("1", "2") + ULiteralExpression (value = "1") ["1"] = "1" + ULiteralExpression (value = "2") ["2"] = "2" + USwitchExpression [switch (string) {...] = Nothing + USimpleNameReferenceExpression (identifier = string) [string] = Undetermined + UExpressionList (when) [ "aaaa" -> {... ] = Nothing + USwitchClauseExpressionWithBody ["aaaa" -> {...] = Undetermined + ULiteralExpression (value = "aaaa") ["aaaa"] = "aaaa" + UExpressionList (when_entry) [{...] = Undetermined + UYieldExpression [yield return "bindingContext"] = UYieldResult(Nothing) + UReturnExpression [return "bindingContext"] = Nothing + ULiteralExpression (value = "bindingContext") ["bindingContext"] = "bindingContext" + USwitchClauseExpressionWithBody ["empty-switch" -> {...] = Undetermined + ULiteralExpression (value = "empty-switch") ["empty-switch"] = "empty-switch" + UExpressionList (when_entry) [{...] = Undetermined + USwitchClauseExpressionWithBody [ -> {...] = Undetermined + UExpressionList (when_entry) [{...] = Undetermined + UDeclarationsExpression [@null var var837f2350: = arr...@null var statementFilter: java.lang.String = var837f2350.()] = Undetermined + ULocalVariable (name = var837f2350) [@null var var837f2350: = arr] + UAnnotation (fqName = null) [@null] + USimpleNameReferenceExpression (identifier = arr) [arr] = (var arr = external listOf("1", "2")("1", "2")) + ULocalVariable (name = bindingContext) [@null var bindingContext: java.lang.String = var837f2350.()] + UAnnotation (fqName = null) [@null] + UQualifiedReferenceExpression [var837f2350.()] = external ()() + USimpleNameReferenceExpression (identifier = var837f2350) [var837f2350] = external var837f2350() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [()] = external ()() + UIdentifier (Identifier (component1)) [UIdentifier (Identifier (component1))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] = external ()() + ULocalVariable (name = statementFilter) [@null var statementFilter: java.lang.String = var837f2350.()] + UAnnotation (fqName = null) [@null] + UQualifiedReferenceExpression [var837f2350.()] = external ()() + USimpleNameReferenceExpression (identifier = var837f2350) [var837f2350] = external var837f2350() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [()] = external ()() + UIdentifier (Identifier (component2)) [UIdentifier (Identifier (component2))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] = external ()() + UYieldExpression [yield return bindingContext] = UYieldResult(Nothing) + UReturnExpression [return bindingContext] = Nothing + USimpleNameReferenceExpression (identifier = bindingContext) [bindingContext] = (var bindingContext = external ()()) diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/WhenAndDestructing.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/WhenAndDestructing.values.fir.txt new file mode 100644 index 00000000000..ec903826a7e --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/WhenAndDestructing.values.fir.txt @@ -0,0 +1,5 @@ +UFile (package = ) [public final class WhenAndDestructingKt {...] + UClass (name = WhenAndDestructingKt) [public final class WhenAndDestructingKt {...}] + UMethod (name = getElementsAdditionalResolve) [public static final fun getElementsAdditionalResolve(string: java.lang.String) : java.lang.String = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = string) [var string: java.lang.String] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/WhenIs.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/WhenIs.values.fe10.txt new file mode 100644 index 00000000000..d1dbe3b770e --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/WhenIs.values.fe10.txt @@ -0,0 +1,24 @@ +UFile (package = ) [public final class WhenIsKt {...] + UClass (name = WhenIsKt) [public final class WhenIsKt {...}] + UMethod (name = foo) [public static final fun foo(@org.jetbrains.annotations.NotNull bar: java.lang.Object) : java.lang.String {...}] + UParameter (name = bar) [@org.jetbrains.annotations.NotNull var bar: java.lang.Object] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] = Nothing + UReturnExpression [return switch (bar) {...] = Nothing + USwitchExpression [switch (bar) {...] = Undetermined + USimpleNameReferenceExpression (identifier = bar) [bar] = Undetermined + UExpressionList (when) [ it is java.lang.String -> {... ] = Undetermined + USwitchClauseExpressionWithBody [it is java.lang.String -> {...] = Undetermined + UBinaryExpressionWithType [it is java.lang.String] = Undetermined + USimpleNameReferenceExpression (identifier = it) [it] = Nothing + UTypeReferenceExpression (name = java.lang.String) [java.lang.String] = Undetermined + UExpressionList (when_entry) [{...] = Undetermined + UYieldExpression [yield bar] = UYieldResult(Undetermined) + USimpleNameReferenceExpression (identifier = bar) [bar] = Undetermined + USwitchClauseExpressionWithBody [it !is java.lang.String -> {...] = Undetermined + UBinaryExpressionWithType [it !is java.lang.String] = Undetermined + USimpleNameReferenceExpression (identifier = it) [it] = Nothing + UTypeReferenceExpression (name = java.lang.String) [java.lang.String] = Undetermined + UExpressionList (when_entry) [{...] = Undetermined + UYieldExpression [yield ""] = UYieldResult("") + ULiteralExpression (value = "") [""] = "" diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/WhenIs.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/WhenIs.values.fir.txt new file mode 100644 index 00000000000..cbfc00bf433 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/WhenIs.values.fir.txt @@ -0,0 +1,5 @@ +UFile (package = ) [public final class WhenIsKt {...] + UClass (name = WhenIsKt) [public final class WhenIsKt {...}] + UMethod (name = foo) [public static final fun foo(bar: java.lang.Object) : void = [!] UnknownKotlinExpression (WHEN)] + UParameter (name = bar) [var bar: java.lang.Object] + [!] UnknownKotlinExpression (WHEN) [[!] UnknownKotlinExpression (WHEN)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/WhenStringLiteral.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/WhenStringLiteral.values.fe10.txt new file mode 100644 index 00000000000..cce39cafc05 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/WhenStringLiteral.values.fe10.txt @@ -0,0 +1,33 @@ +UFile (package = ) [public final class WhenStringLiteralKt {...] + UClass (name = WhenStringLiteralKt) [public final class WhenStringLiteralKt {...}] + UField (name = a) [@org.jetbrains.annotations.Nullable private static final var a: java.lang.String = readLine()] + UAnnotation (fqName = org.jetbrains.annotations.Nullable) [@org.jetbrains.annotations.Nullable] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [readLine()] = external readLine()() + UIdentifier (Identifier (readLine)) [UIdentifier (Identifier (readLine))] + USimpleNameReferenceExpression (identifier = readLine, resolvesTo = null) [readLine] = external readLine()() + UField (name = b) [@org.jetbrains.annotations.NotNull private static final var b: int = switch (a) {...] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + USwitchExpression [switch (a) {...] = Phi(1, 2) + USimpleNameReferenceExpression (identifier = a) [a] = external a() + UExpressionList (when) [ "abc" -> {... ] = Phi(1, 2) + USwitchClauseExpressionWithBody ["abc" -> {...] = Undetermined + ULiteralExpression (value = "abc") ["abc"] = "abc" + UExpressionList (when_entry) [{...] = Undetermined + UYieldExpression [yield 1] = UYieldResult(1) + ULiteralExpression (value = 1) [1] = 1 + USwitchClauseExpressionWithBody ["def", "ghi" -> {...] = Undetermined + ULiteralExpression (value = "def") ["def"] = "def" + ULiteralExpression (value = "ghi") ["ghi"] = "ghi" + UExpressionList (when_entry) [{...] = Undetermined + UYieldExpression [yield 2] = UYieldResult(2) + ULiteralExpression (value = 2) [2] = 2 + USwitchClauseExpressionWithBody [ -> {...] = Undetermined + UExpressionList (when_entry) [{...] = Undetermined + UYieldExpression [yield 3] = UYieldResult(3) + ULiteralExpression (value = 3) [3] = 3 + UMethod (name = getA) [public static final fun getA() : java.lang.String = UastEmptyExpression] + UMethod (name = getB) [public static final fun getB() : int = UastEmptyExpression] + UMethod (name = ) [public static final fun () : void {...}] + UBlockExpression [{...}] = "def1" + ULiteralExpression (value = "abc1") ["abc1"] = "abc1" + ULiteralExpression (value = "def1") ["def1"] = "def1" diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/WhenStringLiteral.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/WhenStringLiteral.values.fir.txt new file mode 100644 index 00000000000..ab6142a9f9e --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/WhenStringLiteral.values.fir.txt @@ -0,0 +1,10 @@ +UFile (package = ) [public final class WhenStringLiteralKt {...] + UClass (name = WhenStringLiteralKt) [public final class WhenStringLiteralKt {...}] + UField (name = a) [private static final var a: java.lang.String = [!] UnknownKotlinExpression (CALL_EXPRESSION)] + [!] UnknownKotlinExpression (CALL_EXPRESSION) [[!] UnknownKotlinExpression (CALL_EXPRESSION)] = Undetermined + UField (name = b) [private static final var b: int = [!] UnknownKotlinExpression (WHEN)] + [!] UnknownKotlinExpression (WHEN) [[!] UnknownKotlinExpression (WHEN)] = Undetermined + UMethod (name = getA) [public static final fun getA() : java.lang.String = UastEmptyExpression] + UMethod (name = getB) [public static final fun getB() : int = UastEmptyExpression] + UMethod (name = ) [public static final fun () : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/ea101715.values.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyValues/ea101715.values.fe10.txt new file mode 100644 index 00000000000..802e70d3f92 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/ea101715.values.fe10.txt @@ -0,0 +1,14 @@ +UFile (package = ) [public final class Ea101715Kt {...] + UClass (name = Ea101715Kt) [public final class Ea101715Kt {...}] + UMethod (name = a) [public static final fun a() : void {...}] + UBlockExpression [{...}] = Undetermined + UDeclarationsExpression [var a: = (555)] = Undetermined + ULocalVariable (name = a) [var a: = (555)] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [(555)] = external (555)(555) + UIdentifier (Identifier (Obj)) [UIdentifier (Identifier (Obj))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] = external (555)(555) + ULiteralExpression (value = 555) [555] = 555 + UClass (name = Obj) [public final class Obj {...}] + UField (name = INSTANCE) [@null public static final var INSTANCE: Obj] + UAnnotation (fqName = null) [@null] + UMethod (name = Obj) [private fun Obj() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/ea101715.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/ea101715.values.fir.txt new file mode 100644 index 00000000000..523ba1d7da4 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyValues/ea101715.values.fir.txt @@ -0,0 +1,7 @@ +UFile (package = ) [public final class Ea101715Kt {...] + UClass (name = Ea101715Kt) [public final class Ea101715Kt {...}] + UMethod (name = a) [public static final fun a() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] = Undetermined + UClass (name = Obj) [public final class Obj {...}] + UField (name = INSTANCE) [public static final var INSTANCE: Obj] + UMethod (name = Obj) [private fun Obj() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/common/kotlin/FirLegacyUastValuesTestBase.kt b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/common/kotlin/FirLegacyUastValuesTestBase.kt new file mode 100644 index 00000000000..070714a02d1 --- /dev/null +++ b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/common/kotlin/FirLegacyUastValuesTestBase.kt @@ -0,0 +1,18 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.uast.test.common.kotlin + +import java.io.File + +interface FirLegacyUastValuesTestBase : FirUastValuesTestBase { + override fun getTestMetadataFileFromPath(filePath: String, ext: String): File { + // We're using test files from .../uast-kotlin/testData/... + // but want to store metadata under .../uast-kotlin-fir/testData/legacyValues/... + val revisedFilePath = + filePath.replace("uast-kotlin", "uast-kotlin-fir").replace("testData", "testData/legacyValues") + return super.getTestMetadataFileFromPath(revisedFilePath, ext) + } +} diff --git a/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/common/kotlin/FirUastValuesTestBase.kt b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/common/kotlin/FirUastValuesTestBase.kt new file mode 100644 index 00000000000..f1edca268c4 --- /dev/null +++ b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/common/kotlin/FirUastValuesTestBase.kt @@ -0,0 +1,49 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.uast.test.common.kotlin + +import org.jetbrains.kotlin.test.KotlinTestUtils +import org.jetbrains.kotlin.test.KtAssert +import org.jetbrains.uast.UFile +import org.jetbrains.uast.test.common.kotlin.FirUastTestSuffix.TXT +import java.io.File + +interface FirUastValuesTestBase : FirUastPluginSelection, FirUastFileComparisonTestBase { + private fun getValuesFile(filePath: String, suffix: String): File = getTestMetadataFileFromPath(filePath, "values$suffix") + + private fun getIdenticalValuesFile(filePath: String): File = getValuesFile(filePath, TXT) + + private fun getPluginValuesFile(filePath: String): File { + val identicalFile = getIdenticalValuesFile(filePath) + if (identicalFile.exists()) return identicalFile + return getValuesFile(filePath, "$pluginSuffix$TXT") + } + + // TODO: ideally, we don't want this kind of whitelist. + fun isExpectedToFail(filePath: String): Boolean { + return false + } + + fun check(filePath: String, file: UFile) { + val valuesFile = getPluginValuesFile(filePath) + + try { + KotlinTestUtils.assertEqualsToFile(valuesFile, file.asLogValues()) + if (isExpectedToFail(filePath)) { + KtAssert.fail("This test seems not fail anymore. Drop this from the white-list and re-run the test.") + } + } catch (e: Exception) { + if (!isExpectedToFail(filePath)) throw e + } + + cleanUpIdenticalFile( + valuesFile, + getValuesFile(filePath, "$counterpartSuffix$TXT"), + getIdenticalValuesFile(filePath), + kind = "values" + ) + } +} diff --git a/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/AbstractFE1LegacyUastValuesTest.kt b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/AbstractFE1LegacyUastValuesTest.kt new file mode 100644 index 00000000000..dc97e142bb9 --- /dev/null +++ b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/AbstractFE1LegacyUastValuesTest.kt @@ -0,0 +1,19 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.uast.test.kotlin + +import org.jetbrains.uast.test.common.kotlin.FirLegacyUastValuesTestBase + +abstract class AbstractFE1LegacyUastValuesTest : AbstractFE1UastValuesTest(), FirLegacyUastValuesTestBase { + // TODO: better not to see exceptions from legacy UAST + private val whitelist : Set = setOf( + // TODO: div-by-zero error! + "plugins/uast-kotlin/testData/Bitwise.kt", + ) + override fun isExpectedToFail(filePath: String): Boolean { + return filePath in whitelist + } +} diff --git a/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/AbstractFE1UastValuesTest.kt b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/AbstractFE1UastValuesTest.kt new file mode 100644 index 00000000000..62f9067aaa4 --- /dev/null +++ b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/AbstractFE1UastValuesTest.kt @@ -0,0 +1,30 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.uast.test.kotlin + +import org.jetbrains.uast.UFile +import org.jetbrains.uast.test.common.kotlin.FirUastValuesTestBase +import java.io.File + +abstract class AbstractFE1UastValuesTest : AbstractKotlinUastTest(), FirUastValuesTestBase { + override val isFirUastPlugin: Boolean = false + + override fun check(filePath: String, file: UFile) { + super.check(filePath, file) + } + + override var testDataDir = File("plugins/uast-kotlin-fir/testData") + + fun doTest(filePath: String) { + testDataDir = File(filePath).parentFile + val testName = filePath.substring(filePath.lastIndexOf('/') + 1).removeSuffix(".kt") + val virtualFile = getVirtualFile(testName) + + val psiFile = psiManager.findFile(virtualFile) ?: error("Can't get psi file for $testName") + val uFile = uastContext.convertElementWithParent(psiFile, null) ?: error("Can't get UFile for $testName") + check(filePath, uFile as UFile) + } +} diff --git a/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/AbstractFirLegacyUastValuesTest.kt b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/AbstractFirLegacyUastValuesTest.kt new file mode 100644 index 00000000000..1dbe08a8b98 --- /dev/null +++ b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/AbstractFirLegacyUastValuesTest.kt @@ -0,0 +1,10 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.uast.test.kotlin + +import org.jetbrains.uast.test.common.kotlin.FirLegacyUastValuesTestBase + +abstract class AbstractFirLegacyUastValuesTest : AbstractFirUastValuesTest(), FirLegacyUastValuesTestBase diff --git a/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/AbstractFirUastValuesTest.kt b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/AbstractFirUastValuesTest.kt new file mode 100644 index 00000000000..fa5e93fa910 --- /dev/null +++ b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/AbstractFirUastValuesTest.kt @@ -0,0 +1,22 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.uast.test.kotlin + +import org.jetbrains.uast.UFile +import org.jetbrains.uast.test.common.kotlin.FirUastValuesTestBase +import org.jetbrains.uast.test.env.kotlin.AbstractFirUastTest + +abstract class AbstractFirUastValuesTest : AbstractFirUastTest(), FirUastValuesTestBase { + override val isFirUastPlugin: Boolean = true + + override fun check(filePath: String, file: UFile) { + super.check(filePath, file) + } + + fun doTest(filePath: String) { + doCheck(filePath) + } +} diff --git a/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/FE1LegacyUastValuesTestGenerated.java b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/FE1LegacyUastValuesTestGenerated.java new file mode 100644 index 00000000000..79243f11f35 --- /dev/null +++ b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/FE1LegacyUastValuesTestGenerated.java @@ -0,0 +1,381 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.uast.test.kotlin; + +import com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; +import org.jetbrains.kotlin.test.KotlinTestUtils; +import org.jetbrains.kotlin.test.util.KtTestUtil; +import org.jetbrains.kotlin.test.TestMetadata; +import org.junit.runner.RunWith; + +import java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("plugins/uast-kotlin/testData") +@TestDataPath("$PROJECT_ROOT") +@RunWith(JUnit3RunnerWithInners.class) +public class FE1LegacyUastValuesTestGenerated extends AbstractFE1LegacyUastValuesTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInTestData() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/uast-kotlin/testData"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @TestMetadata("AnnotatedExpressions.kt") + public void testAnnotatedExpressions() throws Exception { + runTest("plugins/uast-kotlin/testData/AnnotatedExpressions.kt"); + } + + @TestMetadata("AnnotationComplex.kt") + public void testAnnotationComplex() throws Exception { + runTest("plugins/uast-kotlin/testData/AnnotationComplex.kt"); + } + + @TestMetadata("AnnotationParameters.kt") + public void testAnnotationParameters() throws Exception { + runTest("plugins/uast-kotlin/testData/AnnotationParameters.kt"); + } + + @TestMetadata("Anonymous.kt") + public void testAnonymous() throws Exception { + runTest("plugins/uast-kotlin/testData/Anonymous.kt"); + } + + @TestMetadata("Assertion.kt") + public void testAssertion() throws Exception { + runTest("plugins/uast-kotlin/testData/Assertion.kt"); + } + + @TestMetadata("Bitwise.kt") + public void testBitwise() throws Exception { + runTest("plugins/uast-kotlin/testData/Bitwise.kt"); + } + + @TestMetadata("BrokenMethod.kt") + public void testBrokenMethod() throws Exception { + runTest("plugins/uast-kotlin/testData/BrokenMethod.kt"); + } + + @TestMetadata("ClassAnnotation.kt") + public void testClassAnnotation() throws Exception { + runTest("plugins/uast-kotlin/testData/ClassAnnotation.kt"); + } + + @TestMetadata("ConstructorDelegate.kt") + public void testConstructorDelegate() throws Exception { + runTest("plugins/uast-kotlin/testData/ConstructorDelegate.kt"); + } + + @TestMetadata("Constructors.kt") + public void testConstructors() throws Exception { + runTest("plugins/uast-kotlin/testData/Constructors.kt"); + } + + @TestMetadata("CycleInTypeParameters.kt") + public void testCycleInTypeParameters() throws Exception { + runTest("plugins/uast-kotlin/testData/CycleInTypeParameters.kt"); + } + + @TestMetadata("DefaultImpls.kt") + public void testDefaultImpls() throws Exception { + runTest("plugins/uast-kotlin/testData/DefaultImpls.kt"); + } + + @TestMetadata("DefaultParameterValues.kt") + public void testDefaultParameterValues() throws Exception { + runTest("plugins/uast-kotlin/testData/DefaultParameterValues.kt"); + } + + @TestMetadata("Delegate.kt") + public void testDelegate() throws Exception { + runTest("plugins/uast-kotlin/testData/Delegate.kt"); + } + + @TestMetadata("DeprecatedHidden.kt") + public void testDeprecatedHidden() throws Exception { + runTest("plugins/uast-kotlin/testData/DeprecatedHidden.kt"); + } + + @TestMetadata("DestructuringDeclaration.kt") + public void testDestructuringDeclaration() throws Exception { + runTest("plugins/uast-kotlin/testData/DestructuringDeclaration.kt"); + } + + @TestMetadata("ea101715.kt") + public void testEa101715() throws Exception { + runTest("plugins/uast-kotlin/testData/ea101715.kt"); + } + + @TestMetadata("Elvis.kt") + public void testElvis() throws Exception { + runTest("plugins/uast-kotlin/testData/Elvis.kt"); + } + + @TestMetadata("ElvisType.kt") + public void testElvisType() throws Exception { + runTest("plugins/uast-kotlin/testData/ElvisType.kt"); + } + + @TestMetadata("EnumValueMembers.kt") + public void testEnumValueMembers() throws Exception { + runTest("plugins/uast-kotlin/testData/EnumValueMembers.kt"); + } + + @TestMetadata("EnumValuesConstructors.kt") + public void testEnumValuesConstructors() throws Exception { + runTest("plugins/uast-kotlin/testData/EnumValuesConstructors.kt"); + } + + @TestMetadata("IfStatement.kt") + public void testIfStatement() throws Exception { + runTest("plugins/uast-kotlin/testData/IfStatement.kt"); + } + + @TestMetadata("Imports.kt") + public void testImports() throws Exception { + runTest("plugins/uast-kotlin/testData/Imports.kt"); + } + + @TestMetadata("In.kt") + public void testIn() throws Exception { + runTest("plugins/uast-kotlin/testData/In.kt"); + } + + @TestMetadata("InferenceInsideUnresolvedConstructor.kt") + public void testInferenceInsideUnresolvedConstructor() throws Exception { + runTest("plugins/uast-kotlin/testData/InferenceInsideUnresolvedConstructor.kt"); + } + + @TestMetadata("InnerClasses.kt") + public void testInnerClasses() throws Exception { + runTest("plugins/uast-kotlin/testData/InnerClasses.kt"); + } + + @TestMetadata("InnerNonFixedTypeVariable.kt") + public void testInnerNonFixedTypeVariable() throws Exception { + runTest("plugins/uast-kotlin/testData/InnerNonFixedTypeVariable.kt"); + } + + @TestMetadata("LambdaReturn.kt") + public void testLambdaReturn() throws Exception { + runTest("plugins/uast-kotlin/testData/LambdaReturn.kt"); + } + + @TestMetadata("Lambdas.kt") + public void testLambdas() throws Exception { + runTest("plugins/uast-kotlin/testData/Lambdas.kt"); + } + + @TestMetadata("LocalDeclarations.kt") + public void testLocalDeclarations() throws Exception { + runTest("plugins/uast-kotlin/testData/LocalDeclarations.kt"); + } + + @TestMetadata("LocalVariableWithAnnotation.kt") + public void testLocalVariableWithAnnotation() throws Exception { + runTest("plugins/uast-kotlin/testData/LocalVariableWithAnnotation.kt"); + } + + @TestMetadata("ManyAlternatives.kt") + public void testManyAlternatives() throws Exception { + runTest("plugins/uast-kotlin/testData/ManyAlternatives.kt"); + } + + @TestMetadata("MethodReference.kt") + public void testMethodReference() throws Exception { + runTest("plugins/uast-kotlin/testData/MethodReference.kt"); + } + + @TestMetadata("NameContainingFile.kt") + public void testNameContainingFile() throws Exception { + runTest("plugins/uast-kotlin/testData/NameContainingFile.kt"); + } + + @TestMetadata("NonTrivialIdentifiers.kt") + public void testNonTrivialIdentifiers() throws Exception { + runTest("plugins/uast-kotlin/testData/NonTrivialIdentifiers.kt"); + } + + @TestMetadata("ParameterPropertyWithAnnotation.kt") + public void testParameterPropertyWithAnnotation() throws Exception { + runTest("plugins/uast-kotlin/testData/ParameterPropertyWithAnnotation.kt"); + } + + @TestMetadata("ParametersDisorder.kt") + public void testParametersDisorder() throws Exception { + runTest("plugins/uast-kotlin/testData/ParametersDisorder.kt"); + } + + @TestMetadata("ParametersWithDefaultValues.kt") + public void testParametersWithDefaultValues() throws Exception { + runTest("plugins/uast-kotlin/testData/ParametersWithDefaultValues.kt"); + } + + @TestMetadata("PropertyAccessors.kt") + public void testPropertyAccessors() throws Exception { + runTest("plugins/uast-kotlin/testData/PropertyAccessors.kt"); + } + + @TestMetadata("PropertyDelegate.kt") + public void testPropertyDelegate() throws Exception { + runTest("plugins/uast-kotlin/testData/PropertyDelegate.kt"); + } + + @TestMetadata("PropertyInitializer.kt") + public void testPropertyInitializer() throws Exception { + runTest("plugins/uast-kotlin/testData/PropertyInitializer.kt"); + } + + @TestMetadata("PropertyInitializerWithoutSetter.kt") + public void testPropertyInitializerWithoutSetter() throws Exception { + runTest("plugins/uast-kotlin/testData/PropertyInitializerWithoutSetter.kt"); + } + + @TestMetadata("PropertyReferences.kt") + public void testPropertyReferences() throws Exception { + runTest("plugins/uast-kotlin/testData/PropertyReferences.kt"); + } + + @TestMetadata("PropertyWithAnnotation.kt") + public void testPropertyWithAnnotation() throws Exception { + runTest("plugins/uast-kotlin/testData/PropertyWithAnnotation.kt"); + } + + @TestMetadata("QualifiedConstructorCall.kt") + public void testQualifiedConstructorCall() throws Exception { + runTest("plugins/uast-kotlin/testData/QualifiedConstructorCall.kt"); + } + + @TestMetadata("ReceiverFun.kt") + public void testReceiverFun() throws Exception { + runTest("plugins/uast-kotlin/testData/ReceiverFun.kt"); + } + + @TestMetadata("Reified.kt") + public void testReified() throws Exception { + runTest("plugins/uast-kotlin/testData/Reified.kt"); + } + + @TestMetadata("ReifiedParameters.kt") + public void testReifiedParameters() throws Exception { + runTest("plugins/uast-kotlin/testData/ReifiedParameters.kt"); + } + + @TestMetadata("ReifiedResolve.kt") + public void testReifiedResolve() throws Exception { + runTest("plugins/uast-kotlin/testData/ReifiedResolve.kt"); + } + + @TestMetadata("ReifiedReturnType.kt") + public void testReifiedReturnType() throws Exception { + runTest("plugins/uast-kotlin/testData/ReifiedReturnType.kt"); + } + + @TestMetadata("Resolve.kt") + public void testResolve() throws Exception { + runTest("plugins/uast-kotlin/testData/Resolve.kt"); + } + + @TestMetadata("SAM.kt") + public void testSAM() throws Exception { + runTest("plugins/uast-kotlin/testData/SAM.kt"); + } + + @TestMetadata("Simple.kt") + public void testSimple() throws Exception { + runTest("plugins/uast-kotlin/testData/Simple.kt"); + } + + @TestMetadata("SimpleAnnotated.kt") + public void testSimpleAnnotated() throws Exception { + runTest("plugins/uast-kotlin/testData/SimpleAnnotated.kt"); + } + + @TestMetadata("StringTemplate.kt") + public void testStringTemplate() throws Exception { + runTest("plugins/uast-kotlin/testData/StringTemplate.kt"); + } + + @TestMetadata("StringTemplateComplex.kt") + public void testStringTemplateComplex() throws Exception { + runTest("plugins/uast-kotlin/testData/StringTemplateComplex.kt"); + } + + @TestMetadata("StringTemplateComplexForUInjectionHost.kt") + public void testStringTemplateComplexForUInjectionHost() throws Exception { + runTest("plugins/uast-kotlin/testData/StringTemplateComplexForUInjectionHost.kt"); + } + + @TestMetadata("StringTemplateInClass.kt") + public void testStringTemplateInClass() throws Exception { + runTest("plugins/uast-kotlin/testData/StringTemplateInClass.kt"); + } + + @TestMetadata("StringTemplateWithVar.kt") + public void testStringTemplateWithVar() throws Exception { + runTest("plugins/uast-kotlin/testData/StringTemplateWithVar.kt"); + } + + @TestMetadata("SuperCalls.kt") + public void testSuperCalls() throws Exception { + runTest("plugins/uast-kotlin/testData/SuperCalls.kt"); + } + + @TestMetadata("Suspend.kt") + public void testSuspend() throws Exception { + runTest("plugins/uast-kotlin/testData/Suspend.kt"); + } + + @TestMetadata("TryCatch.kt") + public void testTryCatch() throws Exception { + runTest("plugins/uast-kotlin/testData/TryCatch.kt"); + } + + @TestMetadata("TypeAliasExpansionWithOtherAliasInArgument.kt") + public void testTypeAliasExpansionWithOtherAliasInArgument() throws Exception { + runTest("plugins/uast-kotlin/testData/TypeAliasExpansionWithOtherAliasInArgument.kt"); + } + + @TestMetadata("TypeAliases.kt") + public void testTypeAliases() throws Exception { + runTest("plugins/uast-kotlin/testData/TypeAliases.kt"); + } + + @TestMetadata("TypeInAnnotation.kt") + public void testTypeInAnnotation() throws Exception { + runTest("plugins/uast-kotlin/testData/TypeInAnnotation.kt"); + } + + @TestMetadata("TypeReferences.kt") + public void testTypeReferences() throws Exception { + runTest("plugins/uast-kotlin/testData/TypeReferences.kt"); + } + + @TestMetadata("UnexpectedContainerException.kt") + public void testUnexpectedContainerException() throws Exception { + runTest("plugins/uast-kotlin/testData/UnexpectedContainerException.kt"); + } + + @TestMetadata("WhenAndDestructing.kt") + public void testWhenAndDestructing() throws Exception { + runTest("plugins/uast-kotlin/testData/WhenAndDestructing.kt"); + } + + @TestMetadata("WhenIs.kt") + public void testWhenIs() throws Exception { + runTest("plugins/uast-kotlin/testData/WhenIs.kt"); + } + + @TestMetadata("WhenStringLiteral.kt") + public void testWhenStringLiteral() throws Exception { + runTest("plugins/uast-kotlin/testData/WhenStringLiteral.kt"); + } +} diff --git a/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/FirLegacyUastValuesTestGenerated.java b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/FirLegacyUastValuesTestGenerated.java new file mode 100644 index 00000000000..1c1ae4ca7c8 --- /dev/null +++ b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/FirLegacyUastValuesTestGenerated.java @@ -0,0 +1,381 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.uast.test.kotlin; + +import com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; +import org.jetbrains.kotlin.test.KotlinTestUtils; +import org.jetbrains.kotlin.test.util.KtTestUtil; +import org.jetbrains.kotlin.test.TestMetadata; +import org.junit.runner.RunWith; + +import java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("plugins/uast-kotlin/testData") +@TestDataPath("$PROJECT_ROOT") +@RunWith(JUnit3RunnerWithInners.class) +public class FirLegacyUastValuesTestGenerated extends AbstractFirLegacyUastValuesTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInTestData() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/uast-kotlin/testData"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @TestMetadata("AnnotatedExpressions.kt") + public void testAnnotatedExpressions() throws Exception { + runTest("plugins/uast-kotlin/testData/AnnotatedExpressions.kt"); + } + + @TestMetadata("AnnotationComplex.kt") + public void testAnnotationComplex() throws Exception { + runTest("plugins/uast-kotlin/testData/AnnotationComplex.kt"); + } + + @TestMetadata("AnnotationParameters.kt") + public void testAnnotationParameters() throws Exception { + runTest("plugins/uast-kotlin/testData/AnnotationParameters.kt"); + } + + @TestMetadata("Anonymous.kt") + public void testAnonymous() throws Exception { + runTest("plugins/uast-kotlin/testData/Anonymous.kt"); + } + + @TestMetadata("Assertion.kt") + public void testAssertion() throws Exception { + runTest("plugins/uast-kotlin/testData/Assertion.kt"); + } + + @TestMetadata("Bitwise.kt") + public void testBitwise() throws Exception { + runTest("plugins/uast-kotlin/testData/Bitwise.kt"); + } + + @TestMetadata("BrokenMethod.kt") + public void testBrokenMethod() throws Exception { + runTest("plugins/uast-kotlin/testData/BrokenMethod.kt"); + } + + @TestMetadata("ClassAnnotation.kt") + public void testClassAnnotation() throws Exception { + runTest("plugins/uast-kotlin/testData/ClassAnnotation.kt"); + } + + @TestMetadata("ConstructorDelegate.kt") + public void testConstructorDelegate() throws Exception { + runTest("plugins/uast-kotlin/testData/ConstructorDelegate.kt"); + } + + @TestMetadata("Constructors.kt") + public void testConstructors() throws Exception { + runTest("plugins/uast-kotlin/testData/Constructors.kt"); + } + + @TestMetadata("CycleInTypeParameters.kt") + public void testCycleInTypeParameters() throws Exception { + runTest("plugins/uast-kotlin/testData/CycleInTypeParameters.kt"); + } + + @TestMetadata("DefaultImpls.kt") + public void testDefaultImpls() throws Exception { + runTest("plugins/uast-kotlin/testData/DefaultImpls.kt"); + } + + @TestMetadata("DefaultParameterValues.kt") + public void testDefaultParameterValues() throws Exception { + runTest("plugins/uast-kotlin/testData/DefaultParameterValues.kt"); + } + + @TestMetadata("Delegate.kt") + public void testDelegate() throws Exception { + runTest("plugins/uast-kotlin/testData/Delegate.kt"); + } + + @TestMetadata("DeprecatedHidden.kt") + public void testDeprecatedHidden() throws Exception { + runTest("plugins/uast-kotlin/testData/DeprecatedHidden.kt"); + } + + @TestMetadata("DestructuringDeclaration.kt") + public void testDestructuringDeclaration() throws Exception { + runTest("plugins/uast-kotlin/testData/DestructuringDeclaration.kt"); + } + + @TestMetadata("ea101715.kt") + public void testEa101715() throws Exception { + runTest("plugins/uast-kotlin/testData/ea101715.kt"); + } + + @TestMetadata("Elvis.kt") + public void testElvis() throws Exception { + runTest("plugins/uast-kotlin/testData/Elvis.kt"); + } + + @TestMetadata("ElvisType.kt") + public void testElvisType() throws Exception { + runTest("plugins/uast-kotlin/testData/ElvisType.kt"); + } + + @TestMetadata("EnumValueMembers.kt") + public void testEnumValueMembers() throws Exception { + runTest("plugins/uast-kotlin/testData/EnumValueMembers.kt"); + } + + @TestMetadata("EnumValuesConstructors.kt") + public void testEnumValuesConstructors() throws Exception { + runTest("plugins/uast-kotlin/testData/EnumValuesConstructors.kt"); + } + + @TestMetadata("IfStatement.kt") + public void testIfStatement() throws Exception { + runTest("plugins/uast-kotlin/testData/IfStatement.kt"); + } + + @TestMetadata("Imports.kt") + public void testImports() throws Exception { + runTest("plugins/uast-kotlin/testData/Imports.kt"); + } + + @TestMetadata("In.kt") + public void testIn() throws Exception { + runTest("plugins/uast-kotlin/testData/In.kt"); + } + + @TestMetadata("InferenceInsideUnresolvedConstructor.kt") + public void testInferenceInsideUnresolvedConstructor() throws Exception { + runTest("plugins/uast-kotlin/testData/InferenceInsideUnresolvedConstructor.kt"); + } + + @TestMetadata("InnerClasses.kt") + public void testInnerClasses() throws Exception { + runTest("plugins/uast-kotlin/testData/InnerClasses.kt"); + } + + @TestMetadata("InnerNonFixedTypeVariable.kt") + public void testInnerNonFixedTypeVariable() throws Exception { + runTest("plugins/uast-kotlin/testData/InnerNonFixedTypeVariable.kt"); + } + + @TestMetadata("LambdaReturn.kt") + public void testLambdaReturn() throws Exception { + runTest("plugins/uast-kotlin/testData/LambdaReturn.kt"); + } + + @TestMetadata("Lambdas.kt") + public void testLambdas() throws Exception { + runTest("plugins/uast-kotlin/testData/Lambdas.kt"); + } + + @TestMetadata("LocalDeclarations.kt") + public void testLocalDeclarations() throws Exception { + runTest("plugins/uast-kotlin/testData/LocalDeclarations.kt"); + } + + @TestMetadata("LocalVariableWithAnnotation.kt") + public void testLocalVariableWithAnnotation() throws Exception { + runTest("plugins/uast-kotlin/testData/LocalVariableWithAnnotation.kt"); + } + + @TestMetadata("ManyAlternatives.kt") + public void testManyAlternatives() throws Exception { + runTest("plugins/uast-kotlin/testData/ManyAlternatives.kt"); + } + + @TestMetadata("MethodReference.kt") + public void testMethodReference() throws Exception { + runTest("plugins/uast-kotlin/testData/MethodReference.kt"); + } + + @TestMetadata("NameContainingFile.kt") + public void testNameContainingFile() throws Exception { + runTest("plugins/uast-kotlin/testData/NameContainingFile.kt"); + } + + @TestMetadata("NonTrivialIdentifiers.kt") + public void testNonTrivialIdentifiers() throws Exception { + runTest("plugins/uast-kotlin/testData/NonTrivialIdentifiers.kt"); + } + + @TestMetadata("ParameterPropertyWithAnnotation.kt") + public void testParameterPropertyWithAnnotation() throws Exception { + runTest("plugins/uast-kotlin/testData/ParameterPropertyWithAnnotation.kt"); + } + + @TestMetadata("ParametersDisorder.kt") + public void testParametersDisorder() throws Exception { + runTest("plugins/uast-kotlin/testData/ParametersDisorder.kt"); + } + + @TestMetadata("ParametersWithDefaultValues.kt") + public void testParametersWithDefaultValues() throws Exception { + runTest("plugins/uast-kotlin/testData/ParametersWithDefaultValues.kt"); + } + + @TestMetadata("PropertyAccessors.kt") + public void testPropertyAccessors() throws Exception { + runTest("plugins/uast-kotlin/testData/PropertyAccessors.kt"); + } + + @TestMetadata("PropertyDelegate.kt") + public void testPropertyDelegate() throws Exception { + runTest("plugins/uast-kotlin/testData/PropertyDelegate.kt"); + } + + @TestMetadata("PropertyInitializer.kt") + public void testPropertyInitializer() throws Exception { + runTest("plugins/uast-kotlin/testData/PropertyInitializer.kt"); + } + + @TestMetadata("PropertyInitializerWithoutSetter.kt") + public void testPropertyInitializerWithoutSetter() throws Exception { + runTest("plugins/uast-kotlin/testData/PropertyInitializerWithoutSetter.kt"); + } + + @TestMetadata("PropertyReferences.kt") + public void testPropertyReferences() throws Exception { + runTest("plugins/uast-kotlin/testData/PropertyReferences.kt"); + } + + @TestMetadata("PropertyWithAnnotation.kt") + public void testPropertyWithAnnotation() throws Exception { + runTest("plugins/uast-kotlin/testData/PropertyWithAnnotation.kt"); + } + + @TestMetadata("QualifiedConstructorCall.kt") + public void testQualifiedConstructorCall() throws Exception { + runTest("plugins/uast-kotlin/testData/QualifiedConstructorCall.kt"); + } + + @TestMetadata("ReceiverFun.kt") + public void testReceiverFun() throws Exception { + runTest("plugins/uast-kotlin/testData/ReceiverFun.kt"); + } + + @TestMetadata("Reified.kt") + public void testReified() throws Exception { + runTest("plugins/uast-kotlin/testData/Reified.kt"); + } + + @TestMetadata("ReifiedParameters.kt") + public void testReifiedParameters() throws Exception { + runTest("plugins/uast-kotlin/testData/ReifiedParameters.kt"); + } + + @TestMetadata("ReifiedResolve.kt") + public void testReifiedResolve() throws Exception { + runTest("plugins/uast-kotlin/testData/ReifiedResolve.kt"); + } + + @TestMetadata("ReifiedReturnType.kt") + public void testReifiedReturnType() throws Exception { + runTest("plugins/uast-kotlin/testData/ReifiedReturnType.kt"); + } + + @TestMetadata("Resolve.kt") + public void testResolve() throws Exception { + runTest("plugins/uast-kotlin/testData/Resolve.kt"); + } + + @TestMetadata("SAM.kt") + public void testSAM() throws Exception { + runTest("plugins/uast-kotlin/testData/SAM.kt"); + } + + @TestMetadata("Simple.kt") + public void testSimple() throws Exception { + runTest("plugins/uast-kotlin/testData/Simple.kt"); + } + + @TestMetadata("SimpleAnnotated.kt") + public void testSimpleAnnotated() throws Exception { + runTest("plugins/uast-kotlin/testData/SimpleAnnotated.kt"); + } + + @TestMetadata("StringTemplate.kt") + public void testStringTemplate() throws Exception { + runTest("plugins/uast-kotlin/testData/StringTemplate.kt"); + } + + @TestMetadata("StringTemplateComplex.kt") + public void testStringTemplateComplex() throws Exception { + runTest("plugins/uast-kotlin/testData/StringTemplateComplex.kt"); + } + + @TestMetadata("StringTemplateComplexForUInjectionHost.kt") + public void testStringTemplateComplexForUInjectionHost() throws Exception { + runTest("plugins/uast-kotlin/testData/StringTemplateComplexForUInjectionHost.kt"); + } + + @TestMetadata("StringTemplateInClass.kt") + public void testStringTemplateInClass() throws Exception { + runTest("plugins/uast-kotlin/testData/StringTemplateInClass.kt"); + } + + @TestMetadata("StringTemplateWithVar.kt") + public void testStringTemplateWithVar() throws Exception { + runTest("plugins/uast-kotlin/testData/StringTemplateWithVar.kt"); + } + + @TestMetadata("SuperCalls.kt") + public void testSuperCalls() throws Exception { + runTest("plugins/uast-kotlin/testData/SuperCalls.kt"); + } + + @TestMetadata("Suspend.kt") + public void testSuspend() throws Exception { + runTest("plugins/uast-kotlin/testData/Suspend.kt"); + } + + @TestMetadata("TryCatch.kt") + public void testTryCatch() throws Exception { + runTest("plugins/uast-kotlin/testData/TryCatch.kt"); + } + + @TestMetadata("TypeAliasExpansionWithOtherAliasInArgument.kt") + public void testTypeAliasExpansionWithOtherAliasInArgument() throws Exception { + runTest("plugins/uast-kotlin/testData/TypeAliasExpansionWithOtherAliasInArgument.kt"); + } + + @TestMetadata("TypeAliases.kt") + public void testTypeAliases() throws Exception { + runTest("plugins/uast-kotlin/testData/TypeAliases.kt"); + } + + @TestMetadata("TypeInAnnotation.kt") + public void testTypeInAnnotation() throws Exception { + runTest("plugins/uast-kotlin/testData/TypeInAnnotation.kt"); + } + + @TestMetadata("TypeReferences.kt") + public void testTypeReferences() throws Exception { + runTest("plugins/uast-kotlin/testData/TypeReferences.kt"); + } + + @TestMetadata("UnexpectedContainerException.kt") + public void testUnexpectedContainerException() throws Exception { + runTest("plugins/uast-kotlin/testData/UnexpectedContainerException.kt"); + } + + @TestMetadata("WhenAndDestructing.kt") + public void testWhenAndDestructing() throws Exception { + runTest("plugins/uast-kotlin/testData/WhenAndDestructing.kt"); + } + + @TestMetadata("WhenIs.kt") + public void testWhenIs() throws Exception { + runTest("plugins/uast-kotlin/testData/WhenIs.kt"); + } + + @TestMetadata("WhenStringLiteral.kt") + public void testWhenStringLiteral() throws Exception { + runTest("plugins/uast-kotlin/testData/WhenStringLiteral.kt"); + } +}