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 a49b5539718..ed8b791ccec 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 @@ -1669,6 +1669,10 @@ fun main(args: Array) { testClass { model("") } + + testClass { + model("") + } } testGroup("plugins/uast-kotlin-fir/tests", "plugins/uast-kotlin-fir/testData") { @@ -1685,6 +1689,10 @@ fun main(args: Array) { testClass { model("") } + + testClass { + model("") + } } testGroup("idea/performanceTests/test", "idea/testData") { diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/AnnotatedExpressions.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/AnnotatedExpressions.types.fe10.txt new file mode 100644 index 00000000000..acf59ee03ee --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/AnnotatedExpressions.types.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 [{...}] : PsiType:void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [foo()] : PsiType:void + UAnnotation (fqName = kotlin.Suppress) [@kotlin.Suppress] + UIdentifier (Identifier (foo)) [UIdentifier (Identifier (foo))] + USimpleNameReferenceExpression (identifier = foo, resolvesTo = null) [foo] : PsiType:void + UDeclarationsExpression [@kotlin.Suppress var a: int = 1] + ULocalVariable (name = a) [@kotlin.Suppress var a: int = 1] + UAnnotation (fqName = kotlin.Suppress) [@kotlin.Suppress] + ULiteralExpression (value = 1) [1] : PsiType:int + UDeclarationsExpression [@kotlin.Suppress var b: int = 2] + ULocalVariable (name = b) [@kotlin.Suppress var b: int = 2] + UAnnotation (fqName = kotlin.Suppress) [@kotlin.Suppress] + ULiteralExpression (value = 2) [2] : PsiType:int + UBinaryExpression (operator = =) [b = a] : PsiType:void + UAnnotation (fqName = kotlin.Suppress) [@kotlin.Suppress] + USimpleNameReferenceExpression (identifier = b) [b] : PsiType:int + USimpleNameReferenceExpression (identifier = a) [a] : PsiType:int + UIfExpression [if (a > 2) a else b] : PsiType:int + UAnnotation (fqName = kotlin.Suppress) [@kotlin.Suppress] + UBinaryExpression (operator = >) [a > 2] : PsiType:boolean + USimpleNameReferenceExpression (identifier = a) [a] : PsiType:int + ULiteralExpression (value = 2) [2] : PsiType:int + USimpleNameReferenceExpression (identifier = a) [a] : PsiType:int + USimpleNameReferenceExpression (identifier = b) [b] : PsiType:int + UDeclarationsExpression [var c: int = elvis {...}] + ULocalVariable (name = c) [var c: int = elvis {...}] + UExpressionList (elvis) [elvis {...}] : PsiType:int + UDeclarationsExpression [var varae507364: int = a] + ULocalVariable (name = varae507364) [var varae507364: int = a] + USimpleNameReferenceExpression (identifier = a) [a] : PsiType:int + UAnnotation (fqName = kotlin.Suppress) [@kotlin.Suppress] + UIfExpression [if (varae507364 != null) varae507364 else b] + UBinaryExpression (operator = !=) [varae507364 != null] + USimpleNameReferenceExpression (identifier = varae507364) [varae507364] + ULiteralExpression (value = null) [null] + USimpleNameReferenceExpression (identifier = varae507364) [varae507364] + USimpleNameReferenceExpression (identifier = b) [b] : PsiType:int + 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 [{...}] + UReturnExpression [return switch {...] + USwitchExpression [switch {...] : PsiType:int + UExpressionList (when) [ str.isBlank() -> {... ] : PsiType:int + USwitchClauseExpressionWithBody [str.isBlank() -> {...] + UQualifiedReferenceExpression [str.isBlank()] : PsiType:boolean + UAnnotation (fqName = kotlin.Suppress) [@kotlin.Suppress(names = "DEPRECATION")] + UNamedExpression (name = names) [names = "DEPRECATION"] + ULiteralExpression (value = "DEPRECATION") ["DEPRECATION"] : PsiType:String + USimpleNameReferenceExpression (identifier = str) [str] : PsiType:String + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [isBlank()] : PsiType:boolean + UIdentifier (Identifier (isBlank)) [UIdentifier (Identifier (isBlank))] + USimpleNameReferenceExpression (identifier = isBlank, resolvesTo = null) [isBlank] : PsiType:boolean + UExpressionList (when_entry) [{...] + UYieldExpression [yield null] + ULiteralExpression (value = null) [null] : PsiType:Void + USwitchClauseExpressionWithBody [str.isNotEmpty() != null -> {...] + UBinaryExpression (operator = !=) [str.isNotEmpty() != null] : PsiType:boolean + UQualifiedReferenceExpression [str.isNotEmpty()] : PsiType:boolean + USimpleNameReferenceExpression (identifier = str) [str] : PsiType:String + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [isNotEmpty()] : PsiType:boolean + UIdentifier (Identifier (isNotEmpty)) [UIdentifier (Identifier (isNotEmpty))] + USimpleNameReferenceExpression (identifier = isNotEmpty, resolvesTo = null) [isNotEmpty] : PsiType:boolean + ULiteralExpression (value = null) [null] : PsiType:Void + UExpressionList (when_entry) [{...] + UYieldExpression [yield null] + ULiteralExpression (value = null) [null] : PsiType:Void + USwitchClauseExpressionWithBody [ -> {...] + UExpressionList (when_entry) [{...] + UYieldExpression [yield 1] + ULiteralExpression (value = 1) [1] : PsiType:int diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/AnnotatedExpressions.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/AnnotatedExpressions.types.fir.txt new file mode 100644 index 00000000000..bf1751f4e47 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/AnnotatedExpressions.types.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)] + 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)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/AnnotationComplex.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/AnnotationComplex.types.fe10.txt new file mode 100644 index 00000000000..040803b2924 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/AnnotationComplex.types.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 = ()] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] : PsiType:Annotation + UIdentifier (Identifier (Annotation)) [UIdentifier (Identifier (Annotation))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Annotation) [] : PsiType:Annotation + 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")] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 2)) [("sv1", "sv2")] : PsiType:Annotation + UIdentifier (Identifier (Annotation)) [UIdentifier (Identifier (Annotation))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Annotation) [] : PsiType:Annotation + ULiteralExpression (value = "sv1") ["sv1"] : PsiType:String + ULiteralExpression (value = "sv2") ["sv2"] : PsiType:String + 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"))] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [(arrayOf("sar1", "sar2"))] : PsiType:Annotation + UIdentifier (Identifier (Annotation)) [UIdentifier (Identifier (Annotation))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Annotation) [] : PsiType:Annotation + UCallExpression (kind = UastCallKind(name='array_initializer'), argCount = 2)) [arrayOf("sar1", "sar2")] : PsiType:String[] + UIdentifier (Identifier (arrayOf)) [UIdentifier (Identifier (arrayOf))] + USimpleNameReferenceExpression (identifier = arrayOf, resolvesTo = null) [arrayOf] : PsiType:String[] + ULiteralExpression (value = "sar1") ["sar1"] : PsiType:String + ULiteralExpression (value = "sar2") ["sar2"] : PsiType:String + 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"])] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [(collectionLiteral["[sar]1", "[sar]2"])] : PsiType:Annotation + UIdentifier (Identifier (Annotation)) [UIdentifier (Identifier (Annotation))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Annotation) [] : PsiType:Annotation + UCallExpression (kind = UastCallKind(name='array_initializer'), argCount = 2)) [collectionLiteral["[sar]1", "[sar]2"]] : PsiType:String[] + UIdentifier (Identifier ([)) [UIdentifier (Identifier ([))] + ULiteralExpression (value = "[sar]1") ["[sar]1"] : PsiType:String + ULiteralExpression (value = "[sar]2") ["[sar]2"] : PsiType:String + UMethod (name = C2) [public fun C2() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/AnnotationComplex.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/AnnotationComplex.types.fir.txt new file mode 100644 index 00000000000..5a6b97bc5a3 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/AnnotationComplex.types.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/legacyTypes/AnnotationParameters.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/AnnotationParameters.types.fe10.txt new file mode 100644 index 00000000000..165b27026d8 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/AnnotationParameters.types.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)] + UCallExpression (kind = UastCallKind(name='array_initializer'), argCount = 3)) [intArrayOf(1, 2, 3)] : PsiType:int[] + UIdentifier (Identifier (intArrayOf)) [UIdentifier (Identifier (intArrayOf))] + USimpleNameReferenceExpression (identifier = intArrayOf, resolvesTo = null) [intArrayOf] : PsiType:int[] + ULiteralExpression (value = 1) [1] : PsiType:int + ULiteralExpression (value = 2) [2] : PsiType:int + ULiteralExpression (value = 3) [3] : PsiType:int + UAnnotation (fqName = IntRange) [@IntRange(from = 10, to = 0)] + UNamedExpression (name = from) [from = 10] + ULiteralExpression (value = 10) [10] : PsiType:long + UNamedExpression (name = to) [to = 0] + ULiteralExpression (value = 0) [0] : PsiType:long + UAnnotation (fqName = WithDefaultValue) [@WithDefaultValue] + UAnnotation (fqName = SuppressLint) [@SuppressLint(value = "Lorem")] + UNamedExpression (name = value) [value = "Lorem"] + ULiteralExpression (value = "Lorem") ["Lorem"] : PsiType:String + UBlockExpression [{...}] + UReturnExpression [return 5] + ULiteralExpression (value = 5) [5] : PsiType:int + UMethod (name = bar) [@IntRange(from = 0, to = 100)...}] + UAnnotation (fqName = IntRange) [@IntRange(from = 0, to = 100)] + UNamedExpression (name = from) [from = 0] + ULiteralExpression (value = 0) [0] : PsiType:long + UNamedExpression (name = to) [to = 100] + ULiteralExpression (value = 100) [100] : PsiType:long + UAnnotation (fqName = SuppressLint) [@SuppressLint(value = ("Lorem", "Ipsum", "Dolor"))] + UNamedExpression (name = value) [value = ("Lorem", "Ipsum", "Dolor")] + UCallExpression (kind = UastCallKind(name='array_initializer'), argCount = 3)) [("Lorem", "Ipsum", "Dolor")] + ULiteralExpression (value = "Lorem") ["Lorem"] : PsiType:String + ULiteralExpression (value = "Ipsum") ["Ipsum"] : PsiType:String + ULiteralExpression (value = "Dolor") ["Dolor"] : PsiType:String + UBlockExpression [{...}] + UReturnExpression [return Unit] + USimpleNameReferenceExpression (identifier = Unit) [Unit] : PsiType:void + 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]] + UCallExpression (kind = UastCallKind(name='array_initializer'), argCount = 3)) [collectionLiteral[1, 2, 3]] : PsiType:int[] + UIdentifier (Identifier ([)) [UIdentifier (Identifier ([))] + ULiteralExpression (value = 1) [1] : PsiType:int + ULiteralExpression (value = 2) [2] : PsiType:int + ULiteralExpression (value = 3) [3] : PsiType:int + UBlockExpression [{...}] + UReturnExpression [return 5] + ULiteralExpression (value = 5) [5] : PsiType:int + 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"]] + UCallExpression (kind = UastCallKind(name='array_initializer'), argCount = 3)) [collectionLiteral["a", "b", "c"]] : PsiType:String[] + UIdentifier (Identifier ([)) [UIdentifier (Identifier ([))] + ULiteralExpression (value = "a") ["a"] : PsiType:String + ULiteralExpression (value = "b") ["b"] : PsiType:String + ULiteralExpression (value = "c") ["c"] : PsiType:String + UBlockExpression [{...}] + UReturnExpression [return 3] + ULiteralExpression (value = 3) [3] : PsiType:int + 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] : PsiType:int + 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/legacyTypes/AnnotationParameters.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/AnnotationParameters.types.fir.txt new file mode 100644 index 00000000000..3e181c5861e --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/AnnotationParameters.types.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)] + UMethod (name = bar) [public static final fun bar() : void = [!] UnknownKotlinExpression (REFERENCE_EXPRESSION)] + [!] UnknownKotlinExpression (REFERENCE_EXPRESSION) [[!] UnknownKotlinExpression (REFERENCE_EXPRESSION)] + UMethod (name = fooWithArrLiteral) [public static final fun fooWithArrLiteral() : int = [!] UnknownKotlinExpression (INTEGER_CONSTANT)] + [!] UnknownKotlinExpression (INTEGER_CONSTANT) [[!] UnknownKotlinExpression (INTEGER_CONSTANT)] + UMethod (name = fooWithStrArrLiteral) [public static final fun fooWithStrArrLiteral() : int = [!] UnknownKotlinExpression (INTEGER_CONSTANT)] + [!] UnknownKotlinExpression (INTEGER_CONSTANT) [[!] UnknownKotlinExpression (INTEGER_CONSTANT)] + 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/legacyTypes/Anonymous.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/Anonymous.types.fe10.txt new file mode 100644 index 00000000000..42acf5ee816 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/Anonymous.types.fe10.txt @@ -0,0 +1,59 @@ +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 [{...}] : PsiType:void + UDeclarationsExpression [var runnable: = anonymous object : Runnable { override fun run() {} }] + ULocalVariable (name = runnable) [var runnable: = anonymous object : Runnable { override fun run() {} }] + UObjectLiteralExpression [anonymous object : Runnable { override fun run() {} }] : PsiType:Runnable + UClass (name = null) [final class null : java.lang.Runnable {...}] + UMethod (name = run) [public fun run() : void {...}] + UBlockExpression [{...}] : PsiType:void + UMethod (name = ) [private fun () = UastEmptyExpression] + UQualifiedReferenceExpression [runnable.run()] : PsiType:void + USimpleNameReferenceExpression (identifier = runnable) [runnable] : PsiType: + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [run()] : PsiType:void + UIdentifier (Identifier (run)) [UIdentifier (Identifier (run))] + USimpleNameReferenceExpression (identifier = run, resolvesTo = null) [run] : PsiType:void + UDeclarationsExpression [var runnable2: java.lang.Runnable = Runnable({ ...})] + ULocalVariable (name = runnable2) [var runnable2: java.lang.Runnable = Runnable({ ...})] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [Runnable({ ...})] : PsiType:Runnable + UIdentifier (Identifier (Runnable)) [UIdentifier (Identifier (Runnable))] + USimpleNameReferenceExpression (identifier = Runnable, resolvesTo = PsiClass: Runnable) [Runnable] : PsiType:Runnable + ULambdaExpression [{ ...}] : PsiType:Function0 + UBlockExpression [{...}] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [println()] : PsiType:void + UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] + USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] : PsiType:void + UQualifiedReferenceExpression [runnable2.run()] : PsiType:void + USimpleNameReferenceExpression (identifier = runnable2) [runnable2] : PsiType:Runnable + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [run()] : PsiType:void + UIdentifier (Identifier (run)) [UIdentifier (Identifier (run))] + USimpleNameReferenceExpression (identifier = run, resolvesTo = null) [run] : PsiType:void + UDeclarationsExpression [var closeableRunnable: = anonymous object : Runnable, Closeable { override fun close() {} override fun run() {} }] + 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() {} }] : PsiType:Runnable + UClass (name = null) [final class null : java.lang.Runnable, java.io.Closeable {...}] + UMethod (name = close) [public fun close() : void {...}] + UBlockExpression [{...}] : PsiType:void + UMethod (name = run) [public fun run() : void {...}] + UBlockExpression [{...}] : PsiType:void + UMethod (name = ) [private fun () = UastEmptyExpression] + UDeclarationsExpression [var runnableIs: = anonymous object : InputStream(), Runnable { override fun read(): Int = 0; override fun run() {} }] + 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() {} }] : PsiType:InputStream + UClass (name = null) [final class null : java.io.InputStream, java.lang.Runnable {...}] + UMethod (name = read) [public fun read() : int {...}] + UBlockExpression [{...}] + UReturnExpression [return 0] + ULiteralExpression (value = 0) [0] : PsiType:int + UMethod (name = run) [public fun run() : void {...}] + UBlockExpression [{...}] : PsiType:void + UMethod (name = ) [private fun () = UastEmptyExpression] + UMethod (name = withErr) [public static final fun withErr() : void {...}] + UBlockExpression [{...}] : PsiType:void + UDeclarationsExpression [var runnable: = anonymous null] + ULocalVariable (name = runnable) [var runnable: = anonymous null] + UObjectLiteralExpression [anonymous null] : PsiType: + UClass (name = ) [class {...}] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/Anonymous.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/Anonymous.types.fir.txt new file mode 100644 index 00000000000..41c9fe57c45 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/Anonymous.types.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)] + UMethod (name = withErr) [public static final fun withErr() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/Assertion.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/Assertion.types.fe10.txt new file mode 100644 index 00000000000..21c6b060ddd --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/Assertion.types.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 [{...}] : PsiType:Void + UDeclarationsExpression [var s: java.lang.String = "Not Null"] + ULocalVariable (name = s) [var s: java.lang.String = "Not Null"] + ULiteralExpression (value = "Not Null") ["Not Null"] : PsiType:String + UReturnExpression [return s!!] : PsiType:Void + UPostfixExpression (operator = !!) [s!!] : PsiType:String + USimpleNameReferenceExpression (identifier = s) [s] : PsiType:String diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/Assertion.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/Assertion.types.fir.txt new file mode 100644 index 00000000000..7d93ebf1efd --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/Assertion.types.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)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/Bitwise.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/Bitwise.types.fe10.txt new file mode 100644 index 00000000000..b6a34a0e70e --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/Bitwise.types.fe10.txt @@ -0,0 +1,98 @@ +UFile (package = ) [public final class BitwiseKt {...] + UClass (name = BitwiseKt) [public final class BitwiseKt {...}] + UMethod (name = foo) [public static final fun foo() : int {...}] + UBlockExpression [{...}] : PsiType:Void + UDeclarationsExpression [var mask: int = 127] + ULocalVariable (name = mask) [var mask: int = 127] + ULiteralExpression (value = 127) [127] : PsiType:int + UDeclarationsExpression [var x: int = 2863311530] + ULocalVariable (name = x) [var x: int = 2863311530] + ULiteralExpression (value = 2863311530) [2863311530] : PsiType:long + UDeclarationsExpression [var pos: int = x & mask] + ULocalVariable (name = pos) [var pos: int = x & mask] + UBinaryExpression (operator = &) [x & mask] : PsiType:int + USimpleNameReferenceExpression (identifier = x) [x] : PsiType:int + USimpleNameReferenceExpression (identifier = mask) [mask] : PsiType:int + UDeclarationsExpression [var max: int = x | mask] + ULocalVariable (name = max) [var max: int = x | mask] + UBinaryExpression (operator = |) [x | mask] : PsiType:int + USimpleNameReferenceExpression (identifier = x) [x] : PsiType:int + USimpleNameReferenceExpression (identifier = mask) [mask] : PsiType:int + UDeclarationsExpression [var zebra: int = x ^ mask] + ULocalVariable (name = zebra) [var zebra: int = x ^ mask] + UBinaryExpression (operator = ^) [x ^ mask] : PsiType:int + USimpleNameReferenceExpression (identifier = x) [x] : PsiType:int + USimpleNameReferenceExpression (identifier = mask) [mask] : PsiType:int + UDeclarationsExpression [var signed: int = x >> 2] + ULocalVariable (name = signed) [var signed: int = x >> 2] + UBinaryExpression (operator = >>) [x >> 2] : PsiType:int + USimpleNameReferenceExpression (identifier = x) [x] : PsiType:int + ULiteralExpression (value = 2) [2] : PsiType:int + UDeclarationsExpression [var one: int = x >>> 31] + ULocalVariable (name = one) [var one: int = x >>> 31] + UBinaryExpression (operator = >>>) [x >>> 31] : PsiType:int + USimpleNameReferenceExpression (identifier = x) [x] : PsiType:int + ULiteralExpression (value = 31) [31] : PsiType:int + UDeclarationsExpression [var zero: int = x << 32] + ULocalVariable (name = zero) [var zero: int = x << 32] + UBinaryExpression (operator = <<) [x << 32] : PsiType:int + USimpleNameReferenceExpression (identifier = x) [x] : PsiType:int + ULiteralExpression (value = 32) [32] : PsiType:int + UReturnExpression [return pos + zero - zebra * signed / one] : PsiType:Void + UBinaryExpression (operator = -) [pos + zero - zebra * signed / one] : PsiType:int + UBinaryExpression (operator = +) [pos + zero] : PsiType:int + USimpleNameReferenceExpression (identifier = pos) [pos] : PsiType:int + USimpleNameReferenceExpression (identifier = zero) [zero] : PsiType:int + UBinaryExpression (operator = /) [zebra * signed / one] : PsiType:int + UBinaryExpression (operator = *) [zebra * signed] : PsiType:int + USimpleNameReferenceExpression (identifier = zebra) [zebra] : PsiType:int + USimpleNameReferenceExpression (identifier = signed) [signed] : PsiType:int + USimpleNameReferenceExpression (identifier = one) [one] : PsiType:int + UMethod (name = bar) [public static final fun bar() : long {...}] + UBlockExpression [{...}] : PsiType:Void + UDeclarationsExpression [var mask: long = 127] + ULocalVariable (name = mask) [var mask: long = 127] + ULiteralExpression (value = 127) [127] : PsiType:long + UDeclarationsExpression [var x: long = 6148914691236517205] + ULocalVariable (name = x) [var x: long = 6148914691236517205] + ULiteralExpression (value = 6148914691236517205) [6148914691236517205] : PsiType:long + UDeclarationsExpression [var pos: long = x & mask] + ULocalVariable (name = pos) [var pos: long = x & mask] + UBinaryExpression (operator = &) [x & mask] : PsiType:long + USimpleNameReferenceExpression (identifier = x) [x] : PsiType:long + USimpleNameReferenceExpression (identifier = mask) [mask] : PsiType:long + UDeclarationsExpression [var max: long = x | mask] + ULocalVariable (name = max) [var max: long = x | mask] + UBinaryExpression (operator = |) [x | mask] : PsiType:long + USimpleNameReferenceExpression (identifier = x) [x] : PsiType:long + USimpleNameReferenceExpression (identifier = mask) [mask] : PsiType:long + UDeclarationsExpression [var zebra: long = x ^ mask] + ULocalVariable (name = zebra) [var zebra: long = x ^ mask] + UBinaryExpression (operator = ^) [x ^ mask] : PsiType:long + USimpleNameReferenceExpression (identifier = x) [x] : PsiType:long + USimpleNameReferenceExpression (identifier = mask) [mask] : PsiType:long + UDeclarationsExpression [var signed: long = x >> 2] + ULocalVariable (name = signed) [var signed: long = x >> 2] + UBinaryExpression (operator = >>) [x >> 2] : PsiType:long + USimpleNameReferenceExpression (identifier = x) [x] : PsiType:long + ULiteralExpression (value = 2) [2] : PsiType:int + UDeclarationsExpression [var one: long = x >>> 63] + ULocalVariable (name = one) [var one: long = x >>> 63] + UBinaryExpression (operator = >>>) [x >>> 63] : PsiType:long + USimpleNameReferenceExpression (identifier = x) [x] : PsiType:long + ULiteralExpression (value = 63) [63] : PsiType:int + UDeclarationsExpression [var zero: long = x << 64] + ULocalVariable (name = zero) [var zero: long = x << 64] + UBinaryExpression (operator = <<) [x << 64] : PsiType:long + USimpleNameReferenceExpression (identifier = x) [x] : PsiType:long + ULiteralExpression (value = 64) [64] : PsiType:int + UReturnExpression [return pos + zero - zebra * signed / one] : PsiType:Void + UBinaryExpression (operator = -) [pos + zero - zebra * signed / one] : PsiType:long + UBinaryExpression (operator = +) [pos + zero] : PsiType:long + USimpleNameReferenceExpression (identifier = pos) [pos] : PsiType:long + USimpleNameReferenceExpression (identifier = zero) [zero] : PsiType:long + UBinaryExpression (operator = /) [zebra * signed / one] : PsiType:long + UBinaryExpression (operator = *) [zebra * signed] : PsiType:long + USimpleNameReferenceExpression (identifier = zebra) [zebra] : PsiType:long + USimpleNameReferenceExpression (identifier = signed) [signed] : PsiType:long + USimpleNameReferenceExpression (identifier = one) [one] : PsiType:long diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/Bitwise.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/Bitwise.types.fir.txt new file mode 100644 index 00000000000..72c7d8d3397 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/Bitwise.types.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)] + UMethod (name = bar) [public static final fun bar() : long = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/BrokenMethod.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/BrokenMethod.types.fe10.txt new file mode 100644 index 00000000000..e5dc19cc8e0 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/BrokenMethod.types.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 [{...}] : PsiType:void + UDeclarationsExpression [public static final class TestUsed {...}] + 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 [{...}] + UReturnExpression [return (this)] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [(this)] : PsiType: + UIdentifier (Identifier (Used)) [UIdentifier (Identifier (Used))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Used) [] : PsiType: + UThisExpression (label = null) [this] : PsiType:Object + UMethod (name = Companion) [private fun Companion() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/BrokenMethod.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/BrokenMethod.types.fir.txt new file mode 100644 index 00000000000..472964e1924 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/BrokenMethod.types.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)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/ClassAnnotation.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/ClassAnnotation.types.fe10.txt new file mode 100644 index 00000000000..2dbfb650f86 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/ClassAnnotation.types.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"] + ULiteralExpression (value = "class") ["class"] : PsiType:String + 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"] + ULiteralExpression (value = "inB class") ["inB class"] : PsiType:String + 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"] + ULiteralExpression (value = "companion") ["companion"] : PsiType:String + 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"] + ULiteralExpression (value = "object") ["object"] : PsiType:String + 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/legacyTypes/ClassAnnotation.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/ClassAnnotation.types.fir.txt new file mode 100644 index 00000000000..5f116a7ec08 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/ClassAnnotation.types.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/legacyTypes/ConstructorDelegate.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/ConstructorDelegate.types.fe10.txt new file mode 100644 index 00000000000..e16ab6a17ff --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/ConstructorDelegate.types.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 [{...}] : PsiType:Void + UReturnExpression [return (i)] : PsiType:Void + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [(i)] : PsiType:BaseImpl + UIdentifier (Identifier (BaseImpl)) [UIdentifier (Identifier (BaseImpl))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: BaseImpl) [] : PsiType:BaseImpl + USimpleNameReferenceExpression (identifier = i) [i] : PsiType:int + 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 [{...}] : PsiType:void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [print(x)] : PsiType:void + UIdentifier (Identifier (print)) [UIdentifier (Identifier (print))] + USimpleNameReferenceExpression (identifier = print, resolvesTo = null) [print] : PsiType:void + USimpleNameReferenceExpression (identifier = x) [x] : PsiType:int + 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)] + UTypeReferenceExpression (name = Base) [Base] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [createBase(10)] : PsiType:Base + UIdentifier (Identifier (createBase)) [UIdentifier (Identifier (createBase))] + USimpleNameReferenceExpression (identifier = createBase, resolvesTo = null) [createBase] : PsiType:Base + ULiteralExpression (value = 10) [10] : PsiType:int + UExpressionList (super_delegation) [super_delegation java.lang.CharSequence : "abc"] + UTypeReferenceExpression (name = java.lang.CharSequence) [java.lang.CharSequence] + ULiteralExpression (value = "abc") ["abc"] : PsiType:String + 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/legacyTypes/ConstructorDelegate.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/ConstructorDelegate.types.fir.txt new file mode 100644 index 00000000000..ba42acefab2 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/ConstructorDelegate.types.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)] + 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)] + 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/legacyTypes/Constructors.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/Constructors.types.fe10.txt new file mode 100644 index 00000000000..f238f5942e9 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/Constructors.types.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 [{...}] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [(i.toString())] + UIdentifier (Identifier (this)) [UIdentifier (Identifier (this))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) [] + UQualifiedReferenceExpression [i.toString()] : PsiType:String + USimpleNameReferenceExpression (identifier = i) [i] : PsiType:int + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [toString()] : PsiType:String + UIdentifier (Identifier (toString)) [UIdentifier (Identifier (toString))] + USimpleNameReferenceExpression (identifier = toString, resolvesTo = null) [toString] : PsiType:String + 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 [{...}] + UBlockExpression [{...}] : PsiType:void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [println()] : PsiType:void + UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] + USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] : PsiType:void + 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 [{...}] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [(i.toString())] + UIdentifier (Identifier (this)) [UIdentifier (Identifier (this))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: AWithInit) [] + UQualifiedReferenceExpression [i.toString()] : PsiType:String + USimpleNameReferenceExpression (identifier = i) [i] : PsiType:int + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [toString()] : PsiType:String + UIdentifier (Identifier (toString)) [UIdentifier (Identifier (toString))] + USimpleNameReferenceExpression (identifier = toString, resolvesTo = null) [toString] : PsiType:String + 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 [{...}] + UBlockExpression [{...}] : PsiType:void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [println(1)] : PsiType:void + UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] + USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] : PsiType:void + ULiteralExpression (value = 1) [1] : PsiType:int + UBlockExpression [{...}] : PsiType:void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [println(2)] : PsiType:void + UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] + USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] : PsiType:void + ULiteralExpression (value = 2) [2] : PsiType:int + 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 [{...}] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [(i.toString())] + UIdentifier (Identifier (this)) [UIdentifier (Identifier (this))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: AWith2Init) [] + UQualifiedReferenceExpression [i.toString()] : PsiType:String + USimpleNameReferenceExpression (identifier = i) [i] : PsiType:int + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [toString()] : PsiType:String + UIdentifier (Identifier (toString)) [UIdentifier (Identifier (toString))] + USimpleNameReferenceExpression (identifier = toString, resolvesTo = null) [toString] : PsiType:String + UClass (name = AOnlyInit) [public final class AOnlyInit {...}] + UMethod (name = AOnlyInit) [public fun AOnlyInit() {...}] + UBlockExpression [{...}] + UBlockExpression [{...}] : PsiType:void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [println(1)] : PsiType:void + UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] + USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] : PsiType:void + ULiteralExpression (value = 1) [1] : PsiType:int + UBlockExpression [{...}] : PsiType:void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [println(2)] : PsiType:void + UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] + USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] : PsiType:void + ULiteralExpression (value = 2) [2] : PsiType:int + 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 [{...}] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] + UIdentifier (Identifier ()) [UIdentifier (Identifier ())] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Object) [] + UBinaryExpression (operator = =) [a = i.toString()] : PsiType:void + USimpleNameReferenceExpression (identifier = a) [a] : PsiType:String + UQualifiedReferenceExpression [i.toString()] : PsiType:String + USimpleNameReferenceExpression (identifier = i) [i] : PsiType:int + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [toString()] : PsiType:String + UIdentifier (Identifier (toString)) [UIdentifier (Identifier (toString))] + USimpleNameReferenceExpression (identifier = toString, resolvesTo = null) [toString] : PsiType:String + 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 [{...}] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] + UIdentifier (Identifier ()) [UIdentifier (Identifier ())] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Object) [] + UBinaryExpression (operator = =) [a = s] : PsiType:void + USimpleNameReferenceExpression (identifier = a) [a] : PsiType:String + USimpleNameReferenceExpression (identifier = s) [s] : PsiType:String + 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 [{...}] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] + UIdentifier (Identifier ()) [UIdentifier (Identifier ())] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Object) [] + UBlockExpression [{...}] : PsiType:void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [println()] : PsiType:void + UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] + USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] : PsiType:void + UBinaryExpression (operator = =) [a = i.toString()] : PsiType:void + USimpleNameReferenceExpression (identifier = a) [a] : PsiType:String + UQualifiedReferenceExpression [i.toString()] : PsiType:String + USimpleNameReferenceExpression (identifier = i) [i] : PsiType:int + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [toString()] : PsiType:String + UIdentifier (Identifier (toString)) [UIdentifier (Identifier (toString))] + USimpleNameReferenceExpression (identifier = toString, resolvesTo = null) [toString] : PsiType:String + 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 [{...}] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] + UIdentifier (Identifier ()) [UIdentifier (Identifier ())] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Object) [] + UBinaryExpression (operator = =) [a = s] : PsiType:void + USimpleNameReferenceExpression (identifier = a) [a] : PsiType:String + USimpleNameReferenceExpression (identifier = s) [s] : PsiType:String + UDeclarationsExpression [var local: java.lang.String = s] + ULocalVariable (name = local) [var local: java.lang.String = s] + USimpleNameReferenceExpression (identifier = s) [s] : PsiType:String + UQualifiedReferenceExpression [local.toString()] : PsiType:String + USimpleNameReferenceExpression (identifier = local) [local] : PsiType:String + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [toString()] : PsiType:String + UIdentifier (Identifier (toString)) [UIdentifier (Identifier (toString))] + USimpleNameReferenceExpression (identifier = toString, resolvesTo = null) [toString] : PsiType:String + 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 [{...}] + UBlockExpression [{...}] : PsiType:void + UBinaryExpression (operator = =) [a = i.toString()] : PsiType:void + USimpleNameReferenceExpression (identifier = a) [a] : PsiType:String + UQualifiedReferenceExpression [i.toString()] : PsiType:String + USimpleNameReferenceExpression (identifier = i) [i] : PsiType:int + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [toString()] : PsiType:String + UIdentifier (Identifier (toString)) [UIdentifier (Identifier (toString))] + USimpleNameReferenceExpression (identifier = toString, resolvesTo = null) [toString] : PsiType:String diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/Constructors.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/Constructors.types.fir.txt new file mode 100644 index 00000000000..ddbff6ab081 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/Constructors.types.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)] + UMethod (name = AWithSecondary) [public fun AWithSecondary(s: java.lang.String) = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = s) [var s: java.lang.String] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] + 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)] + UMethod (name = AWithSecondaryInit) [public fun AWithSecondaryInit(s: java.lang.String) = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = s) [var s: java.lang.String] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] + 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/legacyTypes/CycleInTypeParameters.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/CycleInTypeParameters.types.fe10.txt new file mode 100644 index 00000000000..1dad6756ecc --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/CycleInTypeParameters.types.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] : PsiType:Device + ULiteralExpression (value = null) [null] : PsiType:Void + UTypeReferenceExpression (name = Device) [Device] + 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/legacyTypes/CycleInTypeParameters.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/CycleInTypeParameters.types.fir.txt new file mode 100644 index 00000000000..142b893c998 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/CycleInTypeParameters.types.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)] + 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/legacyTypes/DefaultImpls.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/DefaultImpls.types.fe10.txt new file mode 100644 index 00000000000..75c4c064a11 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/DefaultImpls.types.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 [{...}] + UReturnExpression [return "Hello!"] + ULiteralExpression (value = "Hello!") ["Hello!"] : PsiType:String + UClass (name = Baz) [public final class Baz : Foo {...}] + UMethod (name = Baz) [public fun Baz() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/DefaultImpls.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/DefaultImpls.types.fir.txt new file mode 100644 index 00000000000..c782ae60aec --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/DefaultImpls.types.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)] + UClass (name = Baz) [public final class Baz : null {...}] + UMethod (name = Baz) [public fun Baz() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/DefaultParameterValues.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/DefaultParameterValues.types.fe10.txt new file mode 100644 index 00000000000..05bf8d357f0 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/DefaultParameterValues.types.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] : PsiType:int + 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] : PsiType:Void + UBlockExpression [{...}] : PsiType:void diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/DefaultParameterValues.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/DefaultParameterValues.types.fir.txt new file mode 100644 index 00000000000..ed2c6def575 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/DefaultParameterValues.types.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)] + UParameter (name = foo) [var foo: java.lang.String = [!] UnknownKotlinExpression (NULL)] + [!] UnknownKotlinExpression (NULL) [[!] UnknownKotlinExpression (NULL)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/Delegate.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/Delegate.types.fe10.txt new file mode 100644 index 00000000000..04951ffee51 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/Delegate.types.fe10.txt @@ -0,0 +1,59 @@ +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({ ...})] : PsiType:Lazy + UIdentifier (Identifier (lazy)) [UIdentifier (Identifier (lazy))] + USimpleNameReferenceExpression (identifier = lazy, resolvesTo = null) [lazy] : PsiType:Lazy + ULambdaExpression [{ ...}] : PsiType:Function0 + UBlockExpression [{...}] + UReturnExpression [return (18, 2, 3)] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 3)) [(18, 2, 3)] : PsiType:MyColor + UIdentifier (Identifier (MyColor)) [UIdentifier (Identifier (MyColor))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: MyColor) [] : PsiType:MyColor + ULiteralExpression (value = 18) [18] : PsiType:int + ULiteralExpression (value = 2) [2] : PsiType:int + ULiteralExpression (value = 3) [3] : PsiType:int + 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({ ...})] : PsiType:Lazy + UIdentifier (Identifier (lazy)) [UIdentifier (Identifier (lazy))] + USimpleNameReferenceExpression (identifier = lazy, resolvesTo = null) [lazy] : PsiType:Lazy + ULambdaExpression [{ ...}] : PsiType:Function0 + UBlockExpression [{...}] + UReturnExpression [return (1, 2, 3)] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 3)) [(1, 2, 3)] : PsiType:MyColor + UIdentifier (Identifier (MyColor)) [UIdentifier (Identifier (MyColor))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: MyColor) [] : PsiType:MyColor + ULiteralExpression (value = 1) [1] : PsiType:int + ULiteralExpression (value = 2) [2] : PsiType:int + ULiteralExpression (value = 3) [3] : PsiType:int + 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)] : PsiType:MyColor + UIdentifier (Identifier (MyColor)) [UIdentifier (Identifier (MyColor))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: MyColor) [] : PsiType:MyColor + ULiteralExpression (value = 1) [1] : PsiType:int + ULiteralExpression (value = 2) [2] : PsiType:int + ULiteralExpression (value = 3) [3] : PsiType:int + 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/legacyTypes/Delegate.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/Delegate.types.fir.txt new file mode 100644 index 00000000000..3818c5d5ed5 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/Delegate.types.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)] + UField (name = nonLazy) [private final var nonLazy: MyColor = [!] UnknownKotlinExpression (CALL_EXPRESSION)] + [!] UnknownKotlinExpression (CALL_EXPRESSION) [[!] UnknownKotlinExpression (CALL_EXPRESSION)] + 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/legacyTypes/DeprecatedHidden.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/DeprecatedHidden.types.fe10.txt new file mode 100644 index 00000000000..526541cc6cd --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/DeprecatedHidden.types.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 [{...}] : PsiType:void + 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] + UQualifiedReferenceExpression [DeprecationLevel.HIDDEN] : PsiType:DeprecationLevel + USimpleNameReferenceExpression (identifier = DeprecationLevel) [DeprecationLevel] + USimpleNameReferenceExpression (identifier = HIDDEN) [HIDDEN] : PsiType:DeprecationLevel + UNamedExpression (name = message) [message = "nothing"] + ULiteralExpression (value = "nothing") ["nothing"] : PsiType:String + UBlockExpression [{...}] : PsiType:void diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/DeprecatedHidden.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/DeprecatedHidden.types.fir.txt new file mode 100644 index 00000000000..76475a3daf0 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/DeprecatedHidden.types.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)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/DestructuringDeclaration.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/DestructuringDeclaration.types.fe10.txt new file mode 100644 index 00000000000..436e6b08d9f --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/DestructuringDeclaration.types.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 [{...}] : PsiType:void + UDeclarationsExpression [@null var var268d41a5: = "foo" 1...@null var b: int = var268d41a5.()] + ULocalVariable (name = var268d41a5) [@null var var268d41a5: = "foo" 1] + UAnnotation (fqName = null) [@null] + UBinaryExpression (operator = ) ["foo" 1] : PsiType:Pair + ULiteralExpression (value = "foo") ["foo"] : PsiType:String + ULiteralExpression (value = 1) [1] : PsiType:int + ULocalVariable (name = a) [@null var a: java.lang.String = var268d41a5.()] + UAnnotation (fqName = null) [@null] + UQualifiedReferenceExpression [var268d41a5.()] + USimpleNameReferenceExpression (identifier = var268d41a5) [var268d41a5] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [()] + UIdentifier (Identifier (component1)) [UIdentifier (Identifier (component1))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] + ULocalVariable (name = b) [@null var b: int = var268d41a5.()] + UAnnotation (fqName = null) [@null] + UQualifiedReferenceExpression [var268d41a5.()] + USimpleNameReferenceExpression (identifier = var268d41a5) [var268d41a5] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [()] + UIdentifier (Identifier (component2)) [UIdentifier (Identifier (component2))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] + UDeclarationsExpression [@null @kotlin.Suppress(names = "UNCHECKED_CAST") var var465978a0: = data as kotlin.Pair...@null var v: java.lang.String = var465978a0.()] + 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"] + ULiteralExpression (value = "UNCHECKED_CAST") ["UNCHECKED_CAST"] : PsiType:String + UBinaryExpressionWithType [data as kotlin.Pair] : PsiType:Pair + USimpleNameReferenceExpression (identifier = data) [data] : PsiType:Object + UTypeReferenceExpression (name = kotlin.Pair) [kotlin.Pair] + ULocalVariable (name = k) [@null var k: java.lang.String = var465978a0.()] + UAnnotation (fqName = null) [@null] + UQualifiedReferenceExpression [var465978a0.()] + USimpleNameReferenceExpression (identifier = var465978a0) [var465978a0] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [()] + UIdentifier (Identifier (component1)) [UIdentifier (Identifier (component1))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] + ULocalVariable (name = v) [@null var v: java.lang.String = var465978a0.()] + UAnnotation (fqName = null) [@null] + UQualifiedReferenceExpression [var465978a0.()] + USimpleNameReferenceExpression (identifier = var465978a0) [var465978a0] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [()] + UIdentifier (Identifier (component2)) [UIdentifier (Identifier (component2))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/DestructuringDeclaration.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/DestructuringDeclaration.types.fir.txt new file mode 100644 index 00000000000..cb4ba3eb90f --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/DestructuringDeclaration.types.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)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/Elvis.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/Elvis.types.fe10.txt new file mode 100644 index 00000000000..5818ed96a1c --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/Elvis.types.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 [{...}] + UReturnExpression [return null] + ULiteralExpression (value = null) [null] : PsiType:Void + UMethod (name = bar) [public static final fun bar() : int {...}] + UBlockExpression [{...}] + UReturnExpression [return 42] + ULiteralExpression (value = 42) [42] : PsiType:int + UMethod (name = baz) [public static final fun baz() : java.lang.String {...}] + UBlockExpression [{...}] : PsiType:Void + UReturnExpression [return elvis {...}] : PsiType:Void + UExpressionList (elvis) [elvis {...}] : PsiType:String + UDeclarationsExpression [var var243c51a0: java.lang.String = elvis {...}] + ULocalVariable (name = var243c51a0) [var var243c51a0: java.lang.String = elvis {...}] + UExpressionList (elvis) [elvis {...}] : PsiType:String + UDeclarationsExpression [var varc4aef569: java.lang.String = foo("Lorem ipsum")] + ULocalVariable (name = varc4aef569) [var varc4aef569: java.lang.String = foo("Lorem ipsum")] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [foo("Lorem ipsum")] : PsiType:String + UIdentifier (Identifier (foo)) [UIdentifier (Identifier (foo))] + USimpleNameReferenceExpression (identifier = foo, resolvesTo = null) [foo] : PsiType:String + ULiteralExpression (value = "Lorem ipsum") ["Lorem ipsum"] : PsiType:String + UIfExpression [if (varc4aef569 != null) varc4aef569 else foo("dolor sit amet")] + UBinaryExpression (operator = !=) [varc4aef569 != null] + USimpleNameReferenceExpression (identifier = varc4aef569) [varc4aef569] + ULiteralExpression (value = null) [null] + USimpleNameReferenceExpression (identifier = varc4aef569) [varc4aef569] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [foo("dolor sit amet")] : PsiType:String + UIdentifier (Identifier (foo)) [UIdentifier (Identifier (foo))] + USimpleNameReferenceExpression (identifier = foo, resolvesTo = null) [foo] : PsiType:String + ULiteralExpression (value = "dolor sit amet") ["dolor sit amet"] : PsiType:String + UIfExpression [if (var243c51a0 != null) var243c51a0 else bar().toString()] + UBinaryExpression (operator = !=) [var243c51a0 != null] + USimpleNameReferenceExpression (identifier = var243c51a0) [var243c51a0] + ULiteralExpression (value = null) [null] + USimpleNameReferenceExpression (identifier = var243c51a0) [var243c51a0] + UQualifiedReferenceExpression [bar().toString()] : PsiType:String + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [bar()] : PsiType:int + UIdentifier (Identifier (bar)) [UIdentifier (Identifier (bar))] + USimpleNameReferenceExpression (identifier = bar, resolvesTo = null) [bar] : PsiType:int + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [toString()] : PsiType:String + UIdentifier (Identifier (toString)) [UIdentifier (Identifier (toString))] + USimpleNameReferenceExpression (identifier = toString, resolvesTo = null) [toString] : PsiType:String diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/Elvis.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/Elvis.types.fir.txt new file mode 100644 index 00000000000..76bda4fb906 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/Elvis.types.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)] + UMethod (name = bar) [public static final fun bar() : int = [!] UnknownKotlinExpression (INTEGER_CONSTANT)] + [!] UnknownKotlinExpression (INTEGER_CONSTANT) [[!] UnknownKotlinExpression (INTEGER_CONSTANT)] + UMethod (name = baz) [public static final fun baz() : java.lang.String = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/ElvisType.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/ElvisType.types.fe10.txt new file mode 100644 index 00000000000..89674e673c7 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/ElvisType.types.fe10.txt @@ -0,0 +1,24 @@ +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 [{...}] + UReturnExpression [return bar(elvis {...})] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [bar(elvis {...})] : PsiType:void + UIdentifier (Identifier (bar)) [UIdentifier (Identifier (bar))] + USimpleNameReferenceExpression (identifier = bar, resolvesTo = null) [bar] : PsiType:void + UExpressionList (elvis) [elvis {...}] : PsiType:String + UDeclarationsExpression [var var63c495f9: java.lang.String = text] + ULocalVariable (name = var63c495f9) [var var63c495f9: java.lang.String = text] + USimpleNameReferenceExpression (identifier = text) [text] : PsiType:String + UIfExpression [if (var63c495f9 != null) var63c495f9 else return] + UBinaryExpression (operator = !=) [var63c495f9 != null] + USimpleNameReferenceExpression (identifier = var63c495f9) [var63c495f9] + ULiteralExpression (value = null) [null] + USimpleNameReferenceExpression (identifier = var63c495f9) [var63c495f9] + UReturnExpression [return] : PsiType:Void + 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 [{...}] : PsiType:void diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/ElvisType.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/ElvisType.types.fir.txt new file mode 100644 index 00000000000..fbc22312e5e --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/ElvisType.types.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)] + 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)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/EnumValueMembers.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/EnumValueMembers.types.fe10.txt new file mode 100644 index 00000000000..c2a2787bf7c --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/EnumValueMembers.types.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") {...}] + UAnnotation (fqName = null) [@null] + USimpleNameReferenceExpression (identifier = Style) [Style] + ULiteralExpression (value = "foo") ["foo"] : PsiType:String + UClass (name = SHEET) [public static final class SHEET : Style {...}] + UMethod (name = getExitAnimation) [public fun getExitAnimation() : java.lang.String {...}] + UBlockExpression [{...}] + UReturnExpression [return "bar"] + ULiteralExpression (value = "bar") ["bar"] : PsiType:String + 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/legacyTypes/EnumValueMembers.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/EnumValueMembers.types.fir.txt new file mode 100644 index 00000000000..cf1dad3db16 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/EnumValueMembers.types.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/legacyTypes/EnumValuesConstructors.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/EnumValuesConstructors.types.fe10.txt new file mode 100644 index 00000000000..856ca02c072 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/EnumValuesConstructors.types.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")] + UAnnotation (fqName = null) [@null] + USimpleNameReferenceExpression (identifier = Style) [Style] + ULiteralExpression (value = "system") ["system"] : PsiType:String + UEnumConstant (name = USER) [@null USER("user")] + UAnnotation (fqName = null) [@null] + USimpleNameReferenceExpression (identifier = Style) [Style] + ULiteralExpression (value = "user") ["user"] : PsiType:String + UEnumConstant (name = INTERNAL) [@null INTERNAL("internal")] + UAnnotation (fqName = null) [@null] + USimpleNameReferenceExpression (identifier = Style) [Style] + ULiteralExpression (value = "internal") ["internal"] : PsiType:String + UEnumConstant (name = UNKNOWN) [@null UNKNOWN(null)] + UAnnotation (fqName = null) [@null] + USimpleNameReferenceExpression (identifier = Style) [Style] + ULiteralExpression (value = null) [null] : PsiType:Void + 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/legacyTypes/EnumValuesConstructors.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/EnumValuesConstructors.types.fir.txt new file mode 100644 index 00000000000..0041eae9923 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/EnumValuesConstructors.types.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/legacyTypes/IfStatement.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/IfStatement.types.fe10.txt new file mode 100644 index 00000000000..b7e97dc41ba --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/IfStatement.types.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 [{...}] : PsiType:void + UDeclarationsExpression [var x: int = if ("abc" != "def") 1 else 0] + ULocalVariable (name = x) [var x: int = if ("abc" != "def") 1 else 0] + UIfExpression [if ("abc" != "def") 1 else 0] : PsiType:int + UBinaryExpression (operator = !=) ["abc" != "def"] : PsiType:boolean + ULiteralExpression (value = "abc") ["abc"] : PsiType:String + ULiteralExpression (value = "def") ["def"] : PsiType:String + ULiteralExpression (value = 1) [1] : PsiType:int + ULiteralExpression (value = 0) [0] : PsiType:int diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/IfStatement.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/IfStatement.types.fir.txt new file mode 100644 index 00000000000..e581b364b2c --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/IfStatement.types.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)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/Imports.types.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/Imports.types.txt new file mode 100644 index 00000000000..725e3e0f0f2 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/Imports.types.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/legacyTypes/In.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/In.types.fe10.txt new file mode 100644 index 00000000000..b2d91817fcb --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/In.types.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 [{...}] : PsiType:Void + UDeclarationsExpression [var x: int = 1] + ULocalVariable (name = x) [var x: int = 1] + ULiteralExpression (value = 1) [1] : PsiType:int + UDeclarationsExpression [var y: int = 10] + ULocalVariable (name = y) [var y: int = 10] + ULiteralExpression (value = 10) [10] : PsiType:int + UReturnExpression [return x in 0 .. 5 && y !in 4 .. 9] : PsiType:Void + UBinaryExpression (operator = &&) [x in 0 .. 5 && y !in 4 .. 9] : PsiType:boolean + UBinaryExpression (operator = in) [x in 0 .. 5] : PsiType:boolean + USimpleNameReferenceExpression (identifier = x) [x] : PsiType:int + UBinaryExpression (operator = ..) [0 .. 5] : PsiType:IntRange + ULiteralExpression (value = 0) [0] : PsiType:int + ULiteralExpression (value = 5) [5] : PsiType:int + UBinaryExpression (operator = !in) [y !in 4 .. 9] : PsiType:boolean + USimpleNameReferenceExpression (identifier = y) [y] : PsiType:int + UBinaryExpression (operator = ..) [4 .. 9] : PsiType:IntRange + ULiteralExpression (value = 4) [4] : PsiType:int + ULiteralExpression (value = 9) [9] : PsiType:int diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/In.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/In.types.fir.txt new file mode 100644 index 00000000000..516b43857c4 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/In.types.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)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/InferenceInsideUnresolvedConstructor.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/InferenceInsideUnresolvedConstructor.types.fe10.txt new file mode 100644 index 00000000000..dce06a46fef --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/InferenceInsideUnresolvedConstructor.types.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 [{...}] + UReturnExpression [return (id(42))] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [(id(42))] + UIdentifier (Identifier (Unresolved)) [UIdentifier (Identifier (Unresolved))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [id(42)] : PsiType:int + UIdentifier (Identifier (id)) [UIdentifier (Identifier (id))] + USimpleNameReferenceExpression (identifier = id, resolvesTo = null) [id] : PsiType:int + ULiteralExpression (value = 42) [42] : PsiType:int + 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 [{...}] + UReturnExpression [return x] + USimpleNameReferenceExpression (identifier = x) [x] : PsiType:T diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/InferenceInsideUnresolvedConstructor.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/InferenceInsideUnresolvedConstructor.types.fir.txt new file mode 100644 index 00000000000..52592c8ddfd --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/InferenceInsideUnresolvedConstructor.types.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)] + 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)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/InnerClasses.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/InnerClasses.types.fe10.txt new file mode 100644 index 00000000000..ded41bbb992 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/InnerClasses.types.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 [{...}] + UReturnExpression [return a + b] + UBinaryExpression (operator = +) [a + b] : PsiType:int + USimpleNameReferenceExpression (identifier = a) [a] : PsiType:int + USimpleNameReferenceExpression (identifier = b) [b] : PsiType:int + 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 [{...}] + UReturnExpression [return Unit] + USimpleNameReferenceExpression (identifier = Unit) [Unit] : PsiType:void + UMethod (name = Baz) [public fun Baz() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/InnerClasses.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/InnerClasses.types.fir.txt new file mode 100644 index 00000000000..69b0f06ea92 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/InnerClasses.types.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)] + 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)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/InnerNonFixedTypeVariable.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/InnerNonFixedTypeVariable.types.fe10.txt new file mode 100644 index 00000000000..51fead0219e --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/InnerNonFixedTypeVariable.types.fe10.txt @@ -0,0 +1,22 @@ +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 [{...}] : PsiType: + UQualifiedReferenceExpression [list.filterIsInstance().(mutableSetOf(), { ...})] : PsiType: + UQualifiedReferenceExpression [list.filterIsInstance()] + USimpleNameReferenceExpression (identifier = list) [list] : PsiType:List + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [filterIsInstance()] + UIdentifier (Identifier (filterIsInstance)) [UIdentifier (Identifier (filterIsInstance))] + USimpleNameReferenceExpression (identifier = filterIsInstance, resolvesTo = null) [filterIsInstance] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 2)) [(mutableSetOf(), { ...})] : PsiType: + UIdentifier (Identifier (mapTo)) [UIdentifier (Identifier (mapTo))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] : PsiType: + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [mutableSetOf()] : PsiType:Set + UIdentifier (Identifier (mutableSetOf)) [UIdentifier (Identifier (mutableSetOf))] + USimpleNameReferenceExpression (identifier = mutableSetOf, resolvesTo = null) [mutableSetOf] : PsiType:Set + ULambdaExpression [{ ...}] : PsiType:Function0 + UBlockExpression [{...}] + UClass (name = Some) [public final class Some {...}] + UMethod (name = Some) [public fun Some() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/InnerNonFixedTypeVariable.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/InnerNonFixedTypeVariable.types.fir.txt new file mode 100644 index 00000000000..df69d79c559 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/InnerNonFixedTypeVariable.types.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)] + UClass (name = Some) [public final class Some {...}] + UMethod (name = Some) [public fun Some() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/LambdaReturn.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/LambdaReturn.types.fe10.txt new file mode 100644 index 00000000000..780078caecc --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/LambdaReturn.types.fe10.txt @@ -0,0 +1,141 @@ +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 [{...}] : PsiType:void + UDeclarationsExpression [var lam1: kotlin.jvm.functions.Function1 = { @org.jetbrains.annotations.NotNull var a: int ->...}] + ULocalVariable (name = lam1) [var lam1: kotlin.jvm.functions.Function1 = { @org.jetbrains.annotations.NotNull var a: int ->...}] + ULambdaExpression [{ @org.jetbrains.annotations.NotNull var a: int ->...}] : PsiType:Function1 + UParameter (name = a) [@org.jetbrains.annotations.NotNull var a: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] + UDeclarationsExpression [var b: int = 1] + ULocalVariable (name = b) [var b: int = 1] + ULiteralExpression (value = 1) [1] : PsiType:int + UReturnExpression [return a + b] + UBinaryExpression (operator = +) [a + b] : PsiType:int + USimpleNameReferenceExpression (identifier = a) [a] : PsiType:int + USimpleNameReferenceExpression (identifier = b) [b] : PsiType:int + UDeclarationsExpression [var lam2: kotlin.jvm.functions.Function1 = { @org.jetbrains.annotations.NotNull var a: int ->...}] + ULocalVariable (name = lam2) [var lam2: kotlin.jvm.functions.Function1 = { @org.jetbrains.annotations.NotNull var a: int ->...}] + ULambdaExpression [{ @org.jetbrains.annotations.NotNull var a: int ->...}] : PsiType:Function1 + UParameter (name = a) [@org.jetbrains.annotations.NotNull var a: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] + UDeclarationsExpression [var c: int = 1] + ULocalVariable (name = c) [var c: int = 1] + ULiteralExpression (value = 1) [1] : PsiType:int + UReturnExpression [return if (a > 0) a + c else a - c] + UIfExpression [if (a > 0) a + c else a - c] : PsiType:int + UBinaryExpression (operator = >) [a > 0] : PsiType:boolean + USimpleNameReferenceExpression (identifier = a) [a] : PsiType:int + ULiteralExpression (value = 0) [0] : PsiType:int + UBinaryExpression (operator = +) [a + c] : PsiType:int + USimpleNameReferenceExpression (identifier = a) [a] : PsiType:int + USimpleNameReferenceExpression (identifier = c) [c] : PsiType:int + UBinaryExpression (operator = -) [a - c] : PsiType:int + USimpleNameReferenceExpression (identifier = a) [a] : PsiType:int + USimpleNameReferenceExpression (identifier = c) [c] : PsiType:int + UDeclarationsExpression [var lam3: kotlin.jvm.functions.Function1 = lbd@ { @org.jetbrains.annotations.NotNull var a: int ->...}] + 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 ->...}] + ULambdaExpression [{ @org.jetbrains.annotations.NotNull var a: int ->...}] : PsiType:Function1 + UParameter (name = a) [@org.jetbrains.annotations.NotNull var a: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] + UDeclarationsExpression [var d: int = 1] + ULocalVariable (name = d) [var d: int = 1] + ULiteralExpression (value = 1) [1] : PsiType:int + UReturnExpression [return a + d] : PsiType:Void + UBinaryExpression (operator = +) [a + d] : PsiType:int + USimpleNameReferenceExpression (identifier = a) [a] : PsiType:int + USimpleNameReferenceExpression (identifier = d) [d] : PsiType:int + UDeclarationsExpression [var lam4: kotlin.jvm.functions.Function1 = fun (@org.jetbrains.annotations.NotNull var a: int) {...}] + 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) {...}] + UParameter (name = a) [@org.jetbrains.annotations.NotNull var a: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] : PsiType:Void + UIfExpression [if (a < 5) return "5"] : PsiType:void + UBinaryExpression (operator = <) [a < 5] : PsiType:boolean + USimpleNameReferenceExpression (identifier = a) [a] : PsiType:int + ULiteralExpression (value = 5) [5] : PsiType:int + UReturnExpression [return "5"] : PsiType:Void + ULiteralExpression (value = "5") ["5"] : PsiType:String + UIfExpression [if (a > 0) return "1" else return "2"] : PsiType:Void + UBinaryExpression (operator = >) [a > 0] : PsiType:boolean + USimpleNameReferenceExpression (identifier = a) [a] : PsiType:int + ULiteralExpression (value = 0) [0] : PsiType:int + UReturnExpression [return "1"] : PsiType:Void + ULiteralExpression (value = "1") ["1"] : PsiType:String + UReturnExpression [return "2"] : PsiType:Void + ULiteralExpression (value = "2") ["2"] : PsiType:String + UDeclarationsExpression [var lam5: kotlin.jvm.functions.Function1 = fun (@org.jetbrains.annotations.NotNull var a: int) {...}] + 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) {...}] + UParameter (name = a) [@org.jetbrains.annotations.NotNull var a: int] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] + UReturnExpression [return "a" + a] + UBinaryExpression (operator = +) ["a" + a] : PsiType:String + ULiteralExpression (value = "a") ["a"] : PsiType:String + USimpleNameReferenceExpression (identifier = a) [a] : PsiType:int + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [bar({ var it: int ->...})] : PsiType:void + UIdentifier (Identifier (bar)) [UIdentifier (Identifier (bar))] + USimpleNameReferenceExpression (identifier = bar, resolvesTo = null) [bar] : PsiType:void + ULambdaExpression [{ var it: int ->...}] : PsiType:Function1 + UParameter (name = it) [var it: int] + UBlockExpression [{...}] + UIfExpression [if (it > 5) return] : PsiType:void + UBinaryExpression (operator = >) [it > 5] : PsiType:boolean + USimpleNameReferenceExpression (identifier = it) [it] : PsiType:int + ULiteralExpression (value = 5) [5] : PsiType:int + UReturnExpression [return] : PsiType:Void + UDeclarationsExpression [var b: int = 1] + ULocalVariable (name = b) [var b: int = 1] + ULiteralExpression (value = 1) [1] : PsiType:int + UReturnExpression [return it + b] + UBinaryExpression (operator = +) [it + b] : PsiType:int + USimpleNameReferenceExpression (identifier = it) [it] : PsiType:int + USimpleNameReferenceExpression (identifier = b) [b] : PsiType:int + UDeclarationsExpression [var x: kotlin.jvm.functions.Function0 = { ...}] + ULocalVariable (name = x) [var x: kotlin.jvm.functions.Function0 = { ...}] + ULambdaExpression [{ ...}] : PsiType:Function0 + UBlockExpression [{...}] + UDeclarationsExpression [@org.jetbrains.annotations.NotNull var vardbcd0724: = listOf(1, 2)...@org.jetbrains.annotations.NotNull var b: int = vardbcd0724.()] + 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)] : PsiType:List + UIdentifier (Identifier (listOf)) [UIdentifier (Identifier (listOf))] + USimpleNameReferenceExpression (identifier = listOf, resolvesTo = null) [listOf] : PsiType:List + ULiteralExpression (value = 1) [1] : PsiType:int + ULiteralExpression (value = 2) [2] : PsiType:int + ULocalVariable (name = a) [@org.jetbrains.annotations.NotNull var a: int = vardbcd0724.()] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UQualifiedReferenceExpression [vardbcd0724.()] + USimpleNameReferenceExpression (identifier = vardbcd0724) [vardbcd0724] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [()] + UIdentifier (Identifier (component1)) [UIdentifier (Identifier (component1))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] + ULocalVariable (name = b) [@org.jetbrains.annotations.NotNull var b: int = vardbcd0724.()] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UQualifiedReferenceExpression [vardbcd0724.()] + USimpleNameReferenceExpression (identifier = vardbcd0724) [vardbcd0724] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [()] + UIdentifier (Identifier (component2)) [UIdentifier (Identifier (component2))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] + UDeclarationsExpression [var y: kotlin.jvm.functions.Function0 = { ...}] + ULocalVariable (name = y) [var y: kotlin.jvm.functions.Function0 = { ...}] + ULambdaExpression [{ ...}] : PsiType:Function0 + UBlockExpression [{...}] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [listOf(1)] : PsiType:List + UIdentifier (Identifier (listOf)) [UIdentifier (Identifier (listOf))] + USimpleNameReferenceExpression (identifier = listOf, resolvesTo = null) [listOf] : PsiType:List + ULiteralExpression (value = 1) [1] : PsiType:int + 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 [{...}] : PsiType:int + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [invoke(1)] : PsiType:int + UIdentifier (Identifier (lmbd)) [UIdentifier (Identifier (lmbd))] + USimpleNameReferenceExpression (identifier = invoke, resolvesTo = null) [invoke] : PsiType:int + ULiteralExpression (value = 1) [1] : PsiType:int diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/LambdaReturn.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/LambdaReturn.types.fir.txt new file mode 100644 index 00000000000..757a5d25840 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/LambdaReturn.types.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)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/Lambdas.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/Lambdas.types.fe10.txt new file mode 100644 index 00000000000..2a40bba9c31 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/Lambdas.types.fe10.txt @@ -0,0 +1,47 @@ +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 [{...}] : PsiType:Stream + UQualifiedReferenceExpression [Stream.empty().filter({ var it: java.lang.String ->...})] : PsiType:Stream + UQualifiedReferenceExpression [Stream.empty()] : PsiType:Stream + USimpleNameReferenceExpression (identifier = Stream) [Stream] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [empty()] : PsiType:Stream + UIdentifier (Identifier (empty)) [UIdentifier (Identifier (empty))] + USimpleNameReferenceExpression (identifier = empty, resolvesTo = null) [empty] : PsiType:Stream + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [filter({ var it: java.lang.String ->...})] : PsiType:Stream + UIdentifier (Identifier (filter)) [UIdentifier (Identifier (filter))] + USimpleNameReferenceExpression (identifier = filter, resolvesTo = null) [filter] : PsiType:Stream + ULambdaExpression [{ var it: java.lang.String ->...}] : PsiType:Function1 + UParameter (name = it) [var it: java.lang.String] + UBlockExpression [{...}] + UReturnExpression [return it.isEmpty()] + UQualifiedReferenceExpression [it.isEmpty()] : PsiType:boolean + USimpleNameReferenceExpression (identifier = it) [it] : PsiType:String + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [isEmpty()] : PsiType:boolean + UIdentifier (Identifier (isEmpty)) [UIdentifier (Identifier (isEmpty))] + USimpleNameReferenceExpression (identifier = isEmpty, resolvesTo = null) [isEmpty] : PsiType:boolean + 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 [{...}] : PsiType:void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [invoke()] : PsiType:void + UIdentifier (Identifier (selectItemFunction)) [UIdentifier (Identifier (selectItemFunction))] + USimpleNameReferenceExpression (identifier = invoke, resolvesTo = null) [invoke] : PsiType:void + UDeclarationsExpression [var baz: kotlin.jvm.functions.Function0 = fun () {...}] + ULocalVariable (name = baz) [var baz: kotlin.jvm.functions.Function0 = fun () {...}] + ULambdaExpression [fun () {...}] + UBlockExpression [{...}] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [()] + UIdentifier (Identifier (Local)) [UIdentifier (Identifier (Local))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [invoke()] : PsiType:void + UIdentifier (Identifier (baz)) [UIdentifier (Identifier (baz))] + USimpleNameReferenceExpression (identifier = invoke, resolvesTo = null) [invoke] : PsiType:void + UMethod (name = lambdaInPlaceCall) [public static final fun lambdaInPlaceCall() : void {...}] + UBlockExpression [{...}] : PsiType:void + UWhileExpression [while (invoke()) {...}] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [invoke()] : PsiType:boolean + UIdentifier (Identifier ({)) [UIdentifier (Identifier ({))] + USimpleNameReferenceExpression (identifier = invoke, resolvesTo = null) [invoke] : PsiType:boolean + UBlockExpression [{...}] : PsiType:void diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/Lambdas.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/Lambdas.types.fir.txt new file mode 100644 index 00000000000..d1d30971dbc --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/Lambdas.types.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)] + 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)] + UMethod (name = lambdaInPlaceCall) [public static final fun lambdaInPlaceCall() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/LocalDeclarations.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/LocalDeclarations.types.fe10.txt new file mode 100644 index 00000000000..4c8a21df8c3 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/LocalDeclarations.types.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 [{...}] : PsiType:Void + UDeclarationsExpression [public static final class Local {...}] + UClass (name = Local) [public static final class Local {...}] + UMethod (name = Local) [public fun Local() = UastEmptyExpression] + UDeclarationsExpression [var bar: = fun () {...}] + UVariable (name = bar) [var bar: = fun () {...}] + ULambdaExpression [fun () {...}] + UBlockExpression [{...}] + UReturnExpression [return ()] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] : PsiType: + UIdentifier (Identifier (Local)) [UIdentifier (Identifier (Local))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Local) [] : PsiType: + UDeclarationsExpression [var baz: kotlin.jvm.functions.Function0 = fun () {...}] + ULocalVariable (name = baz) [var baz: kotlin.jvm.functions.Function0 = fun () {...}] + ULambdaExpression [fun () {...}] + UBlockExpression [{...}] : PsiType: + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] : PsiType: + UIdentifier (Identifier (Local)) [UIdentifier (Identifier (Local))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Local) [] : PsiType: + UDeclarationsExpression [var someLocalFun: kotlin.jvm.functions.Function2 = fun (@org.jetbrains.annotations.NotNull var text: java.lang.String) {...}] + 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) {...}] + UParameter (name = text) [@org.jetbrains.annotations.NotNull var text: java.lang.String] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] + UReturnExpression [return 42] + ULiteralExpression (value = 42) [42] : PsiType:int + UReturnExpression [return bar() == ()] : PsiType:Void + UBinaryExpression (operator = ==) [bar() == ()] : PsiType:boolean + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [bar()] : PsiType: + UIdentifier (Identifier (bar)) [UIdentifier (Identifier (bar))] + USimpleNameReferenceExpression (identifier = bar, resolvesTo = null) [bar] : PsiType: + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] : PsiType: + UIdentifier (Identifier (Local)) [UIdentifier (Identifier (Local))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Local) [] : PsiType: diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/LocalDeclarations.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/LocalDeclarations.types.fir.txt new file mode 100644 index 00000000000..0e4d898bce8 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/LocalDeclarations.types.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)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/LocalVariableWithAnnotation.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/LocalVariableWithAnnotation.types.fe10.txt new file mode 100644 index 00000000000..54838692027 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/LocalVariableWithAnnotation.types.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 [{...}] : PsiType:void + UDeclarationsExpression [@TestAnnotation var bar: java.lang.String = "lorem ipsum"] + ULocalVariable (name = bar) [@TestAnnotation var bar: java.lang.String = "lorem ipsum"] + UAnnotation (fqName = TestAnnotation) [@TestAnnotation] + ULiteralExpression (value = "lorem ipsum") ["lorem ipsum"] : PsiType:String + UClass (name = TestAnnotation) [public abstract annotation TestAnnotation {...}] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/LocalVariableWithAnnotation.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/LocalVariableWithAnnotation.types.fir.txt new file mode 100644 index 00000000000..20cfeb2bf11 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/LocalVariableWithAnnotation.types.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)] + UClass (name = TestAnnotation) [public abstract annotation TestAnnotation {...}] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/ManyAlternatives.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/ManyAlternatives.types.fe10.txt new file mode 100644 index 00000000000..36504113eb9 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/ManyAlternatives.types.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] : PsiType:int + 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/legacyTypes/ManyAlternatives.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/ManyAlternatives.types.fir.txt new file mode 100644 index 00000000000..8ed9f624e97 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/ManyAlternatives.types.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)] + 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/legacyTypes/MethodReference.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/MethodReference.types.fe10.txt new file mode 100644 index 00000000000..d7e16b1eec2 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/MethodReference.types.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] : PsiType:KFunction + 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 [{...}] : PsiType:void + UMethod (name = Foo) [public fun Foo() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/MethodReference.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/MethodReference.types.fir.txt new file mode 100644 index 00000000000..9716268cfea --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/MethodReference.types.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)] + 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)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/NameContainingFile.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/NameContainingFile.types.fe10.txt new file mode 100644 index 00000000000..158678a7288 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/NameContainingFile.types.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] : PsiType:int + UMethod (name = bar) [public static final fun bar() : void {...}] + UBlockExpression [{...}] : PsiType:void + 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/legacyTypes/NameContainingFile.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/NameContainingFile.types.fir.txt new file mode 100644 index 00000000000..cff29b6ab97 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/NameContainingFile.types.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)] + UMethod (name = bar) [public static final fun bar() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] + 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/legacyTypes/NonTrivialIdentifiers.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/NonTrivialIdentifiers.types.fe10.txt new file mode 100644 index 00000000000..b0ea7b9f37f --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/NonTrivialIdentifiers.types.fe10.txt @@ -0,0 +1,38 @@ +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 [{...}] : PsiType:void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [invoke()] : PsiType:void + UIdentifier (Identifier (()) [UIdentifier (Identifier (())] + USimpleNameReferenceExpression (identifier = invoke, resolvesTo = null) [invoke] : PsiType:void + UDeclarationsExpression [var p: A = ()] + ULocalVariable (name = p) [var p: A = ()] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] : PsiType:A + UIdentifier (Identifier (A)) [UIdentifier (Identifier (A))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) [] : PsiType:A + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [invoke({ ...})] : PsiType:void + UIdentifier (Identifier ({)) [UIdentifier (Identifier ({))] + USimpleNameReferenceExpression (identifier = invoke, resolvesTo = null) [invoke] : PsiType:void + ULambdaExpression [{ ...}] : PsiType:Function0 + UBlockExpression [{...}] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [invoke({ ...})] : PsiType:void + UIdentifier (Identifier (p)) [UIdentifier (Identifier (p))] + USimpleNameReferenceExpression (identifier = invoke, resolvesTo = null) [invoke] : PsiType:void + ULambdaExpression [{ ...}] : PsiType:Function0 + UBlockExpression [{...}] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [invoke()] : PsiType:void + UIdentifier (Identifier (()) [UIdentifier (Identifier (())] + USimpleNameReferenceExpression (identifier = invoke, resolvesTo = null) [invoke] : PsiType:void + UClass (name = A) [public final class A {...}] + UMethod (name = invoke) [public final fun invoke() : void {...}] + UBlockExpression [{...}] : PsiType:void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [invoke()] : PsiType:void + UIdentifier (Identifier (()) [UIdentifier (Identifier (())] + USimpleNameReferenceExpression (identifier = invoke, resolvesTo = null) [invoke] : PsiType:void + 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 [{...}] : PsiType:void + UMethod (name = A) [public fun A() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/NonTrivialIdentifiers.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/NonTrivialIdentifiers.types.fir.txt new file mode 100644 index 00000000000..eb2cc1c8f02 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/NonTrivialIdentifiers.types.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)] + 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)] + 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)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/ParameterPropertyWithAnnotation.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/ParameterPropertyWithAnnotation.types.fe10.txt new file mode 100644 index 00000000000..808953ac024 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/ParameterPropertyWithAnnotation.types.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/legacyTypes/ParameterPropertyWithAnnotation.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/ParameterPropertyWithAnnotation.types.fir.txt new file mode 100644 index 00000000000..fd979a51ceb --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/ParameterPropertyWithAnnotation.types.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/legacyTypes/ParametersDisorder.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/ParametersDisorder.types.fe10.txt new file mode 100644 index 00000000000..974c97f1bde --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/ParametersDisorder.types.fe10.txt @@ -0,0 +1,163 @@ +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 [{...}] : PsiType:void + 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] : PsiType:int + 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"] : PsiType:String + UBlockExpression [{...}] : PsiType:void + 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 [{...}] : PsiType:void + UMethod (name = call) [public static final fun call() : void {...}] + UBlockExpression [{...}] : PsiType:void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 2)) [global(2.2, 2)] : PsiType:void + UIdentifier (Identifier (global)) [UIdentifier (Identifier (global))] + USimpleNameReferenceExpression (identifier = global, resolvesTo = null) [global] : PsiType:void + ULiteralExpression (value = 2.2) [2.2] : PsiType:float + ULiteralExpression (value = 2) [2] : PsiType:int + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [withDefault("bbb")] : PsiType:void + UIdentifier (Identifier (withDefault)) [UIdentifier (Identifier (withDefault))] + USimpleNameReferenceExpression (identifier = withDefault, resolvesTo = null) [withDefault] : PsiType:void + ULiteralExpression (value = "bbb") ["bbb"] : PsiType:String + UQualifiedReferenceExpression ["abc".withReceiver(1, 1.2)] : PsiType:void + ULiteralExpression (value = "abc") ["abc"] : PsiType:String + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 2)) [withReceiver(1, 1.2)] : PsiType:void + UIdentifier (Identifier (withReceiver)) [UIdentifier (Identifier (withReceiver))] + USimpleNameReferenceExpression (identifier = withReceiver, resolvesTo = null) [withReceiver] : PsiType:void + ULiteralExpression (value = 1) [1] : PsiType:int + ULiteralExpression (value = 1.2) [1.2] : PsiType:float + UQualifiedReferenceExpression [Math.atan2(1.3, 3.4)] : PsiType:double + USimpleNameReferenceExpression (identifier = Math) [Math] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 2)) [atan2(1.3, 3.4)] : PsiType:double + UIdentifier (Identifier (atan2)) [UIdentifier (Identifier (atan2))] + USimpleNameReferenceExpression (identifier = atan2, resolvesTo = null) [atan2] : PsiType:double + ULiteralExpression (value = 1.3) [1.3] : PsiType:double + ULiteralExpression (value = 3.4) [3.4] : PsiType:double + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 2)) [("param1", "param2")] + UIdentifier (Identifier (unresolvedMethod)) [UIdentifier (Identifier (unresolvedMethod))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] + ULiteralExpression (value = "param1") ["param1"] : PsiType:String + ULiteralExpression (value = "param2") ["param2"] : PsiType:String + UQualifiedReferenceExpression [java.lang.String.format("%i %i %i", 1, 2, 3)] : PsiType:String + UQualifiedReferenceExpression [java.lang.String] + UQualifiedReferenceExpression [java.lang] + USimpleNameReferenceExpression (identifier = java) [java] + USimpleNameReferenceExpression (identifier = lang) [lang] + USimpleNameReferenceExpression (identifier = String) [String] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 4)) [format("%i %i %i", 1, 2, 3)] : PsiType:String + UIdentifier (Identifier (format)) [UIdentifier (Identifier (format))] + USimpleNameReferenceExpression (identifier = format, resolvesTo = null) [format] : PsiType:String + ULiteralExpression (value = "%i %i %i") ["%i %i %i"] : PsiType:String + ULiteralExpression (value = 1) [1] : PsiType:int + ULiteralExpression (value = 2) [2] : PsiType:int + ULiteralExpression (value = 3) [3] : PsiType:int + UQualifiedReferenceExpression [java.lang.String.format("%i %i %i", arrayOf(1, 2, 3))] : PsiType:String + UQualifiedReferenceExpression [java.lang.String] + UQualifiedReferenceExpression [java.lang] + USimpleNameReferenceExpression (identifier = java) [java] + USimpleNameReferenceExpression (identifier = lang) [lang] + USimpleNameReferenceExpression (identifier = String) [String] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 2)) [format("%i %i %i", arrayOf(1, 2, 3))] : PsiType:String + UIdentifier (Identifier (format)) [UIdentifier (Identifier (format))] + USimpleNameReferenceExpression (identifier = format, resolvesTo = null) [format] : PsiType:String + ULiteralExpression (value = "%i %i %i") ["%i %i %i"] : PsiType:String + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 3)) [arrayOf(1, 2, 3)] : PsiType:Integer[] + UIdentifier (Identifier (arrayOf)) [UIdentifier (Identifier (arrayOf))] + USimpleNameReferenceExpression (identifier = arrayOf, resolvesTo = null) [arrayOf] : PsiType:Integer[] + ULiteralExpression (value = 1) [1] : PsiType:int + ULiteralExpression (value = 2) [2] : PsiType:int + ULiteralExpression (value = 3) [3] : PsiType:int + UQualifiedReferenceExpression [java.lang.String.format("%i %i %i", arrayOf(1, 2, 3), arrayOf(4, 5, 6))] : PsiType:String + UQualifiedReferenceExpression [java.lang.String] + UQualifiedReferenceExpression [java.lang] + USimpleNameReferenceExpression (identifier = java) [java] + USimpleNameReferenceExpression (identifier = lang) [lang] + USimpleNameReferenceExpression (identifier = String) [String] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 3)) [format("%i %i %i", arrayOf(1, 2, 3), arrayOf(4, 5, 6))] : PsiType:String + UIdentifier (Identifier (format)) [UIdentifier (Identifier (format))] + USimpleNameReferenceExpression (identifier = format, resolvesTo = null) [format] : PsiType:String + ULiteralExpression (value = "%i %i %i") ["%i %i %i"] : PsiType:String + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 3)) [arrayOf(1, 2, 3)] : PsiType:Integer[] + UIdentifier (Identifier (arrayOf)) [UIdentifier (Identifier (arrayOf))] + USimpleNameReferenceExpression (identifier = arrayOf, resolvesTo = null) [arrayOf] : PsiType:Integer[] + ULiteralExpression (value = 1) [1] : PsiType:int + ULiteralExpression (value = 2) [2] : PsiType:int + ULiteralExpression (value = 3) [3] : PsiType:int + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 3)) [arrayOf(4, 5, 6)] : PsiType:Integer[] + UIdentifier (Identifier (arrayOf)) [UIdentifier (Identifier (arrayOf))] + USimpleNameReferenceExpression (identifier = arrayOf, resolvesTo = null) [arrayOf] : PsiType:Integer[] + ULiteralExpression (value = 4) [4] : PsiType:int + ULiteralExpression (value = 5) [5] : PsiType:int + ULiteralExpression (value = 6) [6] : PsiType:int + UQualifiedReferenceExpression [java.lang.String.format("%i %i %i", "".chunked(2).toTypedArray())] : PsiType:String + UQualifiedReferenceExpression [java.lang.String] + UQualifiedReferenceExpression [java.lang] + USimpleNameReferenceExpression (identifier = java) [java] + USimpleNameReferenceExpression (identifier = lang) [lang] + USimpleNameReferenceExpression (identifier = String) [String] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 2)) [format("%i %i %i", "".chunked(2).toTypedArray())] : PsiType:String + UIdentifier (Identifier (format)) [UIdentifier (Identifier (format))] + USimpleNameReferenceExpression (identifier = format, resolvesTo = null) [format] : PsiType:String + ULiteralExpression (value = "%i %i %i") ["%i %i %i"] : PsiType:String + UQualifiedReferenceExpression ["".chunked(2).toTypedArray()] : PsiType:String[] + UQualifiedReferenceExpression ["".chunked(2)] : PsiType:List + ULiteralExpression (value = "") [""] : PsiType:String + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [chunked(2)] : PsiType:List + UIdentifier (Identifier (chunked)) [UIdentifier (Identifier (chunked))] + USimpleNameReferenceExpression (identifier = chunked, resolvesTo = null) [chunked] : PsiType:List + ULiteralExpression (value = 2) [2] : PsiType:int + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [toTypedArray()] : PsiType:String[] + UIdentifier (Identifier (toTypedArray)) [UIdentifier (Identifier (toTypedArray))] + USimpleNameReferenceExpression (identifier = toTypedArray, resolvesTo = null) [toTypedArray] : PsiType:String[] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 2)) [with((), { ...})] : PsiType:void + UIdentifier (Identifier (with)) [UIdentifier (Identifier (with))] + USimpleNameReferenceExpression (identifier = with, resolvesTo = null) [with] : PsiType:void + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] : PsiType:A + UIdentifier (Identifier (A)) [UIdentifier (Identifier (A))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) [] : PsiType:A + ULambdaExpression [{ ...}] : PsiType:Function1 + UBlockExpression [{...}] + UQualifiedReferenceExpression ["def".with2Receivers(8, 7.0)] : PsiType:void + ULiteralExpression (value = "def") ["def"] : PsiType:String + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 2)) [with2Receivers(8, 7.0)] : PsiType:void + UIdentifier (Identifier (with2Receivers)) [UIdentifier (Identifier (with2Receivers))] + USimpleNameReferenceExpression (identifier = with2Receivers, resolvesTo = null) [with2Receivers] : PsiType:void + ULiteralExpression (value = 8) [8] : PsiType:int + ULiteralExpression (value = 7.0) [7.0] : PsiType:float + UMethod (name = objectLiteral) [public static final fun objectLiteral() : void {...}] + UBlockExpression [{...}] : PsiType: + UObjectLiteralExpression [anonymous object : Parent(b = 1, a = "foo") { }] : PsiType:Parent + ULiteralExpression (value = 1) [1] : PsiType:int + ULiteralExpression (value = "foo") ["foo"] : PsiType:String + 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 [{...}] : PsiType:void + 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/legacyTypes/ParametersDisorder.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/ParametersDisorder.types.fir.txt new file mode 100644 index 00000000000..6308bfa8367 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/ParametersDisorder.types.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)] + 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)] + UParameter (name = d) [var d: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] + 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)] + UMethod (name = call) [public static final fun call() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] + UMethod (name = objectLiteral) [public static final fun objectLiteral() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] + 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)] + 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/legacyTypes/ParametersWithDefaultValues.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/ParametersWithDefaultValues.types.fe10.txt new file mode 100644 index 00000000000..c3ca89eb589 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/ParametersWithDefaultValues.types.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] : PsiType:int + 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] : PsiType:boolean + UBlockExpression [{...}] : PsiType:void diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/ParametersWithDefaultValues.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/ParametersWithDefaultValues.types.fir.txt new file mode 100644 index 00000000000..d115dd2be4c --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/ParametersWithDefaultValues.types.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)] + UParameter (name = flag) [var flag: boolean = [!] UnknownKotlinExpression (BOOLEAN_CONSTANT)] + [!] UnknownKotlinExpression (BOOLEAN_CONSTANT) [[!] UnknownKotlinExpression (BOOLEAN_CONSTANT)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyAccessors.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyAccessors.types.fe10.txt new file mode 100644 index 00000000000..c01c5f6b466 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyAccessors.types.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 [{...}] + UReturnExpression [return this.toString()] + UQualifiedReferenceExpression [this.toString()] : PsiType:String + UThisExpression (label = null) [this] : PsiType:PropertyTest + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [toString()] : PsiType:String + UIdentifier (Identifier (toString)) [UIdentifier (Identifier (toString))] + USimpleNameReferenceExpression (identifier = toString, resolvesTo = null) [toString] : PsiType:String + 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 [{...}] : PsiType:void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [setDataFromString(value)] : PsiType:void + UIdentifier (Identifier (setDataFromString)) [UIdentifier (Identifier (setDataFromString))] + USimpleNameReferenceExpression (identifier = setDataFromString, resolvesTo = null) [setDataFromString] : PsiType:void + USimpleNameReferenceExpression (identifier = value) [value] : PsiType:String + 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 [{...}] : PsiType:void + UMethod (name = PropertyTest) [public fun PropertyTest() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyAccessors.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyAccessors.types.fir.txt new file mode 100644 index 00000000000..2cd0fc24839 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyAccessors.types.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)] + 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)] + 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)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyDelegate.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyDelegate.types.fe10.txt new file mode 100644 index 00000000000..38d975bb9ff --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyDelegate.types.fe10.txt @@ -0,0 +1,36 @@ +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({ ...})] : PsiType:Lazy + UIdentifier (Identifier (lazy)) [UIdentifier (Identifier (lazy))] + USimpleNameReferenceExpression (identifier = lazy, resolvesTo = null) [lazy] : PsiType:Lazy + ULambdaExpression [{ ...}] : PsiType:Function0 + UBlockExpression [{...}] + UReturnExpression [return "/sdcard"] + ULiteralExpression (value = "/sdcard") ["/sdcard"] : PsiType:String + 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({ ...})] : PsiType:Lazy + UIdentifier (Identifier (lazy)) [UIdentifier (Identifier (lazy))] + USimpleNameReferenceExpression (identifier = lazy, resolvesTo = null) [lazy] : PsiType:Lazy + ULambdaExpression [{ ...}] : PsiType:Function0 + UBlockExpression [{...}] + UReturnExpression [return 1 + 1] + UBinaryExpression (operator = +) [1 + 1] : PsiType:int + ULiteralExpression (value = 1) [1] : PsiType:int + ULiteralExpression (value = 1) [1] : PsiType:int + UMethod (name = getSdCardPath) [public static final fun getSdCardPath() : java.lang.String = UastEmptyExpression] + UMethod (name = localPropertyTest) [public static final fun localPropertyTest() : void {...}] + UBlockExpression [{...}] : PsiType:void + UDeclarationsExpression [var sdCardPathLocal: java.lang.String] + ULocalVariable (name = sdCardPathLocal) [var sdCardPathLocal: java.lang.String] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [lazy({ ...})] : PsiType:Lazy + UIdentifier (Identifier (lazy)) [UIdentifier (Identifier (lazy))] + USimpleNameReferenceExpression (identifier = lazy, resolvesTo = null) [lazy] : PsiType:Lazy + ULambdaExpression [{ ...}] : PsiType:Function0 + UBlockExpression [{...}] + UReturnExpression [return "/sdcard"] + ULiteralExpression (value = "/sdcard") ["/sdcard"] : PsiType:String + UMethod (name = getAnnotatedDelegate) [public static final fun getAnnotatedDelegate() : int = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyDelegate.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyDelegate.types.fir.txt new file mode 100644 index 00000000000..7b3660927db --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyDelegate.types.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)] + UMethod (name = getAnnotatedDelegate) [public static final fun getAnnotatedDelegate() : int = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyInitializer.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyInitializer.types.fe10.txt new file mode 100644 index 00000000000..501b4ce5f95 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyInitializer.types.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"] : PsiType:String + UMethod (name = getWithSetter) [public final fun getWithSetter() : java.lang.String {...}] + UBlockExpression [{...}] + UReturnExpression [return field] + USimpleNameReferenceExpression (identifier = field) [field] : PsiType:String + 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 [{...}] : PsiType:void + UBinaryExpression (operator = =) [field = p] : PsiType:void + USimpleNameReferenceExpression (identifier = field) [field] : PsiType:String + USimpleNameReferenceExpression (identifier = p) [p] : PsiType:String + UMethod (name = TestPropertyInitializer) [public fun TestPropertyInitializer() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyInitializer.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyInitializer.types.fir.txt new file mode 100644 index 00000000000..d2b84498171 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyInitializer.types.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)] + 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)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyInitializerWithoutSetter.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyInitializerWithoutSetter.types.fe10.txt new file mode 100644 index 00000000000..8aa3e9765f1 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyInitializerWithoutSetter.types.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"] : PsiType:String + UMethod (name = getWithoutSetter) [public static final fun getWithoutSetter() : java.lang.String {...}] + UBlockExpression [{...}] + UReturnExpression [return field] + USimpleNameReferenceExpression (identifier = field) [field] : PsiType:String + 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/legacyTypes/PropertyInitializerWithoutSetter.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyInitializerWithoutSetter.types.fir.txt new file mode 100644 index 00000000000..85e045f1dbe --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyInitializerWithoutSetter.types.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)] + UMethod (name = getWithoutSetter) [public static final fun getWithoutSetter() : java.lang.String = [!] UnknownKotlinExpression (REFERENCE_EXPRESSION)] + [!] UnknownKotlinExpression (REFERENCE_EXPRESSION) [[!] UnknownKotlinExpression (REFERENCE_EXPRESSION)] + 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/legacyTypes/PropertyReferences.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyReferences.types.fe10.txt new file mode 100644 index 00000000000..a54125781f0 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyReferences.types.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 [{...}] : PsiType:int + UDeclarationsExpression [var a: A = (17)] + ULocalVariable (name = a) [var a: A = (17)] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [(17)] : PsiType:A + UIdentifier (Identifier (A)) [UIdentifier (Identifier (A))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) [] : PsiType:A + ULiteralExpression (value = 17) [17] : PsiType:int + UDeclarationsExpression [var x: int = -a.mutableProp] + ULocalVariable (name = x) [var x: int = -a.mutableProp] + UPrefixExpression (operator = -) [-a.mutableProp] : PsiType:int + UQualifiedReferenceExpression [a.mutableProp] : PsiType:int + USimpleNameReferenceExpression (identifier = a) [a] : PsiType:A + USimpleNameReferenceExpression (identifier = mutableProp) [mutableProp] : PsiType:int + UBinaryExpression (operator = =) [a.mutableProp = 1] : PsiType:void + UQualifiedReferenceExpression [a.mutableProp] : PsiType:int + USimpleNameReferenceExpression (identifier = a) [a] : PsiType:A + USimpleNameReferenceExpression (identifier = mutableProp) [mutableProp] : PsiType:int + ULiteralExpression (value = 1) [1] : PsiType:int + UBinaryExpression (operator = +=) [a.mutableProp += x] : PsiType:void + UQualifiedReferenceExpression [a.mutableProp] : PsiType:int + USimpleNameReferenceExpression (identifier = a) [a] : PsiType:A + USimpleNameReferenceExpression (identifier = mutableProp) [mutableProp] : PsiType:int + USimpleNameReferenceExpression (identifier = x) [x] : PsiType:int + UPrefixExpression (operator = ++) [++a.mutableProp] : PsiType:int + UQualifiedReferenceExpression [a.mutableProp] : PsiType:int + USimpleNameReferenceExpression (identifier = a) [a] : PsiType:A + USimpleNameReferenceExpression (identifier = mutableProp) [mutableProp] : PsiType:int + UPostfixExpression (operator = --) [a.mutableProp--] : PsiType:int + UQualifiedReferenceExpression [a.mutableProp] : PsiType:int + USimpleNameReferenceExpression (identifier = a) [a] : PsiType:A + USimpleNameReferenceExpression (identifier = mutableProp) [mutableProp] : PsiType:int + 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 [{...}] : PsiType:int + UDeclarationsExpression [var x: int = -mutableProp] + ULocalVariable (name = x) [var x: int = -mutableProp] + UPrefixExpression (operator = -) [-mutableProp] : PsiType:int + USimpleNameReferenceExpression (identifier = mutableProp) [mutableProp] : PsiType:int + UBinaryExpression (operator = =) [mutableProp = 1] : PsiType:void + USimpleNameReferenceExpression (identifier = mutableProp) [mutableProp] : PsiType:int + ULiteralExpression (value = 1) [1] : PsiType:int + UBinaryExpression (operator = +=) [mutableProp += x] : PsiType:void + USimpleNameReferenceExpression (identifier = mutableProp) [mutableProp] : PsiType:int + USimpleNameReferenceExpression (identifier = x) [x] : PsiType:int + UPrefixExpression (operator = ++) [++mutableProp] : PsiType:int + USimpleNameReferenceExpression (identifier = mutableProp) [mutableProp] : PsiType:int + UPostfixExpression (operator = --) [mutableProp--] : PsiType:int + USimpleNameReferenceExpression (identifier = mutableProp) [mutableProp] : PsiType:int + 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] : PsiType:int + 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 [{...}] : PsiType:Void + UDeclarationsExpression [var result: int = privateProp] + ULocalVariable (name = result) [var result: int = privateProp] + USimpleNameReferenceExpression (identifier = privateProp) [privateProp] : PsiType:int + UBinaryExpression (operator = =) [privateProp = x] : PsiType:void + USimpleNameReferenceExpression (identifier = privateProp) [privateProp] : PsiType:int + USimpleNameReferenceExpression (identifier = x) [x] : PsiType:int + UReturnExpression [return privateProp] : PsiType:Void + USimpleNameReferenceExpression (identifier = privateProp) [privateProp] : PsiType:int + 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 [{...}] + UBlockExpression [{...}] : PsiType:void + UBinaryExpression (operator = =) [mutableProp = init] : PsiType:void + USimpleNameReferenceExpression (identifier = mutableProp) [mutableProp] : PsiType:int + USimpleNameReferenceExpression (identifier = init) [init] : PsiType:int diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyReferences.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyReferences.types.fir.txt new file mode 100644 index 00000000000..82770ba54d5 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyReferences.types.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)] + 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)] + UClass (name = A) [public final class A {...}] + UField (name = privateProp) [private var privateProp: int = [!] UnknownKotlinExpression (INTEGER_CONSTANT)] + [!] UnknownKotlinExpression (INTEGER_CONSTANT) [[!] UnknownKotlinExpression (INTEGER_CONSTANT)] + 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)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyWithAnnotation.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyWithAnnotation.types.fe10.txt new file mode 100644 index 00000000000..23f8286ed4c --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyWithAnnotation.types.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] : PsiType:int + 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] : PsiType:int + UMethod (name = getProp1) [public static final fun getProp1() : int = UastEmptyExpression] + UMethod (name = getProp2) [@TestAnnotation...}] + UAnnotation (fqName = TestAnnotation) [@TestAnnotation] + UBlockExpression [{...}] + UReturnExpression [return 0] + ULiteralExpression (value = 0) [0] : PsiType:int + UMethod (name = getProp3) [public static final fun getProp3() : int {...}] + UBlockExpression [{...}] + UReturnExpression [return 0] + ULiteralExpression (value = 0) [0] : PsiType:int + 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 [{...}] : PsiType:void + UBinaryExpression (operator = =) [field = value] : PsiType:void + USimpleNameReferenceExpression (identifier = field) [field] : PsiType:int + USimpleNameReferenceExpression (identifier = value) [value] : PsiType:int + UClass (name = TestAnnotation) [public abstract annotation TestAnnotation {...}] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyWithAnnotation.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyWithAnnotation.types.fir.txt new file mode 100644 index 00000000000..693a8fc7984 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/PropertyWithAnnotation.types.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)] + 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)] + UMethod (name = getProp3) [public static final fun getProp3() : int = [!] UnknownKotlinExpression (INTEGER_CONSTANT)] + [!] UnknownKotlinExpression (INTEGER_CONSTANT) [[!] UnknownKotlinExpression (INTEGER_CONSTANT)] + UMethod (name = setProp3) [public static final fun setProp3(value: int) : void = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = value) [var value: int] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] + UClass (name = TestAnnotation) [public abstract annotation TestAnnotation {...}] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/QualifiedConstructorCall.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/QualifiedConstructorCall.types.fe10.txt new file mode 100644 index 00000000000..97e8e5bb252 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/QualifiedConstructorCall.types.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 [{...}] : PsiType:Void + UReturnExpression [return A.B.C.()] : PsiType:Void + UQualifiedReferenceExpression [A.B.C.()] : PsiType:Foo + UQualifiedReferenceExpression [A.B.C] + UQualifiedReferenceExpression [A.B] + USimpleNameReferenceExpression (identifier = A) [A] + USimpleNameReferenceExpression (identifier = B) [B] + USimpleNameReferenceExpression (identifier = C) [C] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] : PsiType:Foo + UIdentifier (Identifier (Foo)) [UIdentifier (Identifier (Foo))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Foo) [] : PsiType:Foo + UMethod (name = Bar) [public fun Bar() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/QualifiedConstructorCall.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/QualifiedConstructorCall.types.fir.txt new file mode 100644 index 00000000000..cb3b7790d57 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/QualifiedConstructorCall.types.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)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/ReceiverFun.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/ReceiverFun.types.fe10.txt new file mode 100644 index 00000000000..46047ddfac3 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/ReceiverFun.types.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 [{...}] + UReturnExpression [return this.length] + UQualifiedReferenceExpression [this.length] : PsiType:int + UThisExpression (label = null) [this] : PsiType:String + USimpleNameReferenceExpression (identifier = length) [length] : PsiType:int + 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"] + ULiteralExpression (value = "RegExp") ["RegExp"] : PsiType:String + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UBlockExpression [{...}] : PsiType:Void + UReturnExpression [return toRegex()] : PsiType:Void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [toRegex()] : PsiType:Regex + UIdentifier (Identifier (toRegex)) [UIdentifier (Identifier (toRegex))] + USimpleNameReferenceExpression (identifier = toRegex, resolvesTo = null) [toRegex] : PsiType:Regex + UClass (name = MyReceiverAnnotation) [public abstract annotation MyReceiverAnnotation {...}] + UAnnotationMethod (name = name) [public abstract fun name() : java.lang.String = UastEmptyExpression] + ULiteralExpression (value = "") [""] : PsiType:String diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/ReceiverFun.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/ReceiverFun.types.fir.txt new file mode 100644 index 00000000000..20899369768 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/ReceiverFun.types.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)] + 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)] + 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/legacyTypes/Reified.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/Reified.types.fe10.txt new file mode 100644 index 00000000000..d99df89f11a --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/Reified.types.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 [{...}] + UReturnExpression [return (java.lang.String.java)] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [(java.lang.String.java)] + UIdentifier (Identifier (getSystemService)) [UIdentifier (Identifier (getSystemService))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] + UQualifiedReferenceExpression [java.lang.String.java] : PsiType:Class + UClassLiteralExpression [java.lang.String] : PsiType:KClass + USimpleNameReferenceExpression (identifier = java) [java] : PsiType:Class + 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 [{...}] + UReturnExpression [return (T.java)] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [(T.java)] + UIdentifier (Identifier (getSystemService)) [UIdentifier (Identifier (getSystemService))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] + UQualifiedReferenceExpression [T.java] : PsiType:Class + UClassLiteralExpression [T] : PsiType:KClass + USimpleNameReferenceExpression (identifier = java) [java] : PsiType:Class + UClass (name = Context) [public final class Context {...}] + UMethod (name = ownSystemService2) [public final fun ownSystemService2() : error.NonExistentClass {...}] + UBlockExpression [{...}] + UReturnExpression [return (java.lang.String.java)] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [(java.lang.String.java)] + UIdentifier (Identifier (getSystemService)) [UIdentifier (Identifier (getSystemService))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] + UQualifiedReferenceExpression [java.lang.String.java] : PsiType:Class + UClassLiteralExpression [java.lang.String] : PsiType:KClass + USimpleNameReferenceExpression (identifier = java) [java] : PsiType:Class + UMethod (name = Context) [public fun Context() = UastEmptyExpression] + UMethod (name = ownSystemService1) [fun ownSystemService1() : {...}] + UBlockExpression [{...}] + UReturnExpression [return (T.java)] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [(T.java)] + UIdentifier (Identifier (getSystemService)) [UIdentifier (Identifier (getSystemService))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] + UQualifiedReferenceExpression [T.java] : PsiType:Class + UClassLiteralExpression [T] : PsiType:KClass + USimpleNameReferenceExpression (identifier = java) [java] : PsiType:Class diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/Reified.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/Reified.types.fir.txt new file mode 100644 index 00000000000..97a55152fb2 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/Reified.types.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/legacyTypes/ReifiedParameters.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/ReifiedParameters.types.fe10.txt new file mode 100644 index 00000000000..eeffd317bf3 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/ReifiedParameters.types.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 [{...}] + UReturnExpression [return invoke(t)] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [invoke(t)] : PsiType:int + UIdentifier (Identifier (process)) [UIdentifier (Identifier (process))] + USimpleNameReferenceExpression (identifier = invoke, resolvesTo = null) [invoke] : PsiType:int + USimpleNameReferenceExpression (identifier = t) [t] : PsiType:T + 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 [{...}] + UReturnExpression [return t[0]] + UArrayAccessExpression [t[0]] : PsiType:T + USimpleNameReferenceExpression (identifier = t) [t] : PsiType:T[] + ULiteralExpression (value = 0) [0] : PsiType:int + 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 [{...}] + UReturnExpression [return this] + UThisExpression (label = null) [this] : PsiType:T + 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 [{...}] + UReturnExpression [return this] + UThisExpression (label = null) [this] : PsiType:T + 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"] + ULiteralExpression (value = "s") ["s"] : PsiType:String + UBlockExpression [{...}] + UReturnExpression [return t] + USimpleNameReferenceExpression (identifier = t) [t] : PsiType:T + 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"] + ULiteralExpression (value = "s") ["s"] : PsiType:String + UBlockExpression [{...}] + UReturnExpression [return t] + USimpleNameReferenceExpression (identifier = t) [t] : PsiType: diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/ReifiedParameters.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/ReifiedParameters.types.fir.txt new file mode 100644 index 00000000000..f3531fa5917 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/ReifiedParameters.types.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/legacyTypes/ReifiedResolve.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/ReifiedResolve.types.fe10.txt new file mode 100644 index 00000000000..dfe64427c92 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/ReifiedResolve.types.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 [{ ...}] : PsiType:Function1 + UBlockExpression [{...}] + UBlockExpression [{...}] : PsiType:Void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [TODO("message")] : PsiType:Void + UIdentifier (Identifier (TODO)) [UIdentifier (Identifier (TODO))] + USimpleNameReferenceExpression (identifier = TODO, resolvesTo = null) [TODO] : PsiType:Void + ULiteralExpression (value = "message") ["message"] : PsiType:String + UMethod (name = resolve) [public static final fun resolve() : void {...}] + UBlockExpression [{...}] : PsiType:void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [foo()] : PsiType:String + UIdentifier (Identifier (foo)) [UIdentifier (Identifier (foo))] + USimpleNameReferenceExpression (identifier = foo, resolvesTo = null) [foo] : PsiType:String + UDeclarationsExpression [var x: java.lang.String = foo()] + ULocalVariable (name = x) [var x: java.lang.String = foo()] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [foo()] : PsiType:String + UIdentifier (Identifier (foo)) [UIdentifier (Identifier (foo))] + USimpleNameReferenceExpression (identifier = foo, resolvesTo = null) [foo] : PsiType:String + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [bar()] : PsiType:String + UIdentifier (Identifier (bar)) [UIdentifier (Identifier (bar))] + USimpleNameReferenceExpression (identifier = bar, resolvesTo = null) [bar] : PsiType:String + UDeclarationsExpression [var y: java.lang.String = bar()] + ULocalVariable (name = y) [var y: java.lang.String = bar()] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [bar()] : PsiType:String + UIdentifier (Identifier (bar)) [UIdentifier (Identifier (bar))] + USimpleNameReferenceExpression (identifier = bar, resolvesTo = null) [bar] : PsiType:String + UDeclarationsExpression [var z: java.util.List = listOf("foo").filterIsInstance()] + ULocalVariable (name = z) [var z: java.util.List = listOf("foo").filterIsInstance()] + UQualifiedReferenceExpression [listOf("foo").filterIsInstance()] : PsiType:List + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [listOf("foo")] : PsiType:List + UIdentifier (Identifier (listOf)) [UIdentifier (Identifier (listOf))] + USimpleNameReferenceExpression (identifier = listOf, resolvesTo = null) [listOf] : PsiType:List + ULiteralExpression (value = "foo") ["foo"] : PsiType:String + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [filterIsInstance()] : PsiType:List + UIdentifier (Identifier (filterIsInstance)) [UIdentifier (Identifier (filterIsInstance))] + USimpleNameReferenceExpression (identifier = filterIsInstance, resolvesTo = null) [filterIsInstance] : PsiType:List + 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 [{ ...}] : PsiType:Function1 + UBlockExpression [{...}] + UBlockExpression [{...}] : PsiType:Void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [TODO("message")] : PsiType:Void + UIdentifier (Identifier (TODO)) [UIdentifier (Identifier (TODO))] + USimpleNameReferenceExpression (identifier = TODO, resolvesTo = null) [TODO] : PsiType:Void + ULiteralExpression (value = "message") ["message"] : PsiType:String diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/ReifiedResolve.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/ReifiedResolve.types.fir.txt new file mode 100644 index 00000000000..23cc13c7e03 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/ReifiedResolve.types.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)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/ReifiedReturnType.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/ReifiedReturnType.types.fe10.txt new file mode 100644 index 00000000000..6340bb620cc --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/ReifiedReturnType.types.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 [{...}] : PsiType:void + 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 [{...}] + UReturnExpression [return t] + USimpleNameReferenceExpression (identifier = t) [t] : PsiType:T + 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 [{...}] + UReturnExpression [return t] + USimpleNameReferenceExpression (identifier = t) [t] : PsiType:T + 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 [{...}] : PsiType:Void + UReturnExpression [return threshold2] : PsiType:Void + USimpleNameReferenceExpression (identifier = threshold2) [threshold2] : PsiType:B + 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 [{...}] : PsiType:void + 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 [{...}] + UReturnExpression [return t] + USimpleNameReferenceExpression (identifier = t) [t] : PsiType:T + 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 [{...}] + UReturnExpression [return 42] + ULiteralExpression (value = 42) [42] : PsiType:int + 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 [{...}] + UReturnExpression [return t] + USimpleNameReferenceExpression (identifier = t) [t] : PsiType:T + 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 [{...}] + UReturnExpression [return t] + USimpleNameReferenceExpression (identifier = t) [t] : PsiType:T + 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 [{...}] + UReturnExpression [return t] + USimpleNameReferenceExpression (identifier = t) [t] : PsiType:T + 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 [{...}] + UReturnExpression [return t] + USimpleNameReferenceExpression (identifier = t) [t] : PsiType:T + 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 [{...}] + UReturnExpression [return t] + USimpleNameReferenceExpression (identifier = t) [t] : PsiType:T + 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 [{...}] + UReturnExpression [return t] + USimpleNameReferenceExpression (identifier = t) [t] : PsiType:T + 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 [{...}] + UReturnExpression [return t] + USimpleNameReferenceExpression (identifier = t) [t] : PsiType:T + 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 [{...}] + UReturnExpression [return t] + USimpleNameReferenceExpression (identifier = t) [t] : PsiType:B + UClass (name = Foo) [public final class Foo {...}] + UMethod (name = Foo) [public fun Foo() = UastEmptyExpression] + UMethod (name = foo) [fun foo() : Z {...}] + UBlockExpression [{...}] : PsiType:Void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [TODO()] : PsiType:Void + UIdentifier (Identifier (TODO)) [UIdentifier (Identifier (TODO))] + USimpleNameReferenceExpression (identifier = TODO, resolvesTo = null) [TODO] : PsiType:Void diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/ReifiedReturnType.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/ReifiedReturnType.types.fir.txt new file mode 100644 index 00000000000..889f189981b --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/ReifiedReturnType.types.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)] + UClass (name = Foo) [public final class Foo {...}] + UMethod (name = Foo) [public fun Foo() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/Resolve.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/Resolve.types.fe10.txt new file mode 100644 index 00000000000..8695269f492 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/Resolve.types.fe10.txt @@ -0,0 +1,147 @@ +UFile (package = ) [public final class ResolveKt {...] + UClass (name = ResolveKt) [public final class ResolveKt {...}] + UMethod (name = bar) [public static final fun bar() : void {...}] + UBlockExpression [{...}] : PsiType:IntRange + UQualifiedReferenceExpression [().foo()] : PsiType:void + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] : PsiType:A + UIdentifier (Identifier (A)) [UIdentifier (Identifier (A))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) [] : PsiType:A + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [foo()] : PsiType:void + UIdentifier (Identifier (foo)) [UIdentifier (Identifier (foo))] + USimpleNameReferenceExpression (identifier = foo, resolvesTo = null) [foo] : PsiType:void + UQualifiedReferenceExpression [().inlineFoo()] : PsiType:void + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] : PsiType:A + UIdentifier (Identifier (A)) [UIdentifier (Identifier (A))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) [] : PsiType:A + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [inlineFoo()] : PsiType:void + UIdentifier (Identifier (inlineFoo)) [UIdentifier (Identifier (inlineFoo))] + USimpleNameReferenceExpression (identifier = inlineFoo, resolvesTo = null) [inlineFoo] : PsiType:void + UQualifiedReferenceExpression [listOf(()).forEach({ var it: A ->...})] : PsiType:void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [listOf(())] : PsiType:List + UIdentifier (Identifier (listOf)) [UIdentifier (Identifier (listOf))] + USimpleNameReferenceExpression (identifier = listOf, resolvesTo = null) [listOf] : PsiType:List + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] : PsiType:A + UIdentifier (Identifier (A)) [UIdentifier (Identifier (A))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) [] : PsiType:A + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [forEach({ var it: A ->...})] : PsiType:void + UIdentifier (Identifier (forEach)) [UIdentifier (Identifier (forEach))] + USimpleNameReferenceExpression (identifier = forEach, resolvesTo = null) [forEach] : PsiType:void + ULambdaExpression [{ var it: A ->...}] : PsiType:Function1 + UParameter (name = it) [var it: A] + UBlockExpression [{...}] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [println(it)] : PsiType:void + UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] + USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] : PsiType:void + USimpleNameReferenceExpression (identifier = it) [it] : PsiType:A + UQualifiedReferenceExpression [listOf("").joinToString()] : PsiType:String + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [listOf("")] : PsiType:List + UIdentifier (Identifier (listOf)) [UIdentifier (Identifier (listOf))] + USimpleNameReferenceExpression (identifier = listOf, resolvesTo = null) [listOf] : PsiType:List + ULiteralExpression (value = "") [""] : PsiType:String + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [joinToString()] : PsiType:String + UIdentifier (Identifier (joinToString)) [UIdentifier (Identifier (joinToString))] + USimpleNameReferenceExpression (identifier = joinToString, resolvesTo = null) [joinToString] : PsiType:String + UQualifiedReferenceExpression [listOf("").size] : PsiType:int + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [listOf("")] : PsiType:List + UIdentifier (Identifier (listOf)) [UIdentifier (Identifier (listOf))] + USimpleNameReferenceExpression (identifier = listOf, resolvesTo = null) [listOf] : PsiType:List + ULiteralExpression (value = "") [""] : PsiType:String + USimpleNameReferenceExpression (identifier = size) [size] : PsiType:int + UQualifiedReferenceExpression [listOf("").indices] : PsiType:IntRange + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [listOf("")] : PsiType:List + UIdentifier (Identifier (listOf)) [UIdentifier (Identifier (listOf))] + USimpleNameReferenceExpression (identifier = listOf, resolvesTo = null) [listOf] : PsiType:List + ULiteralExpression (value = "") [""] : PsiType:String + USimpleNameReferenceExpression (identifier = indices) [indices] : PsiType:IntRange + UDeclarationsExpression [var date: java.util.Date = java.util.()] + ULocalVariable (name = date) [var date: java.util.Date = java.util.()] + UQualifiedReferenceExpression [java.util.()] : PsiType:Date + UQualifiedReferenceExpression [java.util] + USimpleNameReferenceExpression (identifier = java) [java] + USimpleNameReferenceExpression (identifier = util) [util] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] : PsiType:Date + UIdentifier (Identifier (Date)) [UIdentifier (Identifier (Date))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Date) [] : PsiType:Date + UBinaryExpression (operator = =) [date.time = 1000] : PsiType:void + UQualifiedReferenceExpression [date.time] : PsiType:long + USimpleNameReferenceExpression (identifier = date) [date] : PsiType:Date + USimpleNameReferenceExpression (identifier = time) [time] : PsiType:long + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [setTime(1000)] + UIdentifier (Identifier (time)) [UIdentifier (Identifier (time))] + ULiteralExpression (value = 1000) [1000] : PsiType:long + ULiteralExpression (value = 1000) [1000] : PsiType:long + UQualifiedReferenceExpression [listOf("").last()] : PsiType:String + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [listOf("")] : PsiType:List + UIdentifier (Identifier (listOf)) [UIdentifier (Identifier (listOf))] + USimpleNameReferenceExpression (identifier = listOf, resolvesTo = null) [listOf] : PsiType:List + ULiteralExpression (value = "") [""] : PsiType:String + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [last()] : PsiType:String + UIdentifier (Identifier (last)) [UIdentifier (Identifier (last))] + USimpleNameReferenceExpression (identifier = last, resolvesTo = null) [last] : PsiType:String + UQualifiedReferenceExpression [mutableMapOf(1 "1").entries.first().setValue("123")] : PsiType:String + UQualifiedReferenceExpression [mutableMapOf(1 "1").entries.first()] : PsiType:Entry + UQualifiedReferenceExpression [mutableMapOf(1 "1").entries] : PsiType:Set> + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [mutableMapOf(1 "1")] : PsiType:Map + UIdentifier (Identifier (mutableMapOf)) [UIdentifier (Identifier (mutableMapOf))] + USimpleNameReferenceExpression (identifier = mutableMapOf, resolvesTo = null) [mutableMapOf] : PsiType:Map + UBinaryExpression (operator = ) [1 "1"] : PsiType:Pair + ULiteralExpression (value = 1) [1] : PsiType:int + ULiteralExpression (value = "1") ["1"] : PsiType:String + USimpleNameReferenceExpression (identifier = entries) [entries] : PsiType:Set> + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [first()] : PsiType:Entry + UIdentifier (Identifier (first)) [UIdentifier (Identifier (first))] + USimpleNameReferenceExpression (identifier = first, resolvesTo = null) [first] : PsiType:Entry + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [setValue("123")] : PsiType:String + UIdentifier (Identifier (setValue)) [UIdentifier (Identifier (setValue))] + USimpleNameReferenceExpression (identifier = setValue, resolvesTo = null) [setValue] : PsiType:String + ULiteralExpression (value = "123") ["123"] : PsiType:String + UDeclarationsExpression [var intRange: kotlin.ranges.LongRange = 0 .. 3] + ULocalVariable (name = intRange) [var intRange: kotlin.ranges.LongRange = 0 .. 3] + UBinaryExpression (operator = ..) [0 .. 3] : PsiType:LongRange + ULiteralExpression (value = 0) [0] : PsiType:long + ULiteralExpression (value = 3) [3] : PsiType:long + UQualifiedReferenceExpression [intRange.contains(2 as int)] : PsiType:boolean + USimpleNameReferenceExpression (identifier = intRange) [intRange] : PsiType:LongRange + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [contains(2 as int)] : PsiType:boolean + UIdentifier (Identifier (contains)) [UIdentifier (Identifier (contains))] + USimpleNameReferenceExpression (identifier = contains, resolvesTo = null) [contains] : PsiType:boolean + UBinaryExpressionWithType [2 as int] : PsiType:int + ULiteralExpression (value = 2) [2] : PsiType:int + UTypeReferenceExpression (name = int) [int] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 2)) [(1, 2)] : PsiType:IntRange + UIdentifier (Identifier (IntRange)) [UIdentifier (Identifier (IntRange))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: IntRange) [] : PsiType:IntRange + ULiteralExpression (value = 1) [1] : PsiType:int + ULiteralExpression (value = 2) [2] : PsiType:int + 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 [{...}] : PsiType:void + UQualifiedReferenceExpression [t.foo()] : PsiType:void + USimpleNameReferenceExpression (identifier = t) [t] : PsiType:T + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [foo()] : PsiType:void + UIdentifier (Identifier (foo)) [UIdentifier (Identifier (foo))] + USimpleNameReferenceExpression (identifier = foo, resolvesTo = null) [foo] : PsiType:void + 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 [{...}] : PsiType:void + UQualifiedReferenceExpression [listT.isEmpty()] : PsiType:boolean + USimpleNameReferenceExpression (identifier = listT) [listT] : PsiType:T + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [isEmpty()] : PsiType:boolean + UIdentifier (Identifier (isEmpty)) [UIdentifier (Identifier (isEmpty))] + USimpleNameReferenceExpression (identifier = isEmpty, resolvesTo = null) [isEmpty] : PsiType:boolean + UForEachExpression [for (a : listT) {...}] + USimpleNameReferenceExpression (identifier = listT) [listT] : PsiType:T + UBlockExpression [{...}] : PsiType:void + UQualifiedReferenceExpression [a.foo()] : PsiType:void + USimpleNameReferenceExpression (identifier = a) [a] : PsiType:A + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [foo()] : PsiType:void + UIdentifier (Identifier (foo)) [UIdentifier (Identifier (foo))] + USimpleNameReferenceExpression (identifier = foo, resolvesTo = null) [foo] : PsiType:void + UClass (name = A) [public class A {...}] + UMethod (name = foo) [public final fun foo() : void {...}] + UBlockExpression [{...}] : PsiType:void + UMethod (name = inlineFoo) [public final fun inlineFoo() : void {...}] + UBlockExpression [{...}] : PsiType:void + UMethod (name = A) [public fun A() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/Resolve.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/Resolve.types.fir.txt new file mode 100644 index 00000000000..4464b9deaa9 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/Resolve.types.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)] + UMethod (name = barT) [public static final fun barT(t: T) : void = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = t) [var t: T] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] + UMethod (name = barTL) [public static final fun barTL(listT: T) : void = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = listT) [var listT: T] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] + 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)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/SAM.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/SAM.types.fe10.txt new file mode 100644 index 00000000000..28d25058ab5 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/SAM.types.fe10.txt @@ -0,0 +1,126 @@ +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 [{ ...}] : PsiType:Function0 + UBlockExpression [{...}] + 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 [{ ...}] : PsiType:Function0 + UBlockExpression [{...}] + 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({ ...})] : PsiType:Runnable + UQualifiedReferenceExpression [java.lang] + USimpleNameReferenceExpression (identifier = java) [java] + USimpleNameReferenceExpression (identifier = lang) [lang] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [Runnable({ ...})] : PsiType:Runnable + UIdentifier (Identifier (Runnable)) [UIdentifier (Identifier (Runnable))] + USimpleNameReferenceExpression (identifier = Runnable, resolvesTo = PsiClass: Runnable) [Runnable] : PsiType:Runnable + ULambdaExpression [{ ...}] : PsiType:Function0 + UBlockExpression [{...}] + 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 [{...}] : PsiType:Void + UBinaryExpression (operator = =) [foo = { ...}] : PsiType:void + USimpleNameReferenceExpression (identifier = foo) [foo] : PsiType:Runnable + ULambdaExpression [{ ...}] : PsiType:Function0 + UBlockExpression [{...}] + UDeclarationsExpression [var a: java.lang.Runnable = { ...} as java.lang.Runnable] + ULocalVariable (name = a) [var a: java.lang.Runnable = { ...} as java.lang.Runnable] + UBinaryExpressionWithType [{ ...} as java.lang.Runnable] : PsiType:Runnable + ULambdaExpression [{ ...}] : PsiType:Function0 + UBlockExpression [{...}] + UTypeReferenceExpression (name = java.lang.Runnable) [java.lang.Runnable] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [runRunnable({ ...})] : PsiType: + UIdentifier (Identifier (runRunnable)) [UIdentifier (Identifier (runRunnable))] + USimpleNameReferenceExpression (identifier = runRunnable, resolvesTo = null) [runRunnable] : PsiType: + ULambdaExpression [{ ...}] : PsiType:Function0 + UBlockExpression [{...}] + UReturnExpression [return { ...}] : PsiType:Void + ULambdaExpression [{ ...}] : PsiType:Function0 + UBlockExpression [{...}] + 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 [{...}] + UReturnExpression [return ()] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [()] + UIdentifier (Identifier (r)) [UIdentifier (Identifier (r))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] + UMethod (name = test1) [public static final fun test1() : void {...}] + UBlockExpression [{...}] : PsiType:void + UDeclarationsExpression [var thread1: java.lang.Thread = ({ ...})] + ULocalVariable (name = thread1) [var thread1: java.lang.Thread = ({ ...})] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [({ ...})] : PsiType:Thread + UIdentifier (Identifier (Thread)) [UIdentifier (Identifier (Thread))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Thread) [] : PsiType:Thread + ULambdaExpression [{ ...}] : PsiType:Function0 + UBlockExpression [{...}] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [println("hello1")] : PsiType:void + UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] + USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] : PsiType:void + ULiteralExpression (value = "hello1") ["hello1"] : PsiType:String + UMethod (name = test2) [public static final fun test2() : void {...}] + UBlockExpression [{...}] : PsiType:void + UDeclarationsExpression [var thread2: java.lang.Thread = (Runnable({ ...}))] + ULocalVariable (name = thread2) [var thread2: java.lang.Thread = (Runnable({ ...}))] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [(Runnable({ ...}))] : PsiType:Thread + UIdentifier (Identifier (Thread)) [UIdentifier (Identifier (Thread))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Thread) [] : PsiType:Thread + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [Runnable({ ...})] : PsiType:Runnable + UIdentifier (Identifier (Runnable)) [UIdentifier (Identifier (Runnable))] + USimpleNameReferenceExpression (identifier = Runnable, resolvesTo = PsiClass: Runnable) [Runnable] : PsiType:Runnable + ULambdaExpression [{ ...}] : PsiType:Function0 + UBlockExpression [{...}] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [println("hello2")] : PsiType:void + UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] + USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] : PsiType:void + ULiteralExpression (value = "hello2") ["hello2"] : PsiType:String + UMethod (name = test3) [public static final fun test3() : void {...}] + UBlockExpression [{...}] : PsiType:String + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [ambiguousSamAcceptor(Supplier({ ...}))] : PsiType:String + UIdentifier (Identifier (ambiguousSamAcceptor)) [UIdentifier (Identifier (ambiguousSamAcceptor))] + USimpleNameReferenceExpression (identifier = ambiguousSamAcceptor, resolvesTo = null) [ambiguousSamAcceptor] : PsiType:String + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [Supplier({ ...})] : PsiType:Supplier + UIdentifier (Identifier (Supplier)) [UIdentifier (Identifier (Supplier))] + USimpleNameReferenceExpression (identifier = Supplier, resolvesTo = PsiClass: Supplier) [Supplier] : PsiType:Supplier + ULambdaExpression [{ ...}] : PsiType:Function0 + UBlockExpression [{...}] + UReturnExpression [return "Supplier"] + ULiteralExpression (value = "Supplier") ["Supplier"] : PsiType:String + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [ambiguousSamAcceptor(Callable({ ...}))] : PsiType:String + UIdentifier (Identifier (ambiguousSamAcceptor)) [UIdentifier (Identifier (ambiguousSamAcceptor))] + USimpleNameReferenceExpression (identifier = ambiguousSamAcceptor, resolvesTo = null) [ambiguousSamAcceptor] : PsiType:String + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [Callable({ ...})] : PsiType:Callable + UIdentifier (Identifier (Callable)) [UIdentifier (Identifier (Callable))] + USimpleNameReferenceExpression (identifier = Callable, resolvesTo = PsiClass: Callable) [Callable] : PsiType:Callable + ULambdaExpression [{ ...}] : PsiType:Function0 + UBlockExpression [{...}] + UReturnExpression [return "Callable"] + ULiteralExpression (value = "Callable") ["Callable"] : PsiType:String + 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 [{...}] + UReturnExpression [return TODO()] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [TODO()] : PsiType:Void + UIdentifier (Identifier (TODO)) [UIdentifier (Identifier (TODO))] + USimpleNameReferenceExpression (identifier = TODO, resolvesTo = null) [TODO] : PsiType:Void + 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 [{...}] + UReturnExpression [return TODO()] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [TODO()] : PsiType:Void + UIdentifier (Identifier (TODO)) [UIdentifier (Identifier (TODO))] + USimpleNameReferenceExpression (identifier = TODO, resolvesTo = null) [TODO] : PsiType:Void diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/SAM.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/SAM.types.fir.txt new file mode 100644 index 00000000000..9058f71dba5 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/SAM.types.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)] + UField (name = foo) [private static var foo: java.lang.Runnable = [!] UnknownKotlinExpression (LAMBDA_EXPRESSION)] + [!] UnknownKotlinExpression (LAMBDA_EXPRESSION) [[!] UnknownKotlinExpression (LAMBDA_EXPRESSION)] + UField (name = baz) [private static final var baz: java.lang.Runnable = [!] UnknownKotlinExpression (DOT_QUALIFIED_EXPRESSION)] + [!] UnknownKotlinExpression (DOT_QUALIFIED_EXPRESSION) [[!] UnknownKotlinExpression (DOT_QUALIFIED_EXPRESSION)] + 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)] + 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)] + UMethod (name = test1) [public static final fun test1() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] + UMethod (name = test2) [public static final fun test2() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] + UMethod (name = test3) [public static final fun test3() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] + 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)] + 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)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/Simple.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/Simple.types.fe10.txt new file mode 100644 index 00000000000..74a3cdf84f5 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/Simple.types.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"] : PsiType:String + UMethod (name = method) [public final fun method() : void {...}] + UBlockExpression [{...}] : PsiType:void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [println("Hello, world!")] : PsiType:void + UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] + USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] : PsiType:void + ULiteralExpression (value = "Hello, world!") ["Hello, world!"] : PsiType:String + 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/legacyTypes/Simple.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/Simple.types.fir.txt new file mode 100644 index 00000000000..8a4af8fef34 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/Simple.types.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)] + UMethod (name = Simple) [public fun Simple() = UastEmptyExpression] + UMethod (name = method) [public final fun method() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] + UMethod (name = getProperty) [public final fun getProperty() : java.lang.String = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/SimpleAnnotated.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/SimpleAnnotated.types.fe10.txt new file mode 100644 index 00000000000..1e865298398 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/SimpleAnnotated.types.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"] + ULiteralExpression (value = "1.0") ["1.0"] : PsiType:String + ULiteralExpression (value = "Mary") ["Mary"] : PsiType:String + UMethod (name = method) [@kotlin.Suppress(names = "abc")...}] + UAnnotation (fqName = kotlin.Suppress) [@kotlin.Suppress(names = "abc")] + UNamedExpression (name = names) [names = "abc"] + ULiteralExpression (value = "abc") ["abc"] : PsiType:String + UBlockExpression [{...}] : PsiType:void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [println("Hello, world!")] : PsiType:void + UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] + USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] : PsiType:void + ULiteralExpression (value = "Hello, world!") ["Hello, world!"] : PsiType:String + 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/legacyTypes/SimpleAnnotated.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/SimpleAnnotated.types.fir.txt new file mode 100644 index 00000000000..9b59ba343aa --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/SimpleAnnotated.types.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)] + UMethod (name = SimpleAnnotated) [public fun SimpleAnnotated() = UastEmptyExpression] + UMethod (name = method) [public final fun method() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] + UMethod (name = getProperty) [public final fun getProperty() : java.lang.String = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/StringTemplate.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/StringTemplate.types.fe10.txt new file mode 100644 index 00000000000..01a7d9cdde5 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/StringTemplate.types.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"] : PsiType:String + 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"] : PsiType:String + 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"] : PsiType:String + 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] : PsiType:String + USimpleNameReferenceExpression (identifier = foo) [foo] : PsiType:String + ULiteralExpression (value = " ") [" "] : PsiType:String + USimpleNameReferenceExpression (identifier = bar) [bar] : PsiType:String + ULiteralExpression (value = " ") [" "] : PsiType:String + USimpleNameReferenceExpression (identifier = baz) [baz] : PsiType:String + 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/legacyTypes/StringTemplate.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/StringTemplate.types.fir.txt new file mode 100644 index 00000000000..e4fd3e891a1 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/StringTemplate.types.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)] + UField (name = bar) [private static final var bar: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] + UField (name = baz) [private static final var baz: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] + UField (name = foobarbaz) [private static final var foobarbaz: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] + 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/legacyTypes/StringTemplateComplex.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/StringTemplateComplex.types.fe10.txt new file mode 100644 index 00000000000..a62d726cd84 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/StringTemplateComplex.types.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"] : PsiType:String + 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"] : PsiType:String + ULiteralExpression (value = "a ") ["a "] : PsiType:String + ULiteralExpression (value = "literal") ["literal"] : PsiType:String + ULiteralExpression (value = " z") [" z"] : PsiType:String + 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"] : PsiType:String + ULiteralExpression (value = "a ") ["a "] : PsiType:String + ULiteralExpression (value = "literal") ["literal"] : PsiType:String + ULiteralExpression (value = " ") [" "] : PsiType:String + ULiteralExpression (value = "literal") ["literal"] : PsiType:String + ULiteralExpression (value = " z") [" z"] : PsiType:String + 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"] : PsiType:String + ULiteralExpression (value = "a ") ["a "] : PsiType:String + UPolyadicExpression (operator = +) ["literal" + case4] : PsiType:String + ULiteralExpression (value = "literal") ["literal"] : PsiType:String + USimpleNameReferenceExpression (identifier = case4) [case4] : PsiType:String + ULiteralExpression (value = " z") [" z"] : PsiType:String + 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"] : PsiType:String + ULiteralExpression (value = "a ") ["a "] : PsiType:String + UQualifiedReferenceExpression ["literal" + case4.repeat(4)] : PsiType:String + UPolyadicExpression (operator = +) ["literal" + case4] : PsiType:String + ULiteralExpression (value = "literal") ["literal"] : PsiType:String + USimpleNameReferenceExpression (identifier = case4) [case4] : PsiType:String + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [repeat(4)] : PsiType:String + UIdentifier (Identifier (repeat)) [UIdentifier (Identifier (repeat))] + USimpleNameReferenceExpression (identifier = repeat, resolvesTo = null) [repeat] : PsiType:String + ULiteralExpression (value = 4) [4] : PsiType:int + ULiteralExpression (value = " z") [" z"] : PsiType:String + 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 = "") [""] : PsiType:String + 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] : PsiType:int + UBlockExpression [{...}] + UReturnExpression [return i] + USimpleNameReferenceExpression (identifier = i) [i] : PsiType:int + UMethod (name = foo) [public static final fun foo() : void {...}] + UBlockExpression [{...}] : PsiType:void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [println(baz)] : PsiType:void + UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] + USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] : PsiType:void + USimpleNameReferenceExpression (identifier = baz) [baz] + UDeclarationsExpression [var template1: java.lang.String = simpleForTemplate()] + ULocalVariable (name = template1) [var template1: java.lang.String = simpleForTemplate()] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [simpleForTemplate()] : PsiType:String + UIdentifier (Identifier (simpleForTemplate)) [UIdentifier (Identifier (simpleForTemplate))] + USimpleNameReferenceExpression (identifier = simpleForTemplate, resolvesTo = null) [simpleForTemplate] : PsiType:String + UDeclarationsExpression [var template2: java.lang.String = "." + simpleForTemplate()] + ULocalVariable (name = template2) [var template2: java.lang.String = "." + simpleForTemplate()] + UPolyadicExpression (operator = +) ["." + simpleForTemplate()] : PsiType:String + ULiteralExpression (value = ".") ["."] : PsiType:String + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [simpleForTemplate()] : PsiType:String + UIdentifier (Identifier (simpleForTemplate)) [UIdentifier (Identifier (simpleForTemplate))] + USimpleNameReferenceExpression (identifier = simpleForTemplate, resolvesTo = null) [simpleForTemplate] : PsiType:String diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/StringTemplateComplex.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/StringTemplateComplex.types.fir.txt new file mode 100644 index 00000000000..1cdb750340d --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/StringTemplateComplex.types.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)] + UField (name = case4) [private static final var case4: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] + UField (name = case5) [private static final var case5: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] + UField (name = literalInLiteral) [private static final var literalInLiteral: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] + UField (name = literalInLiteral2) [private static final var literalInLiteral2: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] + UField (name = empty) [private static final var empty: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] + 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)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] + UMethod (name = foo) [public static final fun foo() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/StringTemplateComplexForUInjectionHost.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/StringTemplateComplexForUInjectionHost.types.fe10.txt new file mode 100644 index 00000000000..d6afeeb2334 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/StringTemplateComplexForUInjectionHost.types.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"] : PsiType:String + 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"] : PsiType:String + ULiteralExpression (value = "a ") ["a "] : PsiType:String + ULiteralExpression (value = "literal") ["literal"] : PsiType:String + ULiteralExpression (value = " z") [" z"] : PsiType:String + 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"] : PsiType:String + ULiteralExpression (value = "a ") ["a "] : PsiType:String + ULiteralExpression (value = "literal") ["literal"] : PsiType:String + ULiteralExpression (value = " ") [" "] : PsiType:String + ULiteralExpression (value = "literal") ["literal"] : PsiType:String + ULiteralExpression (value = " z") [" z"] : PsiType:String + 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"] : PsiType:String + ULiteralExpression (value = "a ") ["a "] : PsiType:String + UPolyadicExpression (operator = +) ["literal" + case4] : PsiType:String + ULiteralExpression (value = "literal") ["literal"] : PsiType:String + USimpleNameReferenceExpression (identifier = case4) [case4] : PsiType:String + ULiteralExpression (value = " z") [" z"] : PsiType:String + 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"] : PsiType:String + ULiteralExpression (value = "a ") ["a "] : PsiType:String + UQualifiedReferenceExpression ["literal" + case4.repeat(4)] : PsiType:String + UPolyadicExpression (operator = +) ["literal" + case4] : PsiType:String + ULiteralExpression (value = "literal") ["literal"] : PsiType:String + USimpleNameReferenceExpression (identifier = case4) [case4] : PsiType:String + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [repeat(4)] : PsiType:String + UIdentifier (Identifier (repeat)) [UIdentifier (Identifier (repeat))] + USimpleNameReferenceExpression (identifier = repeat, resolvesTo = null) [repeat] : PsiType:String + ULiteralExpression (value = 4) [4] : PsiType:int + ULiteralExpression (value = " z") [" z"] : PsiType:String + 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 = "") [""] : PsiType:String + 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] : PsiType:int + UBlockExpression [{...}] + UReturnExpression [return i] + USimpleNameReferenceExpression (identifier = i) [i] : PsiType:int + UMethod (name = foo) [public static final fun foo() : void {...}] + UBlockExpression [{...}] : PsiType:void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [println(baz)] : PsiType:void + UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] + USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] : PsiType:void + USimpleNameReferenceExpression (identifier = baz) [baz] + UDeclarationsExpression [var template1: java.lang.String = simpleForTemplate()] + ULocalVariable (name = template1) [var template1: java.lang.String = simpleForTemplate()] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [simpleForTemplate()] : PsiType:String + UIdentifier (Identifier (simpleForTemplate)) [UIdentifier (Identifier (simpleForTemplate))] + USimpleNameReferenceExpression (identifier = simpleForTemplate, resolvesTo = null) [simpleForTemplate] : PsiType:String + UDeclarationsExpression [var template2: java.lang.String = "." + simpleForTemplate()] + ULocalVariable (name = template2) [var template2: java.lang.String = "." + simpleForTemplate()] + UPolyadicExpression (operator = +) ["." + simpleForTemplate()] : PsiType:String + ULiteralExpression (value = ".") ["."] : PsiType:String + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [simpleForTemplate()] : PsiType:String + UIdentifier (Identifier (simpleForTemplate)) [UIdentifier (Identifier (simpleForTemplate))] + USimpleNameReferenceExpression (identifier = simpleForTemplate, resolvesTo = null) [simpleForTemplate] : PsiType:String diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/StringTemplateComplexForUInjectionHost.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/StringTemplateComplexForUInjectionHost.types.fir.txt new file mode 100644 index 00000000000..109abc408b9 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/StringTemplateComplexForUInjectionHost.types.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)] + UField (name = case4) [private static final var case4: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] + UField (name = case5) [private static final var case5: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] + UField (name = literalInLiteral) [private static final var literalInLiteral: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] + UField (name = literalInLiteral2) [private static final var literalInLiteral2: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] + UField (name = empty) [private static final var empty: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] + 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)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] + UMethod (name = foo) [public static final fun foo() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/StringTemplateInClass.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/StringTemplateInClass.types.fe10.txt new file mode 100644 index 00000000000..7b033b1f446 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/StringTemplateInClass.types.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")] : PsiType: + USimpleNameReferenceExpression (identifier = X) [X] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [("lorem")] : PsiType: + UIdentifier (Identifier (bar)) [UIdentifier (Identifier (bar))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] : PsiType: + ULiteralExpression (value = "lorem") ["lorem"] : PsiType:String + 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/legacyTypes/StringTemplateInClass.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/StringTemplateInClass.types.fir.txt new file mode 100644 index 00000000000..6c2125cb21f --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/StringTemplateInClass.types.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)] + 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/legacyTypes/StringTemplateWithVar.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/StringTemplateWithVar.types.fe10.txt new file mode 100644 index 00000000000..ad5285830d2 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/StringTemplateWithVar.types.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"] : PsiType:String + 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] : PsiType:String + ULiteralExpression (value = "foo") ["foo"] : PsiType:String + USimpleNameReferenceExpression (identifier = bar) [bar] : PsiType:String + 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/legacyTypes/StringTemplateWithVar.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/StringTemplateWithVar.types.fir.txt new file mode 100644 index 00000000000..f1aac2765d9 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/StringTemplateWithVar.types.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)] + UField (name = f) [private static final var f: java.lang.String = [!] UnknownKotlinExpression (STRING_TEMPLATE)] + [!] UnknownKotlinExpression (STRING_TEMPLATE) [[!] UnknownKotlinExpression (STRING_TEMPLATE)] + 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/legacyTypes/SuperCalls.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/SuperCalls.types.fe10.txt new file mode 100644 index 00000000000..2f0d90cf0a0 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/SuperCalls.types.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") {...}] : PsiType:A + ULiteralExpression (value = "textForAnon") ["textForAnon"] : PsiType:String + UClass (name = null) [final class null : A {...}] + UMethod (name = bar) [public final fun bar() : void {...}] + UBlockExpression [{...}] : PsiType:void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [cons(anonymous object : A("inner literal") { })] : PsiType:void + UIdentifier (Identifier (cons)) [UIdentifier (Identifier (cons))] + USimpleNameReferenceExpression (identifier = cons, resolvesTo = null) [cons] : PsiType:void + UObjectLiteralExpression [anonymous object : A("inner literal") { }] : PsiType:A + ULiteralExpression (value = "inner literal") ["inner literal"] : PsiType:String + 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 [{...}] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [("inner class")] + UIdentifier (Identifier (A)) [UIdentifier (Identifier (A))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) [] + ULiteralExpression (value = "inner class") ["inner class"] : PsiType:String + 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 [{...}] : PsiType:void + 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 [{...}] : PsiType:void + 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 [{...}] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [(i.toString())] + UIdentifier (Identifier (this)) [UIdentifier (Identifier (this))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) [] + UQualifiedReferenceExpression [i.toString()] : PsiType:String + USimpleNameReferenceExpression (identifier = i) [i] : PsiType:int + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [toString()] : PsiType:String + UIdentifier (Identifier (toString)) [UIdentifier (Identifier (toString))] + USimpleNameReferenceExpression (identifier = toString, resolvesTo = null) [toString] : PsiType:String + 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 [{...}] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [(param)] + UIdentifier (Identifier (A)) [UIdentifier (Identifier (A))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) [] + USimpleNameReferenceExpression (identifier = param) [param] : PsiType:String + 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 [{...}] : PsiType:void + UQualifiedReferenceExpression [super.foo(a)] : PsiType:void + USuperExpression (label = null) [super] : PsiType:A + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [foo(a)] : PsiType:void + UIdentifier (Identifier (foo)) [UIdentifier (Identifier (foo))] + USimpleNameReferenceExpression (identifier = foo, resolvesTo = null) [foo] : PsiType:void + USimpleNameReferenceExpression (identifier = a) [a] : PsiType:long + 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 [{...}] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [(p)] + UIdentifier (Identifier (super)) [UIdentifier (Identifier (super))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) [] + USimpleNameReferenceExpression (identifier = p) [p] : PsiType:String + 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 [{...}] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [(i)] + UIdentifier (Identifier (super)) [UIdentifier (Identifier (super))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) [] + USimpleNameReferenceExpression (identifier = i) [i] : PsiType:int + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [println()] : PsiType:void + UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] + USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] : PsiType:void + 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 [{...}] + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [("text")] + UIdentifier (Identifier (A)) [UIdentifier (Identifier (A))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) [] + ULiteralExpression (value = "text") ["text"] : PsiType:String diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/SuperCalls.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/SuperCalls.types.fir.txt new file mode 100644 index 00000000000..87b753d88b1 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/SuperCalls.types.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)] + 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)] + 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)] + 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)] + UMethod (name = foo) [public fun foo(a: long) : void = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = a) [var a: long] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] + 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/legacyTypes/Suspend.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/Suspend.types.fe10.txt new file mode 100644 index 00000000000..22bd8d68759 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/Suspend.types.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 [{...}] + UReturnExpression [return ().inner()] + UQualifiedReferenceExpression [().inner()] : PsiType:int + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] : PsiType:Context + UIdentifier (Identifier (Context)) [UIdentifier (Identifier (Context))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Context) [] : PsiType:Context + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [inner()] : PsiType:int + UIdentifier (Identifier (inner)) [UIdentifier (Identifier (inner))] + USimpleNameReferenceExpression (identifier = inner, resolvesTo = null) [inner] : PsiType:int + 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 [{...}] + UReturnExpression [return suspendPrivate()] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [suspendPrivate()] : PsiType:int + UIdentifier (Identifier (suspendPrivate)) [UIdentifier (Identifier (suspendPrivate))] + USimpleNameReferenceExpression (identifier = suspendPrivate, resolvesTo = null) [suspendPrivate] : PsiType:int + 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 [{...}] + UReturnExpression [return inner()] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [inner()] : PsiType:int + UIdentifier (Identifier (inner)) [UIdentifier (Identifier (inner))] + USimpleNameReferenceExpression (identifier = inner, resolvesTo = null) [inner] : PsiType:int + UMethod (name = Context) [public fun Context() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/Suspend.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/Suspend.types.fir.txt new file mode 100644 index 00000000000..f18de62eeef --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/Suspend.types.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)] + 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)] + UMethod (name = suspendPrivate) [private final fun suspendPrivate() : int = [!] UnknownKotlinExpression (CALL_EXPRESSION)] + [!] UnknownKotlinExpression (CALL_EXPRESSION) [[!] UnknownKotlinExpression (CALL_EXPRESSION)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/TryCatch.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/TryCatch.types.fe10.txt new file mode 100644 index 00000000000..d7b494433f4 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/TryCatch.types.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 [{...}] : PsiType:void + UTryExpression [try {...}] : PsiType:void + UBlockExpression [{...}] : PsiType:void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [body()] : PsiType:void + UIdentifier (Identifier (body)) [UIdentifier (Identifier (body))] + USimpleNameReferenceExpression (identifier = body, resolvesTo = null) [body] : PsiType:void + 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 [{...}] : PsiType:void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [catcher()] : PsiType:void + UIdentifier (Identifier (catcher)) [UIdentifier (Identifier (catcher))] + USimpleNameReferenceExpression (identifier = catcher, resolvesTo = null) [catcher] : PsiType:void + UBlockExpression [{...}] : PsiType:void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [finalizer()] : PsiType:void + UIdentifier (Identifier (finalizer)) [UIdentifier (Identifier (finalizer))] + USimpleNameReferenceExpression (identifier = finalizer, resolvesTo = null) [finalizer] : PsiType:void + UMethod (name = body) [public final fun body() : void {...}] + UBlockExpression [{...}] : PsiType:void + UMethod (name = catcher) [public final fun catcher() : void {...}] + UBlockExpression [{...}] : PsiType:void + UMethod (name = finalizer) [public final fun finalizer() : void {...}] + UBlockExpression [{...}] : PsiType:void + 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"] + ULiteralExpression (value = "Something") ["Something"] : PsiType:String + UBlockExpression [{...}] : PsiType:void + UTryExpression [try {...}] : PsiType:void + UBlockExpression [{...}] : PsiType:void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [body()] : PsiType:void + UIdentifier (Identifier (body)) [UIdentifier (Identifier (body))] + USimpleNameReferenceExpression (identifier = body, resolvesTo = null) [body] : PsiType:void + 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"] + ULiteralExpression (value = "Something") ["Something"] : PsiType:String + UBlockExpression [{...}] : PsiType:void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [catcher()] : PsiType:void + UIdentifier (Identifier (catcher)) [UIdentifier (Identifier (catcher))] + USimpleNameReferenceExpression (identifier = catcher, resolvesTo = null) [catcher] : PsiType:void + UBlockExpression [{...}] : PsiType:void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [finalizer()] : PsiType:void + UIdentifier (Identifier (finalizer)) [UIdentifier (Identifier (finalizer))] + USimpleNameReferenceExpression (identifier = finalizer, resolvesTo = null) [finalizer] : PsiType:void + UMethod (name = body) [public final fun body() : void {...}] + UBlockExpression [{...}] : PsiType:void + UMethod (name = catcher) [public final fun catcher() : void {...}] + UBlockExpression [{...}] : PsiType:void + UMethod (name = finalizer) [public final fun finalizer() : void {...}] + UBlockExpression [{...}] : PsiType:void + UMethod (name = TryCatchAnnotations) [public fun TryCatchAnnotations() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/TryCatch.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/TryCatch.types.fir.txt new file mode 100644 index 00000000000..b93db698fec --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/TryCatch.types.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)] + UMethod (name = body) [public final fun body() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] + UMethod (name = catcher) [public final fun catcher() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] + UMethod (name = finalizer) [public final fun finalizer() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] + 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)] + UMethod (name = body) [public final fun body() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] + UMethod (name = catcher) [public final fun catcher() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] + UMethod (name = finalizer) [public final fun finalizer() : void = [!] UnknownKotlinExpression (BLOCK)] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/TypeAliasExpansionWithOtherAliasInArgument.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/TypeAliasExpansionWithOtherAliasInArgument.types.fe10.txt new file mode 100644 index 00000000000..237b29dfb2c --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/TypeAliasExpansionWithOtherAliasInArgument.types.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 [{...}] + UReturnExpression [return null] + ULiteralExpression (value = null) [null] : PsiType:Void + 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 [{...}] + UReturnExpression [return null] + ULiteralExpression (value = null) [null] : PsiType:Void diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/TypeAliasExpansionWithOtherAliasInArgument.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/TypeAliasExpansionWithOtherAliasInArgument.types.fir.txt new file mode 100644 index 00000000000..5f6f117d9e3 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/TypeAliasExpansionWithOtherAliasInArgument.types.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)] + 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)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/TypeAliases.types.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/TypeAliases.types.txt new file mode 100644 index 00000000000..3f63e5488fa --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/TypeAliases.types.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/legacyTypes/TypeInAnnotation.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/TypeInAnnotation.types.fe10.txt new file mode 100644 index 00000000000..25c20c217fe --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/TypeInAnnotation.types.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 [{...}] : PsiType:void + UMethod (name = C) [public fun C() = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/TypeInAnnotation.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/TypeInAnnotation.types.fir.txt new file mode 100644 index 00000000000..a4ea6fe39e3 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/TypeInAnnotation.types.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)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/TypeReferences.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/TypeReferences.types.fe10.txt new file mode 100644 index 00000000000..d91b72b51a6 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/TypeReferences.types.fe10.txt @@ -0,0 +1,72 @@ +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 [{...}] : PsiType:Void + UDeclarationsExpression [var varWithType: java.lang.String = "Not Null"] + ULocalVariable (name = varWithType) [var varWithType: java.lang.String = "Not Null"] + ULiteralExpression (value = "Not Null") ["Not Null"] : PsiType:String + UDeclarationsExpression [var varWithoutType: java.lang.String = "lorem ipsum"] + ULocalVariable (name = varWithoutType) [var varWithoutType: java.lang.String = "lorem ipsum"] + ULiteralExpression (value = "lorem ipsum") ["lorem ipsum"] : PsiType:String + UDeclarationsExpression [var result: java.lang.String = varWithType + varWithoutType] + ULocalVariable (name = result) [var result: java.lang.String = varWithType + varWithoutType] + UBinaryExpression (operator = +) [varWithType + varWithoutType] : PsiType:String + USimpleNameReferenceExpression (identifier = varWithType) [varWithType] : PsiType:String + USimpleNameReferenceExpression (identifier = varWithoutType) [varWithoutType] : PsiType:String + UReturnExpression [return result] : PsiType:Void + USimpleNameReferenceExpression (identifier = result) [result] : PsiType:String + 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 [{...}] : PsiType:void + UDeclarationsExpression [var a: T = arg] + ULocalVariable (name = a) [var a: T = arg] + USimpleNameReferenceExpression (identifier = arg) [arg] : PsiType:T + UDeclarationsExpression [var at: T = elvis {...}] + ULocalVariable (name = at) [var at: T = elvis {...}] + UExpressionList (elvis) [elvis {...}] : PsiType:T + UDeclarationsExpression [var var708e23eb: T = arg] + ULocalVariable (name = var708e23eb) [var var708e23eb: T = arg] + USimpleNameReferenceExpression (identifier = arg) [arg] : PsiType:T + UIfExpression [if (var708e23eb != null) var708e23eb else return] + UBinaryExpression (operator = !=) [var708e23eb != null] + USimpleNameReferenceExpression (identifier = var708e23eb) [var708e23eb] + ULiteralExpression (value = null) [null] + USimpleNameReferenceExpression (identifier = var708e23eb) [var708e23eb] + UReturnExpression [return] : PsiType:Void + UDeclarationsExpression [var tl: java.util.List = listOf(at)] + ULocalVariable (name = tl) [var tl: java.util.List = listOf(at)] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [listOf(at)] : PsiType:List + UIdentifier (Identifier (listOf)) [UIdentifier (Identifier (listOf))] + USimpleNameReferenceExpression (identifier = listOf, resolvesTo = null) [listOf] : PsiType:List + USimpleNameReferenceExpression (identifier = at) [at] : PsiType:T + UDeclarationsExpression [var tsl: java.util.List = tl.map({ var it: T ->...})] + ULocalVariable (name = tsl) [var tsl: java.util.List = tl.map({ var it: T ->...})] + UQualifiedReferenceExpression [tl.map({ var it: T ->...})] : PsiType:List + USimpleNameReferenceExpression (identifier = tl) [tl] : PsiType:List + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [map({ var it: T ->...})] : PsiType:List + UIdentifier (Identifier (map)) [UIdentifier (Identifier (map))] + USimpleNameReferenceExpression (identifier = map, resolvesTo = null) [map] : PsiType:List + ULambdaExpression [{ var it: T ->...}] : PsiType:Function1 + UParameter (name = it) [var it: T] + UBlockExpression [{...}] + UReturnExpression [return it.toString()] + UQualifiedReferenceExpression [it.toString()] : PsiType:String + USimpleNameReferenceExpression (identifier = it) [it] : PsiType:T + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [toString()] : PsiType:String + UIdentifier (Identifier (toString)) [UIdentifier (Identifier (toString))] + USimpleNameReferenceExpression (identifier = toString, resolvesTo = null) [toString] : PsiType:String + UDeclarationsExpression [var lls: java.util.List>] + ULocalVariable (name = lls) [var lls: java.util.List>] + UDeclarationsExpression [var llsAliased: java.util.List>] + ULocalVariable (name = llsAliased) [var llsAliased: java.util.List>] + UDeclarationsExpression [var llt: java.util.List>] + ULocalVariable (name = llt) [var llt: java.util.List>] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [parameterizedFoo(emptyList())] : PsiType:void + UIdentifier (Identifier (parameterizedFoo)) [UIdentifier (Identifier (parameterizedFoo))] + USimpleNameReferenceExpression (identifier = parameterizedFoo, resolvesTo = null) [parameterizedFoo] : PsiType:void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [emptyList()] : PsiType:List + UIdentifier (Identifier (emptyList)) [UIdentifier (Identifier (emptyList))] + USimpleNameReferenceExpression (identifier = emptyList, resolvesTo = null) [emptyList] : PsiType:List diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/TypeReferences.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/TypeReferences.types.fir.txt new file mode 100644 index 00000000000..856b87831e8 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/TypeReferences.types.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)] + UMethod (name = parameterizedFoo) [public static final fun parameterizedFoo(arg: T) : void = [!] UnknownKotlinExpression (BLOCK)] + UParameter (name = arg) [var arg: T] + [!] UnknownKotlinExpression (BLOCK) [[!] UnknownKotlinExpression (BLOCK)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/UnexpectedContainerException.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/UnexpectedContainerException.types.fe10.txt new file mode 100644 index 00000000000..91932fd4320 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/UnexpectedContainerException.types.fe10.txt @@ -0,0 +1,40 @@ +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 [{...}] : PsiType:Void + UThrowExpression [throw ()] : PsiType:Void + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] : PsiType:UnsupportedOperationException + UIdentifier (Identifier (UnsupportedOperationException)) [UIdentifier (Identifier (UnsupportedOperationException))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: UnsupportedOperationException) [] : PsiType:UnsupportedOperationException + UMethod (name = Model) [public fun Model() {...}] + UBlockExpression [{...}] + UBlockExpression [{...}] : PsiType:void + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 2)) [crashMe(Callback.java, { ...})] : PsiType:void + UIdentifier (Identifier (crashMe)) [UIdentifier (Identifier (crashMe))] + USimpleNameReferenceExpression (identifier = crashMe, resolvesTo = null) [crashMe] : PsiType:void + UQualifiedReferenceExpression [Callback.java] : PsiType:Class + UClassLiteralExpression [Callback] : PsiType:KClass + USimpleNameReferenceExpression (identifier = java) [java] : PsiType:Class + ULambdaExpression [{ ...}] : PsiType:Function0 + UBlockExpression [{...}] + UReturnExpression [return anonymous object : Callback {... }] + UObjectLiteralExpression [anonymous object : Callback {... }] : PsiType:Callback + 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 [{...}] : PsiType:Void + UThrowExpression [throw ("")] : PsiType:Void + UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [("")] : PsiType:UnsupportedOperationException + UIdentifier (Identifier (UnsupportedOperationException)) [UIdentifier (Identifier (UnsupportedOperationException))] + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: UnsupportedOperationException) [] : PsiType:UnsupportedOperationException + ULiteralExpression (value = "") [""] : PsiType:String + UMethod (name = ) [private fun () = UastEmptyExpression] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/UnexpectedContainerException.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/UnexpectedContainerException.types.fir.txt new file mode 100644 index 00000000000..36c1279ecf3 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/UnexpectedContainerException.types.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)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/WhenAndDestructing.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/WhenAndDestructing.types.fe10.txt new file mode 100644 index 00000000000..d4db6c73e35 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/WhenAndDestructing.types.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 [{...}] : PsiType:void + UDeclarationsExpression [var arr: java.util.List = listOf("1", "2")] + ULocalVariable (name = arr) [var arr: java.util.List = listOf("1", "2")] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 2)) [listOf("1", "2")] : PsiType:List + UIdentifier (Identifier (listOf)) [UIdentifier (Identifier (listOf))] + USimpleNameReferenceExpression (identifier = listOf, resolvesTo = null) [listOf] : PsiType:List + ULiteralExpression (value = "1") ["1"] : PsiType:String + ULiteralExpression (value = "2") ["2"] : PsiType:String + USwitchExpression [switch (string) {...] : PsiType:void + USimpleNameReferenceExpression (identifier = string) [string] : PsiType:String + UExpressionList (when) [ "aaaa" -> {... ] : PsiType:void + USwitchClauseExpressionWithBody ["aaaa" -> {...] + ULiteralExpression (value = "aaaa") ["aaaa"] : PsiType:String + UExpressionList (when_entry) [{...] + UYieldExpression [yield return "bindingContext"] + UReturnExpression [return "bindingContext"] : PsiType:Void + ULiteralExpression (value = "bindingContext") ["bindingContext"] : PsiType:String + USwitchClauseExpressionWithBody ["empty-switch" -> {...] + ULiteralExpression (value = "empty-switch") ["empty-switch"] : PsiType:String + UExpressionList (when_entry) [{...] + USwitchClauseExpressionWithBody [ -> {...] + UExpressionList (when_entry) [{...] + UDeclarationsExpression [@null var var837f2350: = arr...@null var statementFilter: java.lang.String = var837f2350.()] + ULocalVariable (name = var837f2350) [@null var var837f2350: = arr] + UAnnotation (fqName = null) [@null] + USimpleNameReferenceExpression (identifier = arr) [arr] : PsiType:List + ULocalVariable (name = bindingContext) [@null var bindingContext: java.lang.String = var837f2350.()] + UAnnotation (fqName = null) [@null] + UQualifiedReferenceExpression [var837f2350.()] + USimpleNameReferenceExpression (identifier = var837f2350) [var837f2350] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [()] + UIdentifier (Identifier (component1)) [UIdentifier (Identifier (component1))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] + ULocalVariable (name = statementFilter) [@null var statementFilter: java.lang.String = var837f2350.()] + UAnnotation (fqName = null) [@null] + UQualifiedReferenceExpression [var837f2350.()] + USimpleNameReferenceExpression (identifier = var837f2350) [var837f2350] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [()] + UIdentifier (Identifier (component2)) [UIdentifier (Identifier (component2))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] + UYieldExpression [yield return bindingContext] + UReturnExpression [return bindingContext] : PsiType:Void + USimpleNameReferenceExpression (identifier = bindingContext) [bindingContext] : PsiType:String diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/WhenAndDestructing.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/WhenAndDestructing.types.fir.txt new file mode 100644 index 00000000000..f2635f9ae45 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/WhenAndDestructing.types.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)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/WhenIs.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/WhenIs.types.fe10.txt new file mode 100644 index 00000000000..a27703f45ac --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/WhenIs.types.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 [{...}] + UReturnExpression [return switch (bar) {...] + USwitchExpression [switch (bar) {...] : PsiType:String + USimpleNameReferenceExpression (identifier = bar) [bar] : PsiType:Object + UExpressionList (when) [ it is java.lang.String -> {... ] : PsiType:String + USwitchClauseExpressionWithBody [it is java.lang.String -> {...] + UBinaryExpressionWithType [it is java.lang.String] + USimpleNameReferenceExpression (identifier = it) [it] + UTypeReferenceExpression (name = java.lang.String) [java.lang.String] + UExpressionList (when_entry) [{...] + UYieldExpression [yield bar] + USimpleNameReferenceExpression (identifier = bar) [bar] : PsiType:Object + USwitchClauseExpressionWithBody [it !is java.lang.String -> {...] + UBinaryExpressionWithType [it !is java.lang.String] + USimpleNameReferenceExpression (identifier = it) [it] + UTypeReferenceExpression (name = java.lang.String) [java.lang.String] + UExpressionList (when_entry) [{...] + UYieldExpression [yield ""] + ULiteralExpression (value = "") [""] : PsiType:String diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/WhenIs.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/WhenIs.types.fir.txt new file mode 100644 index 00000000000..4631fab7724 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/WhenIs.types.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)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/WhenStringLiteral.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/WhenStringLiteral.types.fe10.txt new file mode 100644 index 00000000000..0f01e2392b4 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/WhenStringLiteral.types.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()] : PsiType:String + UIdentifier (Identifier (readLine)) [UIdentifier (Identifier (readLine))] + USimpleNameReferenceExpression (identifier = readLine, resolvesTo = null) [readLine] : PsiType:String + 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) {...] : PsiType:int + USimpleNameReferenceExpression (identifier = a) [a] : PsiType:String + UExpressionList (when) [ "abc" -> {... ] : PsiType:int + USwitchClauseExpressionWithBody ["abc" -> {...] + ULiteralExpression (value = "abc") ["abc"] : PsiType:String + UExpressionList (when_entry) [{...] + UYieldExpression [yield 1] + ULiteralExpression (value = 1) [1] : PsiType:int + USwitchClauseExpressionWithBody ["def", "ghi" -> {...] + ULiteralExpression (value = "def") ["def"] : PsiType:String + ULiteralExpression (value = "ghi") ["ghi"] : PsiType:String + UExpressionList (when_entry) [{...] + UYieldExpression [yield 2] + ULiteralExpression (value = 2) [2] : PsiType:int + USwitchClauseExpressionWithBody [ -> {...] + UExpressionList (when_entry) [{...] + UYieldExpression [yield 3] + ULiteralExpression (value = 3) [3] : PsiType:int + 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 [{...}] : PsiType:String + ULiteralExpression (value = "abc1") ["abc1"] : PsiType:String + ULiteralExpression (value = "def1") ["def1"] : PsiType:String diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/WhenStringLiteral.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/WhenStringLiteral.types.fir.txt new file mode 100644 index 00000000000..059ef3dbe4a --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/WhenStringLiteral.types.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)] + UField (name = b) [private static final var b: int = [!] UnknownKotlinExpression (WHEN)] + [!] UnknownKotlinExpression (WHEN) [[!] UnknownKotlinExpression (WHEN)] + 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)] diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/ea101715.types.fe10.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/ea101715.types.fe10.txt new file mode 100644 index 00000000000..d39bc1f5588 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/ea101715.types.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 [{...}] : PsiType:void + UDeclarationsExpression [var a: = (555)] + ULocalVariable (name = a) [var a: = (555)] + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [(555)] + UIdentifier (Identifier (Obj)) [UIdentifier (Identifier (Obj))] + USimpleNameReferenceExpression (identifier = , resolvesTo = null) [] + ULiteralExpression (value = 555) [555] : PsiType:int + 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/legacyTypes/ea101715.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/ea101715.types.fir.txt new file mode 100644 index 00000000000..20d336ab7a9 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/ea101715.types.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)] + 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/FirLegacyUastTypesTestBase.kt b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/common/kotlin/FirLegacyUastTypesTestBase.kt new file mode 100644 index 00000000000..a37814a8ea6 --- /dev/null +++ b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/common/kotlin/FirLegacyUastTypesTestBase.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 FirLegacyUastTypesTestBase : FirUastTypesTestBase { + 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/legacyTypes/... + val revisedFilePath = + filePath.replace("uast-kotlin", "uast-kotlin-fir").replace("testData", "testData/legacyTypes") + return super.getTestMetadataFileFromPath(revisedFilePath, ext) + } +} diff --git a/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/common/kotlin/FirUastTypesTestBase.kt b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/common/kotlin/FirUastTypesTestBase.kt new file mode 100644 index 00000000000..6a38ed8fd8b --- /dev/null +++ b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/common/kotlin/FirUastTypesTestBase.kt @@ -0,0 +1,36 @@ +/* + * 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.uast.UFile +import org.jetbrains.uast.test.common.kotlin.FirUastTestSuffix.TXT +import java.io.File + +interface FirUastTypesTestBase : FirUastPluginSelection, FirUastFileComparisonTestBase { + private fun getTypesFile(filePath: String, suffix: String): File = getTestMetadataFileFromPath(filePath, "types$suffix") + + private fun getIdenticalTypesFile(filePath: String): File = getTypesFile(filePath, TXT) + + private fun getPluginTypesFile(filePath: String): File { + val identicalFile = getIdenticalTypesFile(filePath) + if (identicalFile.exists()) return identicalFile + return getTypesFile(filePath, "$pluginSuffix$TXT") + } + + fun check(filePath: String, file: UFile) { + val typesFile = getPluginTypesFile(filePath) + + KotlinTestUtils.assertEqualsToFile(typesFile, file.asLogTypes()) + + cleanUpIdenticalFile( + typesFile, + getTypesFile(filePath, "$counterpartSuffix$TXT"), + getIdenticalTypesFile(filePath), + kind = "types" + ) + } +} diff --git a/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/AbstractFE1LegacyUastTypesTest.kt b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/AbstractFE1LegacyUastTypesTest.kt new file mode 100644 index 00000000000..4fa2e47589b --- /dev/null +++ b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/AbstractFE1LegacyUastTypesTest.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.FirLegacyUastTypesTestBase + +abstract class AbstractFE1LegacyUastTypesTest : AbstractFE1UastTypesTest(), FirLegacyUastTypesTestBase diff --git a/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/AbstractFE1UastTypesTest.kt b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/AbstractFE1UastTypesTest.kt new file mode 100644 index 00000000000..c9b60970e56 --- /dev/null +++ b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/AbstractFE1UastTypesTest.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.FirUastTypesTestBase +import java.io.File + +abstract class AbstractFE1UastTypesTest : AbstractKotlinUastTest(), FirUastTypesTestBase { + 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 = File(filePath).nameWithoutExtension + 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/AbstractFirLegacyUastTypesTest.kt b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/AbstractFirLegacyUastTypesTest.kt new file mode 100644 index 00000000000..62ec62855f4 --- /dev/null +++ b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/AbstractFirLegacyUastTypesTest.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.FirLegacyUastTypesTestBase + +abstract class AbstractFirLegacyUastTypesTest : AbstractFirUastTypesTest(), FirLegacyUastTypesTestBase diff --git a/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/AbstractFirUastTypesTest.kt b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/AbstractFirUastTypesTest.kt new file mode 100644 index 00000000000..eb0ecf91e01 --- /dev/null +++ b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/AbstractFirUastTypesTest.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.FirUastTypesTestBase +import org.jetbrains.uast.test.env.kotlin.AbstractFirUastTest + +abstract class AbstractFirUastTypesTest : AbstractFirUastTest(), FirUastTypesTestBase { + 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/FE1LegacyUastTypesTestGenerated.java b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/FE1LegacyUastTypesTestGenerated.java new file mode 100644 index 00000000000..eb7e771aa17 --- /dev/null +++ b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/FE1LegacyUastTypesTestGenerated.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 FE1LegacyUastTypesTestGenerated extends AbstractFE1LegacyUastTypesTest { + 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/FirLegacyUastTypesTestGenerated.java b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/FirLegacyUastTypesTestGenerated.java new file mode 100644 index 00000000000..3f88a1c7370 --- /dev/null +++ b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/FirLegacyUastTypesTestGenerated.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 FirLegacyUastTypesTestGenerated extends AbstractFirLegacyUastTypesTest { + 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"); + } +}