diff --git a/compiler/frontend/src/org/jetbrains/kotlin/checkers/diagnostics/TextDiagnostic.kt b/compiler/frontend/src/org/jetbrains/kotlin/checkers/diagnostics/TextDiagnostic.kt index b1b4ff913cb..58bd10b2a29 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/checkers/diagnostics/TextDiagnostic.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/checkers/diagnostics/TextDiagnostic.kt @@ -6,12 +6,9 @@ package org.jetbrains.kotlin.checkers.diagnostics import com.intellij.openapi.util.text.StringUtil -import com.intellij.util.SmartList import com.intellij.util.containers.ContainerUtil import org.jetbrains.kotlin.checkers.diagnostics.factories.DebugInfoDiagnosticFactory1 import org.jetbrains.kotlin.checkers.utils.CheckerTestUtil -import org.jetbrains.kotlin.checkers.utils.CheckerTestUtil.INDIVIDUAL_PARAMETER_PATTERN -import org.jetbrains.kotlin.checkers.utils.CheckerTestUtil.SHOULD_BE_ESCAPED import org.jetbrains.kotlin.diagnostics.rendering.AbstractDiagnosticWithParametersRenderer import org.jetbrains.kotlin.diagnostics.rendering.DefaultErrorMessages import org.jetbrains.kotlin.diagnostics.rendering.DiagnosticWithParameters1Renderer @@ -79,7 +76,7 @@ class TextDiagnostic( result.append(name) if (parameters != null) { result.append("(") - result.append(StringUtil.join(parameters, { escape(it) }, "; ")) + result.append(StringUtil.join(parameters, { "\"$it\"" }, ", ")) result.append(")") } return result.toString() @@ -90,13 +87,6 @@ class TextDiagnostic( } companion object { - private fun escape(s: String): String { - return s.replace("([$SHOULD_BE_ESCAPED])".toRegex(), "\\\\$1") - } - - private fun unescape(s: String): String { - return s.replace("\\\\([$SHOULD_BE_ESCAPED])".toRegex(), "$1") - } fun parseDiagnostic(text: String): TextDiagnostic { val matcher = CheckerTestUtil.individualDiagnosticPattern.matcher(text) if (!matcher.find()) @@ -119,11 +109,12 @@ class TextDiagnostic( inference ) - val parsedParameters = SmartList() - val parametersMatcher = INDIVIDUAL_PARAMETER_PATTERN.matcher(parameters) - while (parametersMatcher.find()) - parsedParameters.add(unescape(parametersMatcher.group().trim({ it <= ' ' }))) - return TextDiagnostic(name, platform, parsedParameters, inference) + return TextDiagnostic( + name, + platform, + parameters.trim('"').split(Regex("""",\s*"""")), + inference + ) } private fun computeInferenceCompatibility(abbreviation: String?): InferenceCompatibility { diff --git a/compiler/frontend/src/org/jetbrains/kotlin/checkers/utils/CheckerTestUtil.kt b/compiler/frontend/src/org/jetbrains/kotlin/checkers/utils/CheckerTestUtil.kt index 971a7f716ca..e940a6837d0 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/checkers/utils/CheckerTestUtil.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/checkers/utils/CheckerTestUtil.kt @@ -41,10 +41,7 @@ object CheckerTestUtil { const val OLD_INFERENCE_PREFIX = "OI" private const val IGNORE_DIAGNOSTIC_PARAMETER = "IGNORE" - val SHOULD_BE_ESCAPED = "\\)\\(;" - private val DIAGNOSTIC_PARAMETER = "(?:(?:\\\\[" + SHOULD_BE_ESCAPED + "])|[^" + SHOULD_BE_ESCAPED + "])+" - private val INDIVIDUAL_DIAGNOSTIC = "(\\w+;)?(\\w+:)?(\\w+)(\\(" + DIAGNOSTIC_PARAMETER + "(;\\s*" + DIAGNOSTIC_PARAMETER + ")*\\))?" - val INDIVIDUAL_PARAMETER_PATTERN = Pattern.compile(DIAGNOSTIC_PARAMETER) + private const val INDIVIDUAL_DIAGNOSTIC = """(\w+;)?(\w+:)?(\w+)(?:\(((?:".*?")(?:,\s*".*?")*)\))?""" private val rangeStartOrEndPattern = Pattern.compile("()|()") val individualDiagnosticPattern: Pattern = Pattern.compile(INDIVIDUAL_DIAGNOSTIC) diff --git a/compiler/testData/diagnostics/tests/InfixModifierApplicability.kt b/compiler/testData/diagnostics/tests/InfixModifierApplicability.kt index e1b5f33fb1b..beffb0c75e7 100644 --- a/compiler/testData/diagnostics/tests/InfixModifierApplicability.kt +++ b/compiler/testData/diagnostics/tests/InfixModifierApplicability.kt @@ -11,17 +11,17 @@ class OkTest { } // Errors -infix fun String.e1(o: String, o2: String? = null) = o -infix fun String.e2(o: String = "", o2: String? = null) = o +infix fun String.e1(o: String, o2: String? = null) = o +infix fun String.e2(o: String = "", o2: String? = null) = o -infix fun e3() {} -infix fun e4(s: String) {} -infix fun String.e5() {} -infix fun String.e6(a: Int, b: Int) {} -infix fun e7(a: Int, b: Int) {} +infix fun e3() {} +infix fun e4(s: String) {} +infix fun String.e5() {} +infix fun String.e6(a: Int, b: Int) {} +infix fun e7(a: Int, b: Int) {} class Example { - infix fun e8(s: String, a: Int = 0) {} - infix fun e9(s: String, a: Int) {} - infix fun e10() {} + infix fun e8(s: String, a: Int = 0) {} + infix fun e9(s: String, a: Int) {} + infix fun e10() {} } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/classObjects/InnerClassClassObject.kt b/compiler/testData/diagnostics/tests/classObjects/InnerClassClassObject.kt index 8e0f36dd2b1..da2bd3a2f68 100644 --- a/compiler/testData/diagnostics/tests/classObjects/InnerClassClassObject.kt +++ b/compiler/testData/diagnostics/tests/classObjects/InnerClassClassObject.kt @@ -2,7 +2,7 @@ class A { inner class B { - companion object { } + companion object { } } } diff --git a/compiler/testData/diagnostics/tests/classObjects/multipleDissallowedDefaultObjects.kt b/compiler/testData/diagnostics/tests/classObjects/multipleDissallowedDefaultObjects.kt index b7eb5bb8e6c..890e83c6f59 100644 --- a/compiler/testData/diagnostics/tests/classObjects/multipleDissallowedDefaultObjects.kt +++ b/compiler/testData/diagnostics/tests/classObjects/multipleDissallowedDefaultObjects.kt @@ -1,10 +1,10 @@ class A { inner class I { - companion object A + companion object A - companion object B + companion object B - companion object C + companion object C } } diff --git a/compiler/testData/diagnostics/tests/controlStructures/kt10717.kt b/compiler/testData/diagnostics/tests/controlStructures/kt10717.kt index 130a53c351c..9fd3e1f8d1f 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/kt10717.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/kt10717.kt @@ -1,21 +1,21 @@ // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNREACHABLE_CODE -UNUSED_PARAMETER -RETURN_NOT_ALLOWED fun test1() = run { - return "OK" + return "OK" } fun test2() = run { fun local(): String { return "" } - return "" + return "" } inline fun Iterable.map(transform: (T) -> R): List = null!! fun test3(a: List, b: List) = a.map { - if (it.length == 3) return )!>null - if (it.length == 4) return )!>"" - if (it.length == 4) return )!>5 + if (it.length == 3) return ")!>null + if (it.length == 4) return ")!>"" + if (it.length == 4) return ")!>5 if (it.length == 4) return b 1 } diff --git a/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.kt b/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.kt index 1862f1452d5..232dc9ca5be 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.kt @@ -7,7 +7,7 @@ fun test() { val x = fun named1(x: Int): Int { return 1 } x checkType { _>() } - foo { Int)!>fun named2(): Int {return 1} } + foo { Int")!>fun named2(): Int {return 1} } foo({ fun named3() = 1 }) val x1 = diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/missedGetter.kt b/compiler/testData/diagnostics/tests/delegatedProperty/missedGetter.kt index 77335c26321..709bd40dd92 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/missedGetter.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/missedGetter.kt @@ -1,3 +1,3 @@ -val a: Int by \); A)!>A() +val a: Int by )", "A")!>A() class A diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/missedSetter.kt b/compiler/testData/diagnostics/tests/delegatedProperty/missedSetter.kt index 9404ef16409..44fe82801cb 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/missedSetter.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/missedSetter.kt @@ -2,7 +2,7 @@ import kotlin.reflect.KProperty -var a: Int by , Int\); A)!>A() +var a: Int by , Int)", "A")!>A() class A { operator fun getValue(t: Any?, p: KProperty<*>): Int { diff --git a/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambdaWithExpectedType.kt b/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambdaWithExpectedType.kt index c97a7bf338f..25f8f6c12fa 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambdaWithExpectedType.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambdaWithExpectedType.kt @@ -8,7 +8,7 @@ fun test(bal: Array) { val c: () -> UNRESOLVED = { bal[2] = 3 } - val d: () -> Int = { bar += 4 } + val d: () -> Int = { bar += 4 } val e: Unit = run { bar += 4 } diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/importedInner.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/importedInner.kt index c2faa24b804..5ae7666b31b 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/importedInner.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/importedInner.kt @@ -11,10 +11,10 @@ class Outer { } class Nested { - fun bar(x: Inner) {} + fun bar(x: Inner) {} } } class E -fun bar(x: Inner) {} +fun bar(x: Inner) {} diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/outerArgumentsRequired.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/outerArgumentsRequired.kt index 8332da177c1..10f529147c9 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/outerArgumentsRequired.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/outerArgumentsRequired.kt @@ -11,13 +11,13 @@ class A { } class Nested { - val x: B? = null - val y: B.C? = null - val z: B.D? = null + val x: B? = null + val y: B.C? = null + val z: B.D? = null - val c: C? = null - val d: D? = null + val c: C? = null + val d: D? = null - val innerMost: Innermost? = null + val innerMost: Innermost? = null } } diff --git a/compiler/testData/diagnostics/tests/inline/messagesForUnsupportedInInline.kt b/compiler/testData/diagnostics/tests/inline/messagesForUnsupportedInInline.kt index 3f4e718028e..5905b5a42e2 100644 --- a/compiler/testData/diagnostics/tests/inline/messagesForUnsupportedInInline.kt +++ b/compiler/testData/diagnostics/tests/inline/messagesForUnsupportedInInline.kt @@ -1,10 +1,10 @@ inline fun inlineFun() { - fun localFun() {} - class LocalClass {} + fun localFun() {} + class LocalClass {} } fun outerFun() { - inline fun localInlineFun() {} + inline fun localInlineFun() {} } abstract class Base { @@ -13,6 +13,6 @@ abstract class Base { class Derived : Base() { override final inline fun withDefault( - f: () -> Unit + f: () -> Unit ) {} } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inner/annotationInInnerClass.kt b/compiler/testData/diagnostics/tests/inner/annotationInInnerClass.kt index a2203c7d271..a3cf016ec8d 100644 --- a/compiler/testData/diagnostics/tests/inner/annotationInInnerClass.kt +++ b/compiler/testData/diagnostics/tests/inner/annotationInInnerClass.kt @@ -1,5 +1,5 @@ class Outer { inner class Inner { - annotation class TestNestedAnnotation + annotation class TestNestedAnnotation } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inner/enumInInnerClass.kt b/compiler/testData/diagnostics/tests/inner/enumInInnerClass.kt index 3990e448e7c..600491755e3 100644 --- a/compiler/testData/diagnostics/tests/inner/enumInInnerClass.kt +++ b/compiler/testData/diagnostics/tests/inner/enumInInnerClass.kt @@ -1,5 +1,5 @@ class Outer { inner class Inner { - enum class TestNestedEnum + enum class TestNestedEnum } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inner/interfaceInInnerClass.kt b/compiler/testData/diagnostics/tests/inner/interfaceInInnerClass.kt index f52d0ff291d..e9b3a0af7bc 100644 --- a/compiler/testData/diagnostics/tests/inner/interfaceInInnerClass.kt +++ b/compiler/testData/diagnostics/tests/inner/interfaceInInnerClass.kt @@ -1,5 +1,5 @@ class Outer { inner class Inner { - interface TestNestedInterface + interface TestNestedInterface } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inner/nestedObject.kt b/compiler/testData/diagnostics/tests/inner/nestedObject.kt index 3ec29ae64bb..372eec1486f 100644 --- a/compiler/testData/diagnostics/tests/inner/nestedObject.kt +++ b/compiler/testData/diagnostics/tests/inner/nestedObject.kt @@ -1,12 +1,12 @@ // SKIP_TXT class Outer { inner class Inner1 { - object Obj1 + object Obj1 - companion object Obj2 + companion object Obj2 inner class Inner2 { - object Obj3 + object Obj3 } } } diff --git a/compiler/testData/diagnostics/tests/kt435.kt b/compiler/testData/diagnostics/tests/kt435.kt index 6d446e7b5d6..cc0edcb6c0d 100644 --- a/compiler/testData/diagnostics/tests/kt435.kt +++ b/compiler/testData/diagnostics/tests/kt435.kt @@ -3,5 +3,5 @@ fun Any.foo1() : (i : Int) -> Unit { } fun test(a : Any) { - a.foo1()() + a.foo1()() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/modifiers/const/applicability.kt b/compiler/testData/diagnostics/tests/modifiers/const/applicability.kt index d8cb2f991ea..fa1d758db87 100644 --- a/compiler/testData/diagnostics/tests/modifiers/const/applicability.kt +++ b/compiler/testData/diagnostics/tests/modifiers/const/applicability.kt @@ -61,7 +61,7 @@ enum class MyEnum { class Outer { inner class Inner { - object C { + object C { const val a = 18 } } diff --git a/compiler/testData/diagnostics/tests/multimodule/packagePrivate.kt b/compiler/testData/diagnostics/tests/multimodule/packagePrivate.kt index 11a42db5948..ab08f0b9387 100644 --- a/compiler/testData/diagnostics/tests/multimodule/packagePrivate.kt +++ b/compiler/testData/diagnostics/tests/multimodule/packagePrivate.kt @@ -9,11 +9,11 @@ private val a = 1 package p -val b = a // same package, same module +val b = a // same package, same module // MODULE: m2(m1) // FILE: c.kt package p -val c = a // same package, another module +val c = a // same package, another module diff --git a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/nonGenericRawMember.kt b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/nonGenericRawMember.kt index 57114da4e32..6fe7cdcf74f 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/nonGenericRawMember.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/nonGenericRawMember.kt @@ -30,5 +30,5 @@ val strList: List = null!! fun main() { val rawB = Test.rawAField.b; // Raw(A).b is not erased because it have no type parameters - var rawInner = rawB.bar(!; List)!>strList) + var rawInner = rawB.bar(!", "List")!>strList) } diff --git a/compiler/testData/diagnostics/tests/privateInFile/visibility.kt b/compiler/testData/diagnostics/tests/privateInFile/visibility.kt index 5ada8b96872..5c92a64dbed 100644 --- a/compiler/testData/diagnostics/tests/privateInFile/visibility.kt +++ b/compiler/testData/diagnostics/tests/privateInFile/visibility.kt @@ -29,21 +29,21 @@ package a fun test() { val y = makeA() - y.bar() - foo() + y.bar() + foo() - val u : A = A() + val u : A = A() - val z = x - x = 30 + val z = x + x = 30 - val po = PO + val po = PO val v = xx - xx = 40 + xx = 40 } -class B : A() {} +class B : A() {} class Q { class W { diff --git a/compiler/testData/diagnostics/tests/regressions/kt251.kt b/compiler/testData/diagnostics/tests/regressions/kt251.kt index c8c8e171185..9d871865dbe 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt251.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt251.kt @@ -6,7 +6,7 @@ class A() { field = value } val y: Int - get(): String = "s" + get(): String = "s" val z: Int get() { return "s" diff --git a/compiler/testData/diagnostics/tests/scopes/visibility.kt b/compiler/testData/diagnostics/tests/scopes/visibility.kt index 26e62c7733c..db0a3e723cc 100644 --- a/compiler/testData/diagnostics/tests/scopes/visibility.kt +++ b/compiler/testData/diagnostics/tests/scopes/visibility.kt @@ -40,8 +40,8 @@ class B { } fun test3(a: A) { - a.v //todo .bMethod() - a.f(0, 1) //todo .bMethod() + a.v //todo .bMethod() + a.f(0, 1) //todo .bMethod() } interface T @@ -54,7 +54,7 @@ open class C : T { } fun test4(c: C) { - c.i++ + c.i++ } class D : C() { @@ -78,7 +78,7 @@ class F : C() { class G : T { fun test8(c: C) { - doSmth(c.i) + doSmth(c.i) } } @@ -91,5 +91,5 @@ import test_visibility.* fun test() { internal_fun() - private_fun() + private_fun() } diff --git a/compiler/testData/diagnostics/tests/scopes/visibility2.kt b/compiler/testData/diagnostics/tests/scopes/visibility2.kt index e43e13ad56d..c3fee556f45 100644 --- a/compiler/testData/diagnostics/tests/scopes/visibility2.kt +++ b/compiler/testData/diagnostics/tests/scopes/visibility2.kt @@ -17,23 +17,23 @@ private object PO {} //+JDK package b -import a.A -import a.foo +import a.A +import a.foo import a.makeA -import a.PO +import a.PO fun test() { val y = makeA() - y.bar() - foo() + y.bar() + foo() - val u : A = A() - val a : java.util.Arrays.ArrayList; + val u : A = A() + val a : java.util.Arrays.ArrayList; - val po = PO + val po = PO } -class B : A() {} +class B : A() {} class Q { class W { diff --git a/compiler/testData/diagnostics/tests/scopes/visibility3.kt b/compiler/testData/diagnostics/tests/scopes/visibility3.kt index 1cded275107..215e9171f0a 100644 --- a/compiler/testData/diagnostics/tests/scopes/visibility3.kt +++ b/compiler/testData/diagnostics/tests/scopes/visibility3.kt @@ -25,18 +25,18 @@ package a fun test() { val y = makeA() - y.bar() - foo() + y.bar() + foo() - val u : A = A() + val u : A = A() - val z = x - x = 30 + val z = x + x = 30 - val po = PO + val po = PO } -class B : A() {} +class B : A() {} class Q { class W { diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/generics2.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/generics2.kt index f6929e9fb71..9619dfce57d 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/generics2.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/generics2.kt @@ -14,14 +14,14 @@ class A0 { class A1 : B { constructor(x: T1, y: T2): super(x, y) - constructor(x: T1, y: Int): super(x, y) - constructor(x: T1, y: T1, z: T1): super(x, y) + constructor(x: T1, y: Int): super(x, y) + constructor(x: T1, y: T1, z: T1): super(x, y) } class A2 : B { - constructor(x: T1, y: T2): super(x, y) + constructor(x: T1, y: T2): super(x, y) constructor(x: T1, y: Int): super(x, y) - constructor(x: T1, y: T1, z: T1): super(x, y) - constructor(x: T1, y: T2, z: String): super(y, 1) + constructor(x: T1, y: T1, z: T1): super(x, y) + constructor(x: T1, y: T2, z: String): super(y, 1) } diff --git a/compiler/testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.kt b/compiler/testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.kt index 527769a6374..c5f8820b07f 100644 --- a/compiler/testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.kt +++ b/compiler/testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.kt @@ -6,7 +6,7 @@ typealias Array2D = Array> fun foo1(a: Array2D) = a fun bar1(a: Array2D) = - foo1( /* = Array> */; Array2D /* = Array> */)!>a) + foo1( /* = Array> */", "Array2D /* = Array> */")!>a) typealias TMap = Map diff --git a/compiler/testData/diagnostics/tests/variance/Class.kt b/compiler/testData/diagnostics/tests/variance/Class.kt index 5bd90ac9c06..bbc7c8044c7 100644 --- a/compiler/testData/diagnostics/tests/variance/Class.kt +++ b/compiler/testData/diagnostics/tests/variance/Class.kt @@ -2,22 +2,22 @@ interface In interface Out interface Inv -interface TypeBounds1I> +interface TypeBounds1I> interface TypeBounds2 interface TypeBounds3 interface TypeBounds4> -interface TypeBounds5)!>O>> +interface TypeBounds5")!>O>> -interface WhereTypeBounds1 where X : I +interface WhereTypeBounds1 where X : I interface WhereTypeBounds2 where X : O interface WhereTypeBounds3 where X : P interface WhereTypeBounds4 where X : In -interface WhereTypeBounds5 where X : In<)!>O> +interface WhereTypeBounds5 where X : In<")!>O> -class SubClass1 : Out<)!>I> +class SubClass1 : Out<")!>I> class SubClass2 : Out class SubClass3 : Out

class SubClass4 : In -class SubClass5 : In<)!>O> -class SubClass6 : Inv<)!>O> -class SubClass7 : Inv<)!>I> \ No newline at end of file +class SubClass5 : In<")!>O> +class SubClass6 : Inv<")!>O> +class SubClass7 : Inv<")!>I> \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/variance/Function.kt b/compiler/testData/diagnostics/tests/variance/Function.kt index 9d008952063..9f58506d52e 100644 --- a/compiler/testData/diagnostics/tests/variance/Function.kt +++ b/compiler/testData/diagnostics/tests/variance/Function.kt @@ -4,31 +4,31 @@ interface Inv fun getT(): T = null!! interface Test { - fun parameters1(i: I, o: O, p: P) - fun parameters2(i: In<)!>I>) + fun parameters1(i: I, o: O, p: P) + fun parameters2(i: In<")!>I>) fun parameters3(i: In) - fun explicitReturnType1() : I + fun explicitReturnType1() : I fun explicitReturnType2() : O fun explicitReturnType3() : P fun explicitReturnType4() : In - fun explicitReturnType5() : In<)!>O> + fun explicitReturnType5() : In<")!>O> - fun imlicitReturnType1() = getT() + fun imlicitReturnType1() = getT() fun imlicitReturnType2() = getT() fun imlicitReturnType3() = getT

() fun imlicitReturnType4() = getT>() - )!>fun imlicitReturnType5() = getT>() + ")!>fun imlicitReturnType5() = getT>() fun I.receiver1() - fun O.receiver2() + fun O.receiver2() fun P.receiver3() - fun In<)!>I>.receiver4() + fun In<")!>I>.receiver4() fun In.receiver5() fun typeParameter1() - fun O> typeParameter2() + fun O> typeParameter2() fun typeParameter3() - fun )!>I>> typeParameter4() + fun ")!>I>> typeParameter4() fun > typeParameter5() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/variance/InPosition.kt b/compiler/testData/diagnostics/tests/variance/InPosition.kt index 550b0f0fc1b..a18da9643fd 100644 --- a/compiler/testData/diagnostics/tests/variance/InPosition.kt +++ b/compiler/testData/diagnostics/tests/variance/InPosition.kt @@ -25,22 +25,22 @@ interface Test { fun Ok22(i: Inv) fun Ok23(i: Inv) - fun neOk1(i: O) - fun neOk2(i: In<)!>I>) - fun neOk3(i: In>)!>O>>) - fun neOk4(i: Inv<)!>I>) - fun neOk5(i: Inv<)!>O>) - fun neOk6(i: In>)!>O>>) - fun neOk7(i: Pair, O>)!>I>, , O>)!>O>) - fun neOk8(i: Inv)!>O>) + fun neOk1(i: O) + fun neOk2(i: In<")!>I>) + fun neOk3(i: In>")!>O>>) + fun neOk4(i: Inv<")!>I>) + fun neOk5(i: Inv<")!>O>) + fun neOk6(i: In>")!>O>>) + fun neOk7(i: Pair, O>")!>I>, , O>")!>O>) + fun neOk8(i: Inv")!>O>) fun neOk9(i: In<out P>) - fun neOk10(i: Out<)!>O>) + fun neOk10(i: Out<")!>O>) - fun neOk11(i: Inv)!>I>) - fun neOk12(i: Inv)!>O>) + fun neOk11(i: Inv")!>I>) + fun neOk12(i: Inv")!>O>) - fun neOk30(i: Pair<)!>O, >) - fun neOk31(i: Pair<)!>O, Inv>) + fun neOk30(i: Pair<")!>O, >) + fun neOk31(i: Pair<")!>O, Inv>) fun neOk32(i: Inv) fun neOk33(i: Inv<>) fun neOk34(i: Inv<C>) diff --git a/compiler/testData/diagnostics/tests/variance/InvariantPosition.kt b/compiler/testData/diagnostics/tests/variance/InvariantPosition.kt index 96c60aea28f..3aa20a8300b 100644 --- a/compiler/testData/diagnostics/tests/variance/InvariantPosition.kt +++ b/compiler/testData/diagnostics/tests/variance/InvariantPosition.kt @@ -12,32 +12,32 @@ interface Test { var ok6: Inv var ok7: Inv - var neOk1: O - var neOk2: In<)!>I> - var neOk3: In>)!>O>> - var neOk4: Inv<)!>I> - var neOk5: Inv<)!>O> - var neOk6: In>)!>O>> - var neOk7: Pair, O>)!>I>, , O>)!>O> - var neOk8: Inv)!>O> - var neOk9: Inv)!>I> + var neOk1: O + var neOk2: In<")!>I> + var neOk3: In>")!>O>> + var neOk4: Inv<")!>I> + var neOk5: Inv<")!>O> + var neOk6: In>")!>O>> + var neOk7: Pair, O>")!>I>, , O>")!>O> + var neOk8: Inv")!>O> + var neOk9: Inv")!>I> var neOk10: In<out I> - var neOk11: I - var neOk12: In<)!>O> - var neOk13: In>)!>I>> - var neOk14: Out<)!>I> - var neOk15: Out>)!>I>> - var neOk16: Out>)!>O>> - var neOk17: Pair, I>)!>O>, , I>)!>I> + var neOk11: I + var neOk12: In<")!>O> + var neOk13: In>")!>I>> + var neOk14: Out<")!>I> + var neOk15: Out>")!>I>> + var neOk16: Out>")!>O>> + var neOk17: Pair, I>")!>O>, , I>")!>I> - var neOk20: Inv)!>O> - var neOk21: Inv)!>I> - var neOk22: Inv)!>O> - var neOk23: Inv)!>I> + var neOk20: Inv")!>O> + var neOk21: Inv")!>I> + var neOk22: Inv")!>O> + var neOk23: Inv")!>I> - var neOk30: Pair<)!>I, > - var neOk31: Pair<)!>I, Inv> + var neOk30: Pair<")!>I, > + var neOk31: Pair<")!>I, Inv> var neOk32: Inv var neOk33: Inv<> var neOk34: Inv<C> diff --git a/compiler/testData/diagnostics/tests/variance/NullableTypes.kt b/compiler/testData/diagnostics/tests/variance/NullableTypes.kt index 2f0df3a258b..d5fc03917cf 100644 --- a/compiler/testData/diagnostics/tests/variance/NullableTypes.kt +++ b/compiler/testData/diagnostics/tests/variance/NullableTypes.kt @@ -9,8 +9,8 @@ interface Test { fun ok2(i: In?) : Out? fun ok3(i: Inv) = getT>() - fun neOk1(i: O?) : I? - fun neOk(i: Out<?)!>O?>?) : In<?)!>O?>? - fun neOk3(i: Inv)!>I?>) - ?)!>fun neOk4() = getT?>() + fun neOk1(i: O?) : I? + fun neOk(i: Out<?")!>O?>?) : In<?")!>O?>? + fun neOk3(i: Inv")!>I?>) + ?")!>fun neOk4() = getT?>() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/variance/OutPosition.kt b/compiler/testData/diagnostics/tests/variance/OutPosition.kt index 000dbc57291..1a5d5616e3e 100644 --- a/compiler/testData/diagnostics/tests/variance/OutPosition.kt +++ b/compiler/testData/diagnostics/tests/variance/OutPosition.kt @@ -19,20 +19,20 @@ interface Test { fun ok12(): Inv fun ok13(): Inv - fun neOk1(): I - fun neOk2(): In<)!>O> - fun neOk3(): In>)!>I>> - fun neOk4(): Inv<)!>I> - fun neOk5(): Inv<)!>O> - fun neOk6(): Pair, I>)!>O>, , I>)!>I> - fun neOk7(): Inv)!>O> - fun neOk8(): Out<in I> + fun neOk1(): I + fun neOk2(): In<")!>O> + fun neOk3(): In>")!>I>> + fun neOk4(): Inv<")!>I> + fun neOk5(): Inv<")!>O> + fun neOk6(): Pair, I>")!>O>, , I>")!>I> + fun neOk7(): Inv")!>O> + fun neOk8(): Out<in I> - fun neOk10(): Inv)!>O> - fun neOk11(): Inv)!>I> + fun neOk10(): Inv")!>O> + fun neOk11(): Inv")!>I> - fun neOk30(): Pair<)!>I, > - fun neOk31(): Pair<)!>I, Inv> + fun neOk30(): Pair<")!>I, > + fun neOk31(): Pair<")!>I, Inv> fun neOk32(): Inv fun neOk33(): Inv<> fun neOk34(): Inv<C> diff --git a/compiler/testData/diagnostics/tests/variance/PrimaryConstructor.kt b/compiler/testData/diagnostics/tests/variance/PrimaryConstructor.kt index a601fb7987b..2d36e579433 100644 --- a/compiler/testData/diagnostics/tests/variance/PrimaryConstructor.kt +++ b/compiler/testData/diagnostics/tests/variance/PrimaryConstructor.kt @@ -5,17 +5,17 @@ interface Inv fun getT(): T = null!! class Test( - val type1: I, + val type1: I, val type2: O, val type3: P, val type4: In, - val type5: In<)!>O>, + val type5: In<")!>O>, - var type6: I, - var type7: O, + var type6: I, + var type7: O, var type8: P, - var type9: In<)!>I>, - var type0: In<)!>O>, + var type9: In<")!>I>, + var type0: In<")!>O>, type11: I, type12: O, diff --git a/compiler/testData/diagnostics/tests/variance/ValProperty.kt b/compiler/testData/diagnostics/tests/variance/ValProperty.kt index 65f96955372..69e7e33fc16 100644 --- a/compiler/testData/diagnostics/tests/variance/ValProperty.kt +++ b/compiler/testData/diagnostics/tests/variance/ValProperty.kt @@ -12,39 +12,39 @@ class Delegate { fun getT(): T = null!! abstract class Test { - abstract val type1: I + abstract val type1: I abstract val type2: O abstract val type3: P abstract val type4: In - abstract val type5: In<)!>O> + abstract val type5: In<")!>O> - val implicitType1 = getT() + val implicitType1 = getT() val implicitType2 = getT() val implicitType3 = getT

() val implicitType4 = getT>() - )!>val implicitType5 = getT>() + ")!>val implicitType5 = getT>() - val delegateType1 by Delegate() + val delegateType1 by Delegate() val delegateType2 by Delegate() val delegateType3 by Delegate

() val delegateType4 by Delegate>() - )!>val delegateType5 by Delegate>() + ")!>val delegateType5 by Delegate>() abstract val I.receiver1: Int - abstract val O.receiver2: Int + abstract val O.receiver2: Int abstract val P.receiver3: Int - abstract val In<)!>I>.receiver4: Int + abstract val In<")!>I>.receiver4: Int abstract val In.receiver5: Int val X.typeParameter1: Int get() = 0 - val O> X.typeParameter2: Int get() = 0 + val O> X.typeParameter2: Int get() = 0 val X.typeParameter3: Int get() = 0 - val )!>I>> X.typeParameter4: Int get() = 0 + val ")!>I>> X.typeParameter4: Int get() = 0 val > X.typeParameter5: Int get() = 0 val X.typeParameter6: Int where X : I get() = 0 - val X.typeParameter7: Int where X : O get() = 0 + val X.typeParameter7: Int where X : O get() = 0 val X.typeParameter8: Int where X : P get() = 0 - val X.typeParameter9: Int where X : In<)!>I> get() = 0 + val X.typeParameter9: Int where X : In<")!>I> get() = 0 val X.typeParameter0: Int where X : In get() = 0 } diff --git a/compiler/testData/diagnostics/tests/variance/VarProperty.kt b/compiler/testData/diagnostics/tests/variance/VarProperty.kt index ea9599d42fa..31d3b348e1a 100644 --- a/compiler/testData/diagnostics/tests/variance/VarProperty.kt +++ b/compiler/testData/diagnostics/tests/variance/VarProperty.kt @@ -12,39 +12,39 @@ class Delegate { fun getT(): T = null!! abstract class Test { - abstract var type1: I - abstract var type2: O + abstract var type1: I + abstract var type2: O abstract var type3: P - abstract var type4: In<)!>I> - abstract var type5: In<)!>O> + abstract var type4: In<")!>I> + abstract var type5: In<")!>O> - var implicitType1 = getT() - var implicitType2 = getT() + var implicitType1 = getT() + var implicitType2 = getT() var implicitType3 = getT

() - )!>var implicitType4 = getT>() - )!>var implicitType5 = getT>() + ")!>var implicitType4 = getT>() + ")!>var implicitType5 = getT>() - var delegateType1 by Delegate() - var delegateType2 by Delegate() + var delegateType1 by Delegate() + var delegateType2 by Delegate() var delegateType3 by Delegate

() - )!>var delegateType4 by Delegate>() - )!>var delegateType5 by Delegate>() + ")!>var delegateType4 by Delegate>() + ")!>var delegateType5 by Delegate>() abstract var I.receiver1: Int - abstract var O.receiver2: Int + abstract var O.receiver2: Int abstract var P.receiver3: Int - abstract var In<)!>I>.receiver4: Int + abstract var In<")!>I>.receiver4: Int abstract var In.receiver5: Int var X.typeParameter1: Int get() = 0; set(i) {} - var O> X.typeParameter2: Int get() = 0; set(i) {} + var O> X.typeParameter2: Int get() = 0; set(i) {} var X.typeParameter3: Int get() = 0; set(i) {} - var )!>I>> X.typeParameter4: Int get() = 0; set(i) {} + var ")!>I>> X.typeParameter4: Int get() = 0; set(i) {} var > X.typeParameter5: Int get() = 0; set(i) {} var X.typeParameter6: Int where X : I get() = 0; set(i) {} - var X.typeParameter7: Int where X : O get() = 0; set(i) {} + var X.typeParameter7: Int where X : O get() = 0; set(i) {} var X.typeParameter8: Int where X : P get() = 0; set(i) {} - var X.typeParameter9: Int where X : In<)!>I> get() = 0; set(i) {} + var X.typeParameter9: Int where X : In<")!>I> get() = 0; set(i) {} var X.typeParameter0: Int where X : In get() = 0; set(i) {} } diff --git a/compiler/testData/diagnostics/tests/variance/privateToThis/FunctionCall.kt b/compiler/testData/diagnostics/tests/variance/privateToThis/FunctionCall.kt index 01561b75c39..438996b8560 100644 --- a/compiler/testData/diagnostics/tests/variance/privateToThis/FunctionCall.kt +++ b/compiler/testData/diagnostics/tests/variance/privateToThis/FunctionCall.kt @@ -15,23 +15,23 @@ class Test { apply(this.foo()) with(Test()) { apply(foo()) // resolved to this@Test.foo - apply(this.foo()) - apply(this@with.foo()) + apply(this.foo()) + apply(this@with.foo()) apply(this@Test.foo()) } } fun test(t: Test) { - t.apply(t.foo()) + t.apply(t.foo()) } companion object { fun test(t: Test) { - t.apply(t.foo()) + t.apply(t.foo()) } } } fun test(t: Test) { - t.apply(t.foo()) + t.apply(t.foo()) } diff --git a/compiler/testData/diagnostics/tests/variance/privateToThis/GetVal.kt b/compiler/testData/diagnostics/tests/variance/privateToThis/GetVal.kt index b951122ad75..b63854a2012 100644 --- a/compiler/testData/diagnostics/tests/variance/privateToThis/GetVal.kt +++ b/compiler/testData/diagnostics/tests/variance/privateToThis/GetVal.kt @@ -15,23 +15,23 @@ class Test { apply(this.i) with(Test()) { apply(i) // resolved to this@Test.i - apply(this.i) - apply(this@with.i) + apply(this.i) + apply(this@with.i) apply(this@Test.i) } } fun test(t: Test) { - t.apply(t.i) + t.apply(t.i) } companion object { fun test(t: Test) { - t.apply(t.i) + t.apply(t.i) } } } fun test(t: Test) { - t.apply(t.i) + t.apply(t.i) } diff --git a/compiler/testData/diagnostics/tests/variance/privateToThis/SetVar.kt b/compiler/testData/diagnostics/tests/variance/privateToThis/SetVar.kt index 9e1387d398f..66d588b6f3d 100644 --- a/compiler/testData/diagnostics/tests/variance/privateToThis/SetVar.kt +++ b/compiler/testData/diagnostics/tests/variance/privateToThis/SetVar.kt @@ -15,23 +15,23 @@ class Test { this.i = getT() with(Test()) { i = getT() // resolved to this@Test.i - this.i = getT() - this@with.i = getT() + this.i = getT() + this@with.i = getT() this@Test.i = getT() } } fun test(t: Test) { - t.i = getT() + t.i = getT() } companion object { fun test(t: Test) { - t.i = getT() + t.i = getT() } } } fun test(t: Test) { - t.i = getT() + t.i = getT() } diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/javaAnnotationWithVarargArgument.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/javaAnnotationWithVarargArgument.kt index 00348297f80..fe5c333ca20 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/javaAnnotationWithVarargArgument.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/javaAnnotationWithVarargArgument.kt @@ -6,6 +6,6 @@ public @interface A { } // FILE: b.kt -@A(*arrayOf(1, "b")) +@A(*", "IGNORE")!>arrayOf(1, "b")) fun test() { } diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/kotlinAnnotationWithVarargArgument.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/kotlinAnnotationWithVarargArgument.kt index 87eb60ef350..c6d1912c46e 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/kotlinAnnotationWithVarargArgument.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/kotlinAnnotationWithVarargArgument.kt @@ -2,6 +2,6 @@ annotation class B(vararg val args: String) -@B(*arrayOf(1, "b")) +@B(*", "IGNORE")!>arrayOf(1, "b")) fun test() { } diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/booleanComparisons.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/booleanComparisons.kt index 42a263fb8f5..cd0b9265fb0 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/booleanComparisons.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/booleanComparisons.kt @@ -7,7 +7,7 @@ import kotlin.contracts.* fun foo(b: Boolean): Boolean { contract { // pointless, can be reduced to just "b" - returns(true) implies (b == true) + returns(true) implies (b == true) } return b @@ -16,7 +16,7 @@ fun foo(b: Boolean): Boolean { fun bar(b: Boolean?): Boolean { contract { // not pointless, but not supported yet - returns(true) implies (b == true) + returns(true) implies (b == true) } if (b == null) throw java.lang.IllegalArgumentException("") return b diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/callInContractDescription.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/callInContractDescription.kt index 16a03604f39..0df71d3932a 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/callInContractDescription.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/callInContractDescription.kt @@ -8,7 +8,7 @@ fun bar(x: Int): Boolean = x == 0 fun foo(x: Int): Boolean { contract { - returns(true) implies (bar(x)) + returns(true) implies (bar(x)) } return x == 0 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/emptyContract.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/emptyContract.kt index 55244799a6a..0194cc135c0 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/emptyContract.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/emptyContract.kt @@ -5,5 +5,5 @@ import kotlin.contracts.* fun emptyContract() { - contract { } + contract { } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/illegalConstructionInContractBlock.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/illegalConstructionInContractBlock.kt index 6cb191fcd8b..c2ef94f16e2 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/illegalConstructionInContractBlock.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/illegalConstructionInContractBlock.kt @@ -6,7 +6,7 @@ import kotlin.contracts.* fun ifInContract(x: Any?, boolean: Boolean) { contract { - if (boolean) { + if (boolean) { returns() implies (x is String) } else { returns() implies (x is Int) @@ -16,7 +16,7 @@ fun ifInContract(x: Any?, boolean: Boolean) { fun whenInContract(x: Any?, boolean: Boolean) { contract { - when (boolean) { + when (boolean) { true -> returns() implies (x is String) else -> returns() implies (x is Int) } @@ -25,7 +25,7 @@ fun whenInContract(x: Any?, boolean: Boolean) { fun forInContract(x: Any?) { contract { - for (i in 0..1) { + for (i in 0..1) { returns() implies (x is String) } } @@ -33,7 +33,7 @@ fun forInContract(x: Any?) { fun whileInContract(x: Any?) { contract { - while (false) { + while (false) { returns() implies (x is String) } } @@ -41,7 +41,7 @@ fun whileInContract(x: Any?) { fun doWhileInContract(x: Any?) { contract { - do { + do { returns() implies (x is String) } while (false) } @@ -49,7 +49,7 @@ fun doWhileInContract(x: Any?) { fun localValInContract(x: Any?) { contract { - val y: Int = 42 + val y: Int = 42 returns() implies (x is String) } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/illegalEqualsCondition.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/illegalEqualsCondition.kt index 0de7636b761..7e872d33061 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/illegalEqualsCondition.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/illegalEqualsCondition.kt @@ -6,25 +6,25 @@ import kotlin.contracts.* fun equalsWithVariables(x: Any?, y: Any?) { contract { - returns() implies (x == y) + returns() implies (x == y) } } fun identityEqualsWithVariables(x: Any?, y: Any?) { contract { - returns() implies (x === y) + returns() implies (x === y) } } fun equalConstants() { contract { - returns() implies (null == null) + returns() implies (null == null) } } fun get(): Int? = null fun equalNullWithCall() { contract { - returns() implies (get() == null) + returns() implies (get() == null) } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/nestedConditionalEffects.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/nestedConditionalEffects.kt index ef981d25777..9971d4c06d0 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/nestedConditionalEffects.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/nestedConditionalEffects.kt @@ -5,7 +5,7 @@ import kotlin.contracts.* fun foo(boolean: Boolean) { - contract { + contract { (returns() implies (boolean)) implies (!boolean) } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/nonLambdaLiteralAsArgument.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/nonLambdaLiteralAsArgument.kt index 58f1c722e7f..d5c37299a3f 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/nonLambdaLiteralAsArgument.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/nonLambdaLiteralAsArgument.kt @@ -5,11 +5,11 @@ import kotlin.contracts.* fun passLambdaValue(l: ContractBuilder.() -> Unit) { - contract(l) + contract(l) } fun passAnonymousFunction(x: Boolean) { - contract(fun ContractBuilder.() { + contract(fun ContractBuilder.() { returns() implies x }) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/notFirstStatement.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/notFirstStatement.kt index 3010c74eb2d..2e3869d4cd6 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/notFirstStatement.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/notFirstStatement.kt @@ -6,7 +6,7 @@ import kotlin.contracts.* fun foo(y: Boolean) { val x: Int = 42 - contract { + contract { returns() implies y } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/typeReferences.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/typeReferences.kt index 33de1fc06b2..d18bc5ea8b7 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/typeReferences.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/typeReferences.kt @@ -6,20 +6,20 @@ import kotlin.contracts.* inline fun referToReifiedGeneric(x: Any?) { contract { - returns() implies (x is T) + returns() implies (x is T) } } class Generic { fun referToCaptured(x: Any?) { - contract { + contract { returns() implies (x is T) } } } fun referToSubstituted(x: Any?) { - contract { + contract { returns() implies (x is Generic) } } @@ -35,13 +35,13 @@ typealias FunctionalType = () -> Unit typealias SimpleType = Int fun referToAliasedGeneric(x: Any?) { - contract { + contract { returns() implies (x is GenericString) } } fun referToAliasedFunctionType(x: Any?) { - contract { + contract { returns() implies (x is FunctionalType) } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/unlabeledReceiver.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/unlabeledReceiver.kt index 3441c1d8c0d..6473449af37 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/unlabeledReceiver.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/unlabeledReceiver.kt @@ -6,7 +6,7 @@ import kotlin.contracts.* fun Any?.foo(): Boolean { contract { - returns(true) implies (?)!>this != null) + returns(true) implies (?")!>this != null) } return this != null } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/java/inheritedFunctionN.kt b/compiler/testData/diagnostics/testsWithStdLib/java/inheritedFunctionN.kt index 899e91e412a..7004a4fbdeb 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/java/inheritedFunctionN.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/java/inheritedFunctionN.kt @@ -9,8 +9,8 @@ public class A { // FILE: main.kt -class !\): Unit defined in A)!>B : A() +class !): Unit defined in A")!>B : A() fun foo() { - !\): Unit defined in A)!>object : A() {} + !): Unit defined in A")!>object : A() {} } diff --git a/compiler/testData/foreignAnnotations/tests/androidRecently.kt b/compiler/testData/foreignAnnotations/tests/androidRecently.kt index b3fb86ddab4..d1e0d25799b 100644 --- a/compiler/testData/foreignAnnotations/tests/androidRecently.kt +++ b/compiler/testData/foreignAnnotations/tests/androidRecently.kt @@ -27,8 +27,8 @@ public class A { fun main(a: A, a1: A) { a.foo("", null)?.length - a.foo("", null).length - a.foo(null, "").length + a.foo("", null).length + a.foo(null, "").length a.bar().length a.bar()!!.length diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullable.kt b/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullable.kt index bc0582d04d6..47af51393bd 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullable.kt +++ b/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullable.kt @@ -69,7 +69,7 @@ public class A { fun main(a: A) { a.foo("", null)?.length a.foo("", null).length - a.foo(null, "").length + a.foo(null, "").length a.bar().length a.bar()!!.length @@ -77,7 +77,7 @@ fun main(a: A) { a.field?.length a.field.length - ?)!>a.baz().get(0) + ?")!>a.baz().get(0) a.baz()!!.get(0).get(0) a.baz()!!.get(0)?.get(0) }