diff --git a/compiler/tests-spec/testData/codegen/box/templates/_layout/linkedTestsLayout.kt b/compiler/tests-spec/testData/codegen/box/templates/_layout/linkedTestsLayout.kt new file mode 100644 index 00000000000..25b9e3e2344 --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/templates/_layout/linkedTestsLayout.kt @@ -0,0 +1,10 @@ +/* + KOTLIN CODEGEN BOX SPEC TEST () + + SECTIONS: + PARAGRAPH: + SENTENCE: [] + NUMBER: + DESCRIPTION: + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/templates/_layout/notLinkedTestsLayout.kt b/compiler/tests-spec/testData/codegen/box/templates/_layout/notLinkedTestsLayout.kt new file mode 100644 index 00000000000..4621eb4f9f7 --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/templates/_layout/notLinkedTestsLayout.kt @@ -0,0 +1,9 @@ +/* + KOTLIN NOT LINKED CODEGEN BOX SPEC TEST () + + SECTION: + CATEGORIES: + NUMBER: + DESCRIPTION: + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/templates/identifiers/atomicExpression.kt b/compiler/tests-spec/testData/codegen/box/templates/identifiers/atomicExpression.kt new file mode 100644 index 00000000000..13f5a3de296 --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/templates/identifiers/atomicExpression.kt @@ -0,0 +1,20 @@ +fun box(): String? { + val = 10 + val = "." + + val value_1 = - 100 % + val value_2 = .dec() + val value_3 = "$ 10" + val value_4 = "${}" + val value_5 = + " 11..." + + "1" + val value_6 = + + if (value_1 != 10) return null + if (value_2 != 9) return null + if (value_3 != ". 10") return null + if (value_4 != ".") return null + if (value_5 != ". 11....1") return null + if (value_6 != 10) return null + + return "OK" +} \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/templates/identifiers/callableReference.kt b/compiler/tests-spec/testData/codegen/box/templates/identifiers/callableReference.kt new file mode 100644 index 00000000000..74a19086294 --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/templates/identifiers/callableReference.kt @@ -0,0 +1,27 @@ + + +val Boolean.: Boolean + get() { + return true + } + +val Boolean?.: Boolean + get() { + return false + } + +fun Int?.(x: Boolean): Boolean { + return !x +} + +fun box(): String? { + if (!false. || false. || !0.(false)) return null + + if (!checkCallableName(Boolean::, "") || !Boolean::.get(true)) return null + if (!checkCallableName(Boolean????::, "") || Boolean????::.get(false)) return null + if (!checkCallableName(Boolean????::::equals.call(false)::, "") + || !Boolean????::::equals.call(false)::.get()) return null + if (!checkCallableName(Int?::, "") || Int?::.call(10, true)) return null + + return "OK" +} diff --git a/compiler/tests-spec/testData/codegen/box/templates/identifiers/catchBlock.kt b/compiler/tests-spec/testData/codegen/box/templates/identifiers/catchBlock.kt new file mode 100644 index 00000000000..24f618bc55b --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/templates/identifiers/catchBlock.kt @@ -0,0 +1,22 @@ +annotation class A + +fun box(): String? { + var value_1 = false + var value_2 = true + + try { + throw Exception() + } catch (: Throwable) { + value_1 = true + } + + try { + throw Exception() + } catch (@A : Throwable) { + value_2 = false + } + + if (!value_1 || value_2) return null + + return "OK" +} \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/templates/identifiers/class.kt b/compiler/tests-spec/testData/codegen/box/templates/identifiers/class.kt new file mode 100644 index 00000000000..8387341533e --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/templates/identifiers/class.kt @@ -0,0 +1,33 @@ + + +open class { + val x1 = true +} + +internal open class A: () { + val x2 = false +} + +annotation class (val x2: Boolean) + +@(false) internal class B: @(false) A() {} + +@(true) interface C + +fun box(): String? { + val o1 = () + val o2 = A() + val o3 = B() + + if (o1.x1 != true) return null + if (o2.x1 != true || o2.x2 != false || o3.x2 != false || o3.x1 != true) return null + + if (!checkAnnotation("B", "")) return null + if (!checkAnnotation("C", "")) return null + if (!checkSuperClass(B::class, "A")) return null + if (!checkSuperTypeAnnotation(B::class, "A", "")) return null + if (!checkClassName(::class, "")) return null + if (!checkClassName(::class, "")) return null + + return "OK" +} \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/templates/identifiers/companionObject.kt b/compiler/tests-spec/testData/codegen/box/templates/identifiers/companionObject.kt new file mode 100644 index 00000000000..c8a958119cb --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/templates/identifiers/companionObject.kt @@ -0,0 +1,22 @@ + + +package org.jetbrains. + +open class A { + companion object { + + } +} + +class B { + companion object : A() { + + } +} + +fun box(): String? { + if (!checkCompanionObjectName(A::class, "org.jetbrains..A.")) return null + if (!checkCompanionObjectName(B::class, "org.jetbrains..B.")) return null + + return "OK" +} diff --git a/compiler/tests-spec/testData/codegen/box/templates/identifiers/enumEntry.kt b/compiler/tests-spec/testData/codegen/box/templates/identifiers/enumEntry.kt new file mode 100644 index 00000000000..39c11a160ab --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/templates/identifiers/enumEntry.kt @@ -0,0 +1,14 @@ +enum class A(val x: Boolean) { + (false), + (true); +} + +fun box(): String? { + if (A..x) return null + if (!A..x) return null + + if (A..name != "") return null + if (A..name != "") return null + + return "OK" +} \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/templates/identifiers/fileAnnotationComplex.kt b/compiler/tests-spec/testData/codegen/box/templates/identifiers/fileAnnotationComplex.kt new file mode 100644 index 00000000000..2a75a1d34fb --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/templates/identifiers/fileAnnotationComplex.kt @@ -0,0 +1,19 @@ + + +@file:[org.jetbrains..() ] + +package org.jetbrains. + +@Target(AnnotationTarget.FILE) +annotation class + +@Target(AnnotationTarget.FILE) +annotation class + +fun box(): String? { + if (!checkFileAnnotations("org.jetbrains..", listOf("org.jetbrains..", ""))) return null + if (!checkPackageName("org.jetbrains..", "org.jetbrains.")) return null + if (!checkClassName(::class, "org.jetbrains..")) return null + + return "OK" +} diff --git a/compiler/tests-spec/testData/codegen/box/templates/identifiers/fileAnnotationSimple.kt b/compiler/tests-spec/testData/codegen/box/templates/identifiers/fileAnnotationSimple.kt new file mode 100644 index 00000000000..7ad41b95e36 --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/templates/identifiers/fileAnnotationSimple.kt @@ -0,0 +1,18 @@ + + +@file: +@file: + +@Target(AnnotationTarget.FILE) +annotation class + +@Target(AnnotationTarget.FILE) +annotation class + +fun box(): String? { + if (!checkFileAnnotations("", listOf("", ""))) return null + if (!checkClassName(::class, "")) return null + if (!checkClassName(::class, "")) return null + + return "OK" +} diff --git a/compiler/tests-spec/testData/codegen/box/templates/identifiers/function.kt b/compiler/tests-spec/testData/codegen/box/templates/identifiers/function.kt new file mode 100644 index 00000000000..5927a269646 --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/templates/identifiers/function.kt @@ -0,0 +1,31 @@ + + +fun (): Boolean { + return true +} + +fun Boolean.() = true + +fun T.() = listOf(0).() + +inline fun K?.(x1: T = 10 as T) + where K : List, + K : Iterable, + T : Comparable, + T : Number = false + +fun box(): String? { + if (!()) return null + if (null.>()) return null + if (false.()) return null + if (!false.()) return null + if (Any().()) return null + + if (!checkFunctionName(::, "")) return null + if (!checkFunctionName(Boolean::, "")) return null + if (!checkFunctionName(Boolean::, "")) return null + if (!checkFunctionName(List::, "")) return null + if (!checkFunctionName(Nothing?::, "")) return null + + return "OK" +} diff --git a/compiler/tests-spec/testData/codegen/box/templates/identifiers/import.kt b/compiler/tests-spec/testData/codegen/box/templates/identifiers/import.kt new file mode 100644 index 00000000000..7c26ff6a56c --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/templates/identifiers/import.kt @@ -0,0 +1,46 @@ +// FILE: 2_19_1.kt + +package org.jetbrains.. + +val x1 = false + +// FILE: 2_19_2.kt + +val = false + +// FILE: 2_19_3.kt + +package ; + +val x3 = true + +// FILE: 2_19_4.kt + +package + +val x4 = false + +// FILE: 2_19_5.kt + +package org.jetbrains.kotlin + +val x5 = true + +// FILE: 2_19_6.kt + +val = false + +// FILE: 2_19_7.kt + +package part_1 + +import org.jetbrains...* +import +import .*; +import .*import + +fun box(): String? { + if (x1 || || !x3 || x4 || ) return null + + return "OK" +} diff --git a/compiler/tests-spec/testData/codegen/box/templates/identifiers/infixFunctionCall.kt b/compiler/tests-spec/testData/codegen/box/templates/identifiers/infixFunctionCall.kt new file mode 100644 index 00000000000..4b36b23f81e --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/templates/identifiers/infixFunctionCall.kt @@ -0,0 +1,12 @@ +infix fun Int.(value: Int) = value > 100 + +infix fun Int.(value: Int): Int { + return value - 90 +} + +fun box(): String? { + if (1 + 1 -1001020) return null + if (1 + 1 2004 -0) return null + + return "OK" +} diff --git a/compiler/tests-spec/testData/codegen/box/templates/identifiers/labelDefinition.kt b/compiler/tests-spec/testData/codegen/box/templates/identifiers/labelDefinition.kt new file mode 100644 index 00000000000..17fed2cacd9 --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/templates/identifiers/labelDefinition.kt @@ -0,0 +1,40 @@ +@Retention(AnnotationRetention.SOURCE) +@Target(AnnotationTarget.EXPRESSION) +annotation class Foo + +fun box(): String? { + val lambda_1 = @ { + return@ false + } + val lambda_2 = @Foo @ { Boolean + return@ false + } + + val x1 = @ true + + var i = 0 + + @ while (true) { + i++ + if (i < 4) continue@ + i++ + if (i > 15) break@ + } + + var j = 0 + + @ for (k in 0..20) { + j++ + if (k < 4) continue@ + j++ + if (k > 15) break@ + } + + if (lambda_1()) return null + if (lambda_2()) return null + if (!x1) return null + if (i != 17) return null + if (j != 30) return null + + return "OK" +} diff --git a/compiler/tests-spec/testData/codegen/box/templates/identifiers/labelReference.kt b/compiler/tests-spec/testData/codegen/box/templates/identifiers/labelReference.kt new file mode 100644 index 00000000000..89205586cbd --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/templates/identifiers/labelReference.kt @@ -0,0 +1,24 @@ +fun () { + val l = @ { + return@ + } + l() + return@ +} + +fun box(): String? { + () + + var i = 0 + @ while (i < 10) { + i++ + if (i <= 7) { + continue@ + } + if (i > 5) { + break@ + } + } + + return "OK" +} diff --git a/compiler/tests-spec/testData/codegen/box/templates/identifiers/object.kt b/compiler/tests-spec/testData/codegen/box/templates/identifiers/object.kt new file mode 100644 index 00000000000..67b70b06e9f --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/templates/identifiers/object.kt @@ -0,0 +1,23 @@ + + +open class A { + val x1 = true +} + +final object { + val x1 = false +} + +object : A() { + val x2 = false +} + +fun box(): String? { + if (.x1) return null + if (!.x1 || .x2) return null + + if (!checkClassName(::class, "")) return null + if (!checkClassName(::class, "")) return null + + return "OK" +} diff --git a/compiler/tests-spec/testData/codegen/box/templates/identifiers/packageComplex.kt b/compiler/tests-spec/testData/codegen/box/templates/identifiers/packageComplex.kt new file mode 100644 index 00000000000..abf8fc5c19c --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/templates/identifiers/packageComplex.kt @@ -0,0 +1,9 @@ + + +package org.jetbrains. + +fun box(): String? { + if (!checkPackageName("org.jetbrains..", "org.jetbrains.")) return null + + return "OK" +} diff --git a/compiler/tests-spec/testData/codegen/box/templates/identifiers/packageSimple.kt b/compiler/tests-spec/testData/codegen/box/templates/identifiers/packageSimple.kt new file mode 100644 index 00000000000..e0059c3969e --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/templates/identifiers/packageSimple.kt @@ -0,0 +1,9 @@ + + +package + +fun box(): String? { + if (!checkPackageName(".", "")) return null + + return "OK" +} diff --git a/compiler/tests-spec/testData/codegen/box/templates/identifiers/parameter.kt b/compiler/tests-spec/testData/codegen/box/templates/identifiers/parameter.kt new file mode 100644 index 00000000000..ca220fd0a1e --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/templates/identifiers/parameter.kt @@ -0,0 +1,29 @@ + + +fun f1(: Boolean) = !!! +fun f2(: Boolean, : Boolean) = && +fun f3(: Boolean, : Boolean = ) = || ! + +class A { + var x1: Boolean = false + set() { + field = ! + } +} + +fun box(): String? { + val a = A() + a.x1 = false + + if (f1(true)) return null + if (!f2(true, true)) return null + if (f3(false, true)) return null + if (!a.x1) return null + + if (!checkParameter(::f1, "")) return null + if (!checkParameters(::f2, listOf("", ""))) return null + if (!checkParameters(::f3, listOf("", ""))) return null + if (!checkSetterParameterName(A::x1, "")) return null + + return "OK" +} diff --git a/compiler/tests-spec/testData/codegen/box/templates/identifiers/setter.kt b/compiler/tests-spec/testData/codegen/box/templates/identifiers/setter.kt new file mode 100644 index 00000000000..f47c109357c --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/templates/identifiers/setter.kt @@ -0,0 +1,35 @@ + + +class A { + var x1: String = "100" + set() { + field = "$ 10" + } +} + +object B { + var x2: String = "101" + set() = kotlin.Unit +} + +var x3: String = "102" + set() { + field = "${} 11" + } + +fun box(): String? { + val a = A() + a.x1 = "0" + B.x2 = "1" + x3 = "2" + + if (a.x1 != "0 10") return null + if (B.x2 != "101") return null + if (x3 != "2 11") return null + + if (!checkSetterParameterName(A::x1, "")) return null + if (!checkSetterParameterName(B::x2, "")) return null + if (!checkSetterParameterName(::x3, "")) return null + + return "OK" +} diff --git a/compiler/tests-spec/testData/codegen/box/templates/identifiers/simpleUserType.kt b/compiler/tests-spec/testData/codegen/box/templates/identifiers/simpleUserType.kt new file mode 100644 index 00000000000..3a2e42b7b0c --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/templates/identifiers/simpleUserType.kt @@ -0,0 +1,110 @@ + + +package org.jetbrains. + +open class +open class + +typealias D<> = <> + +inline fun , reified > f1() = + when (()) { + is -> true + is -> false + else -> false + } + +inline fun >> T.f2(value: T) = value is + +class A>> { + val x = true +} + +class B>>> { + var x = false +} + +fun .> T.f3() = false + +fun f4(x1: List>): Boolean { + return true +} + +fun f5(x1: List?>>>) = false + +fun f6(x1: ) = false + +fun f7(x1: <*>) = true + +fun f8(x1: ) = false + +fun f9(x1: <*>>>) = true + +val x1: List<?> = listOf((), null, ()) + +lateinit var x2: List<?> + +fun box(): String? { + x2 = listOf((), null, ()) + + if (!f1<, <>>()) return null + if (<>().f2(())) return null + if (!A>>().x) return null + if (B<, A>>>().x) return null + if (().f3()) return null + if (!f4(listOf(()))) return null + if (f5(listOf(listOf(listOf(null, (), null, ()))))) return null + if (f6(())) return null + if (!f7(())) return null + if (f8(<>())) return null + if (!f9(<>>>())) return null + + if (x1.containsAll(listOf((), null, ()))) return null + if (x2.containsAll(listOf((), null, ()))) return null + + if (!checkCallableTypeParametersWithUpperBounds( + <>::f2, + listOf( + Pair("T", listOf("org.jetbrains..D.> /* = org.jetbrains...> */")) + ) + )) return null + + if (!checkClassTypeParametersWithUpperBounds( + A::class, + listOf( + Pair("K", listOf("kotlin.collections.List.>")) + ) + )) return null + + if (!checkClassTypeParametersWithUpperBounds( + B::class, + listOf( + Pair("T", listOf("org.jetbrains..A.>>")) + ) + )) return null + + if (!checkCallableTypeParametersWithUpperBounds( + ::f3, + listOf( + Pair("T", listOf("org.jetbrains..")) + ) + )) return null + + if (!checkParameterType(::f4, "x1", "kotlin.collections.List.>")) return null + + if (!checkParameterType(::f5, "x1", "kotlin.collections.List.?>>>")) return null + + if (!checkPropertyType(::x1, "kotlin.collections.List.?>")) return null + + if (!checkPropertyType(::x2, "kotlin.collections.List.?>")) return null + + if (!checkParameterType(::f6, "x1", "org.jetbrains..")) return null + + if (!checkParameterType(::f7, "x1", "org.jetbrains..<*>")) return null + + if (!checkParameterType(::f8, "x1", "org.jetbrains..")) return null + + if (!checkParameterType(::f9, "x1", "org.jetbrains...<*>>>")) return null + + return "OK" +} diff --git a/compiler/tests-spec/testData/codegen/box/templates/identifiers/stringTemplateElement.kt b/compiler/tests-spec/testData/codegen/box/templates/identifiers/stringTemplateElement.kt new file mode 100644 index 00000000000..ee12b1c0a3d --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/templates/identifiers/stringTemplateElement.kt @@ -0,0 +1,17 @@ +fun box(): String? { + val = "0" + val = "1" + + val x1 = "${}" + val x2 = "..." + "...$..." + "..." + var x3 = "$${}$" + + if ( != "1") return null + if ( != "0") return null + + if (x1 != "1") return null + if (x2 != "......0......") return null + if (x3 != "101") return null + + return "OK" +} diff --git a/compiler/tests-spec/testData/codegen/box/templates/identifiers/typeAlias.kt b/compiler/tests-spec/testData/codegen/box/templates/identifiers/typeAlias.kt new file mode 100644 index 00000000000..afaf88eb1dc --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/templates/identifiers/typeAlias.kt @@ -0,0 +1,17 @@ + + +typealias = Boolean + +internal typealias <> = Map<, List<>?> + +fun box(): String? { + val x1: = mapOf(true to listOf(false, false), false to null) + val x2: = false + + if (!x1[true]!!.containsAll(listOf(false, false)) || x1[false] != null) return null + if (x2) return null + + if (!checkClassName(::class, "kotlin.Boolean")) return null + + return "OK" +} \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/templates/identifiers/typeConstraint.kt b/compiler/tests-spec/testData/codegen/box/templates/identifiers/typeConstraint.kt new file mode 100644 index 00000000000..ff0b4155a61 --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/templates/identifiers/typeConstraint.kt @@ -0,0 +1,54 @@ + + +class A <, > + where : CharSequence, + : Comparable<> { + fun getValue() = false +} + +annotation class B <> + where : CharSequence, + @A> : Comparable<> { + +} + +annotation class C <, > where @property:C : CharSequence, : Comparable<> { + +} + +fun <, > d(): Boolean + where : Any, + : Iterable<*>, + : Collection<*>, + : MutableCollection<*>, + : Comparable<> = true + +fun box(): String? { + if (!d, Comparable>>()) return null + if (A().getValue()) return null + + if (!checkClassTypeParametersWithUpperBounds( + A::class, + listOf( + Pair("", listOf("kotlin.CharSequence")), + Pair("", listOf("kotlin.Comparable<>")) + ) + )) return null + + if (!checkClassTypeParametersWithUpperBounds( + B::class, + listOf( + Pair("", listOf("kotlin.CharSequence", "kotlin.Comparable<>")) + ) + )) return null + + if (!checkClassTypeParametersWithUpperBounds( + C::class, + listOf( + Pair("", listOf("kotlin.CharSequence")), + Pair("", listOf("kotlin.Comparable<>")) + ) + )) return null + + return "OK" +} diff --git a/compiler/tests-spec/testData/codegen/box/templates/identifiers/typeParameter.kt b/compiler/tests-spec/testData/codegen/box/templates/identifiers/typeParameter.kt new file mode 100644 index 00000000000..866877670c4 --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/templates/identifiers/typeParameter.kt @@ -0,0 +1,48 @@ + + +package org.jetbrains. + +open class { + val x1 = false +} +open class { + val x1 = true +} + +typealias A<> = <> + +class B<, > { + val x1: = <>() as + val x2: A<> = <>() as A<> + val x3: = () as +} + +fun <: Number> f1(): Boolean { + val x1: = 10 as + return false +} + +inline fun , reified : Any> .f2() = true + +val <> .x1: + get() = () + +fun box(): String? { + val b = B<<>, >() + + if (!null.x1.x1) return null + if (!b.x1.x1 || !b.x2.x1 || b.x3.x1) return null + if (f1()) return null + if (!0.f2>()) return null + if (!(-1).x1.x1) return null + + if (!checkCallableTypeParameter(Any::x1, "")) return null + if (!checkClassTypeParameters(B::class, listOf("", ""))) return null + if (!checkTypeProperties(B::class, listOf( + Pair("x1", ""), + Pair("x2", "org.jetbrains..A<> /* = org.jetbrains..<> */"), + Pair("x3", "") + ))) return null + + return "OK" +} \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/templates/identifiers/unescapedAnnotation.kt b/compiler/tests-spec/testData/codegen/box/templates/identifiers/unescapedAnnotation.kt new file mode 100644 index 00000000000..590970427e4 --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/templates/identifiers/unescapedAnnotation.kt @@ -0,0 +1,52 @@ + + +package org.jetbrains. + +annotation class + +annotation class (val a: String) + +class A { + @field: + val x1: Int = 0 + + @setparam: + var x2: Int = 1 + + val @receiver:org.jetbrains..>("false") String.x3: Int + get() { + return 2 + } + + @org.jetbrains..("1") + val x4: Int = 3 + + @ + val x5: Int = 4 + + val x6: Int = "...".x3 +} + +@ val x6 = 5 + +@org.jetbrains..<>(".") fun f1() = false + +fun box(): String? { + val a = A() + + if (a.x1 != 0 || a.x2 != 1 || a.x6 != 2 || a.x4 != 3 || a.x5 != 4 || x6 != 5) return null + if (f1()) return null + + if (!checkProperties(A::class, listOf("x1", "x2", "x3", "x4", "x5"))) return null + if (!checkPropertiesWithAnnotation( + A::class, + listOf( + Pair("x4", listOf("org.jetbrains..")), + Pair("x5", listOf("org.jetbrains..")) + ) + )) return null + if (!checkPropertyAnnotation(::x6, "org.jetbrains..")) return null + if (!checkFunctionAnnotation(::f1, "org.jetbrains..")) return null + + return "OK" +} diff --git a/compiler/tests-spec/testData/codegen/box/templates/identifiers/valueArgument.kt b/compiler/tests-spec/testData/codegen/box/templates/identifiers/valueArgument.kt new file mode 100644 index 00000000000..e0eac14ddb8 --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/templates/identifiers/valueArgument.kt @@ -0,0 +1,17 @@ + + +fun f1(: Boolean, : Boolean) = && !!! + +fun f2(: Boolean): Boolean { + return ! +} + +fun f3(vararg : Boolean, : Boolean) = .any { it } && + +fun box(): String? { + if (f1( = false, = true)) return null + if (!f2( = false && true || true && false)) return null + if (!f3( = *booleanArrayOf(true, false, false, true), = true)) return null + + return "OK" +} diff --git a/compiler/tests-spec/testData/codegen/box/templates/identifiers/variableDeclarationEntry.kt b/compiler/tests-spec/testData/codegen/box/templates/identifiers/variableDeclarationEntry.kt new file mode 100644 index 00000000000..a8aed54d803 --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/templates/identifiers/variableDeclarationEntry.kt @@ -0,0 +1,33 @@ + + +val = {`false`: Boolean -> !`false` } + +fun f1(value: Pair): Boolean { + val (, ) = value + + if ( != "1") return false + if ( != "2") return false + + return true +} + +fun box(): String? { + var i = 0 + for (: Int in 0..10) { + i++ + } + + if (!(false)) return null + + val = { : Boolean, : Int -> true } + var : Boolean + + = false + + if (!f1(Pair("1", "2"))) return null + if (i != 11) return null + if (!(false, 10)) return null + if () return null + + return "OK" +} \ No newline at end of file