diff --git a/compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.1.kt b/compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.1.kt index 805661ceae1..c0b14aa1dca 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.1.kt @@ -11,9 +11,10 @@ * DESCRIPTION: Abstract classes may contain one or more abstract members, which should be implemented in a subtype of this abstract class */ -// TESTCASE NUMBER: 1 - -open abstract class Base { +// FILE: TestCase1.kt +// TESTCASE NUMBER:1 +package testPackCase1 +open abstract class Base { abstract val a: Any abstract var b: Any @@ -24,22 +25,34 @@ abstract fun foo() internal abstract fun boo(): Any } - fun case1() { - val impl = BaseImplCase2(1, "1", 1.0) + val impl = BaseImplCase1(1, "1", 1.0) } -class BaseImplCase2( +class BaseImplCase1( override var a: Any, override val b: Any, override var c: Any, override - val d: Any = "5") : Base() + val d: Any = "5") : Base() { override fun foo() {} override internal fun boo() {} } +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 +package testPackCase2 +open abstract class Base { + + abstract val a: Any + abstract var b: Any + internal abstract val c: Any + internal abstract var d: Any + + + abstract fun foo() + internal abstract fun boo(): Any +} fun case2() { val impl = ImplBaseCase2() @@ -68,10 +81,22 @@ class ImplBaseCase2() : Base() { } } -/* -* TESTCASE NUMBER: 3 -* NOTE: property is not implemented -*/ +// FILE: TestCase.kt +// TESTCASE NUMBER: 3 + +package testPackCase3 +open abstract class Base { + + abstract val a: Any + abstract var b: Any + internal abstract val c: Any + internal abstract var d: Any + + + abstract fun foo() + internal abstract fun boo(): Any +} + fun case3() { ImplBaseCase3() } @@ -95,10 +120,21 @@ fun case3() { } } -/* -* TESTCASE NUMBER: 4 -* NOTE: function is not implemented -*/ +// FILE: TestCase.kt +// TESTCASE NUMBER: 4 +package testPackCase4 +open abstract class Base { + + abstract val a: Any + abstract var b: Any + internal abstract val c: Any + internal abstract var d: Any + + + abstract fun foo() + internal abstract fun boo(): Any +} + fun case4() { ImplBaseCase4() @@ -125,4 +161,4 @@ fun case4() { * TESTCASE NUMBER: 5 * NOTE: incompatible modifiers final and abstract */ -final abstract class Case5() {} \ No newline at end of file +final abstract class Case5() {} \ No newline at end of file diff --git a/compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.2.kt b/compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.2.kt index d4dff507f43..0b401ffd368 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.2.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.2.kt @@ -11,7 +11,9 @@ * DESCRIPTION: Abstract classes may contain abstract members, which should be implemented in an anonymous class that inherits from that abstract type */ +// FILE: TestCase.kt // TESTCASE NUMBER: 1 +package testPackCase1 private abstract class Base { abstract val a: Any @@ -24,7 +26,6 @@ private abstract class Base { internal abstract fun boo(): Any } - fun case1() { val impl = object : Base() { override var a: Any @@ -47,11 +48,26 @@ fun case1() { } - +// FILE: TestCase.kt /* -* TESTCASE NUMBER: 2 -* NOTE: property is not implemented -*/ + * TESTCASE NUMBER: 2 + * NOTE: property is not implemented + */ +package testPackCase2 +private abstract class Base { + + abstract val a: Any + abstract var b: Any + internal abstract val c: Any + internal abstract var d: Any + + + abstract fun foo() + internal abstract fun boo(): Any +} + + + fun case2() { val impl = object : Base() { override var b: Any @@ -74,10 +90,20 @@ fun case2() { } -/* -* TESTCASE NUMBER: 3 -* NOTE: function is not implemented -*/ +// FILE: TestCase.kt +// TESTCASE NUMBER: 3 +package testPackCase3 +private abstract class Base { + + abstract val a: Any + abstract var b: Any + internal abstract val c: Any + internal abstract var d: Any + + + abstract fun foo() + internal abstract fun boo(): Any +} fun case3() { val impl = object : Base() { diff --git a/compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.3.kt b/compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.3.kt index d7a22bc3fea..83eccc25071 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.3.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.3.kt @@ -11,7 +11,9 @@ * DESCRIPTION: attempt to implement abstract members with invalid types */ +// FILE: TestCase.kt // TESTCASE NUMBER: 1 +package testPackCase1 abstract class Base { abstract val a: CharSequence abstract var b: CharSequence @@ -34,9 +36,16 @@ class Case1 : Base() { } -/* -* TESTCASE NUMBER: 2 -*/ + +// FILE: TestCase.kt +// TESTCASE NUMBER: 2 +package testPackCase2 +abstract class Base { + abstract val a: CharSequence + abstract var b: CharSequence + + abstract fun foo(): CharSequence +} class Case2(override val a: String, override var b: String) : Base() { override fun foo(): CharSequence? { @@ -44,10 +53,16 @@ class Case2(override val a: String, override var b: class ImplBase1 : MainClass.Base1() {} diff --git a/compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/testsMap.json index 443410d3270..d28eb3505b1 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/testsMap.json +++ b/compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/testsMap.json @@ -64,7 +64,7 @@ }, { "specVersion": "0.1-213", - "casesNumber": 1, + "casesNumber": 3, "description": "Abstract classes may contain abstract members, which should be implemented in an anonymous class that inherits from that abstract type", "path": "compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.2.kt", "unexpectedBehaviour": false, @@ -72,7 +72,7 @@ }, { "specVersion": "0.1-213", - "casesNumber": 1, + "casesNumber": 3, "description": "attempt to implement abstract members with invalid types", "path": "compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.3.kt", "unexpectedBehaviour": false, @@ -128,7 +128,7 @@ }, { "specVersion": "0.1-213", - "casesNumber": 2, + "casesNumber": 4, "description": "Abstract classes may contain one or more abstract members, which should be implemented in a subtype of this abstract class", "path": "compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.1.kt", "unexpectedBehaviour": false, diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.1.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.1.kt index 7c0cfd9834c..2e56582c7f5 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.1.kt @@ -11,12 +11,11 @@ * DESCRIPTION: check the type of jump expressions is Nothing and code placed on the left side of expression will never be executed */ - // TESTCASE NUMBER: 1 fun case1() { var name: Any? = null - val men = arrayListOf(Person("Phill"), Person(), Person("Bob")) + val men = arrayListOf(Person1("Phill"), Person1(), Person1("Bob")) for (k in men) { k.name loop@ for (i in men) { @@ -31,13 +30,13 @@ fun case1() { val a = 1 } -class Person(var name: String? = null) {} +class Person1(var name: String? = null) {} // TESTCASE NUMBER: 2 fun case2() { var name: Any? = null - val men = arrayListOf(Person("Phill"), Person(), Person("Bob")) + val men = arrayListOf(Person2("Phill"), Person2(), Person2("Bob")) for (k in men) { loop@ for (i in men) { i.name @@ -51,6 +50,8 @@ fun case2() { val a = 1 } +class Person2(var name: String? = null) {} + // TESTCASE NUMBER: 3 fun case3() { diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics/kotlin.unit/p-1/pos/1.1.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics/kotlin.unit/p-1/pos/1.1.kt index b7e3df9a1df..52a9ecbc5bb 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics/kotlin.unit/p-1/pos/1.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics/kotlin.unit/p-1/pos/1.1.kt @@ -42,11 +42,11 @@ fun case2() { } // TESTCASE NUMBER: 3 -interface Processable { +interface ProcessableCase3 { fun process(): T } -class Processor : Processable { +class Processor : ProcessableCase3 { override fun process() { val proc = "case 3" } @@ -58,6 +58,10 @@ fun case3() { } // TESTCASE NUMBER: 4 +interface Processable { + fun process(): T +} + fun case4() { val p2 = object : Processable { override fun process() { diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-5/pos/1.1.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-5/pos/1.1.kt index ad9cfc2efc2..1c80d146ccc 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-5/pos/1.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-5/pos/1.1.kt @@ -14,28 +14,38 @@ * HELPERS: checkType */ -class A(val a: Int) { - var isCompared = false - operator fun compareTo(other: A): Int = run { - isCompared = true - this.a - other.a - } -} + // TESTCASE NUMBER: 1 fun case1() { - val a1 = A(-1) - val a2 = A(-3) + val a1 = A1(-1) + val a2 = A1(-3) val x = a1 < a2 x checkType { check() } } +class A1(val a: Int) { + var isCompared = false + operator fun compareTo(other: A1): Int = run { + isCompared = true + this.a - other.a + } +} + // TESTCASE NUMBER: 2 +class A2(val a: Int) { + var isCompared = false + operator fun compareTo(other: A2): Int = run { + isCompared = true + this.a - other.a + } +} + fun case2() { - val a1 = A(-1) - val a2 = A(-3) + val a1 = A2(-1) + val a2 = A2(-3) val x = a1 > a2 @@ -44,20 +54,36 @@ fun case2() { // TESTCASE NUMBER: 3 fun case3() { - val a1 = A(-1) - val a2 = A(-3) + val a1 = A3(-1) + val a2 = A3(-3) val x = a1 <= a2 x checkType { check() } } +class A3(val a: Int) { + var isCompared = false + operator fun compareTo(other: A3): Int = run { + isCompared = true + this.a - other.a + } +} + // TESTCASE NUMBER: 4 fun case4() { - val a1 = A(-1) - val a2 = A(-3) + val a1 = A4(-1) + val a2 = A4(-3) val x = a1 >= a2 x checkType { check() } +} + +class A4(val a: Int) { + var isCompared = false + operator fun compareTo(other: A4): Int = run { + isCompared = true + this.a - other.a + } } \ No newline at end of file diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/boolean-literals/p-1/pos/2.1.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/boolean-literals/p-1/pos/2.1.kt index 0fa2bf7bbef..6f3ecabb2a7 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/boolean-literals/p-1/pos/2.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/boolean-literals/p-1/pos/2.1.kt @@ -13,6 +13,8 @@ * HELPERS: checkType */ +// FILE: TestCases.kt + // TESTCASE NUMBER: 1 fun case1() { @@ -59,7 +61,12 @@ interface `true`{} interface `false`{} +// FILE: TestCase7.kt // TESTCASE NUMBER: 7 +package testPackCase7c + +interface `true`{} +interface `false`{} fun case7() { class `true` : `false`{} diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/equality-expressions/value-equality-expressions/p-3/pos/1.1.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/equality-expressions/value-equality-expressions/p-3/pos/1.1.kt index d212f0ba119..30d609f4675 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/equality-expressions/value-equality-expressions/p-3/pos/1.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/equality-expressions/value-equality-expressions/p-3/pos/1.1.kt @@ -13,7 +13,6 @@ * DESCRIPTION: Value equality expressions always have type kotlin.Boolean as does the equals method in kotlin.Any * HELPERS: checkType */ -data class A(val a: Boolean) // TESTCASE NUMBER: 1 @@ -22,12 +21,16 @@ fun case1() { x checkType { check() } } +data class A(val a: Boolean) + // TESTCASE NUMBER: 2 fun case2() { - val x = A(false) == A(false) + val x = A1(false) == A1(false) x checkType { check() } } +data class A1(val a: Boolean) + // TESTCASE NUMBER: 3 fun case3() { val x = true == false diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/p-2/pos/1.1.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/p-2/pos/1.1.kt index 6850800ca72..e16573bc94c 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/p-2/pos/1.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/p-2/pos/1.1.kt @@ -12,6 +12,8 @@ * DESCRIPTION: check he type of jump expressions is the kotlin.Nothing */ + + // TESTCASE NUMBER: 1 fun case1() { @@ -27,14 +29,13 @@ fun case1() { s } } - class Person(var name: String? = null) {} // TESTCASE NUMBER: 2 fun case2() { var name: Any? = null - val men = arrayListOf(Person("Phill"), Person(), Person("Bob")) + val men = arrayListOf(Person2("Phill"), Person2(), Person2("Bob")) for (k in men) { loop@ for (i in men) { val val1 = continue@loop @@ -45,6 +46,8 @@ fun case2() { } } +class Person2(var name: String? = null) {} + // TESTCASE NUMBER: 3 fun case3() { diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-decrement-expression/p-4/neg/1.1.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-decrement-expression/p-4/neg/1.1.kt index 3f1ee483089..2c4bc9a0523 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-decrement-expression/p-4/neg/1.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-decrement-expression/p-4/neg/1.1.kt @@ -11,14 +11,7 @@ * NUMBER: 1 * DESCRIPTION: check unsafe prefix decrement expression call for an assignable expression */ -class A() { - var i = 0 - operator fun dec(): A { - this.i-- - return this - } -} // TESTCASE NUMBER: 1 @@ -32,6 +25,15 @@ class Case1() { var a: A = A() } +class A() { + var i = 0 + + operator fun dec(): A { + this.i-- + return this + } +} + // TESTCASE NUMBER: 2 fun case2() { @@ -40,5 +42,14 @@ fun case2() { } class Case2() { - val a = A() + val a = A2() +} + +class A2() { + var i = 0 + + operator fun dec(): A2 { + this.i-- + return this + } } \ No newline at end of file diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-increment-expression/p-4/neg/1.1.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-increment-expression/p-4/neg/1.1.kt index 4c9c5592894..459fda37bd8 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-increment-expression/p-4/neg/1.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-increment-expression/p-4/neg/1.1.kt @@ -11,6 +11,12 @@ * NUMBER: 1 * DESCRIPTION: check unsafe prefix increment expression call for an assignable expression */ + + +// FILE: TestCase.kt +// TESTCASE NUMBER: 1 +package testPackCase1 + class A() { var i = 0 @@ -20,8 +26,6 @@ class A() { } } -// TESTCASE NUMBER: 1 - fun case1() { var b: Case1? = Case1() ++b?.a @@ -32,7 +36,18 @@ class Case1() { var a: A = A() } +// FILE: TestCase.kt // TESTCASE NUMBER: 2 +package testPackCase2 + +class A() { + var i = 0 + + operator fun inc(): A { + this.i++ + return this + } +} fun case2() { var b= Case2() diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-8/neg/1.1.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-8/neg/1.1.kt index 82521f98386..9511601d3f2 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-8/neg/1.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-8/neg/1.1.kt @@ -11,15 +11,22 @@ * NUMBER: 1 * DESCRIPTION: The type of the try-expression is the least upper bound of the types of the last expressions of the try body and the last expressions of all the catch blocks */ + +// FILE: TestCase.kt +// TESTCASE NUMBER: 1 +package testPackCase1 + fun throwExceptionA(b: Boolean) = run { if (b) throw ExcA() } +class ExcA() : Exception() +class ExcB() : Exception() + open class A(var data: T) { fun foo(d: A) {} } class B(data: T) : A(data) -// TESTCASE NUMBER: 1 fun case1() { val tryVal: B = @@ -29,11 +36,24 @@ fun case1() { } catch (e: Exception) { B("") } - - } +// FILE: TestCase.kt // TESTCASE NUMBER: 2 +package testPackCase2 + +fun throwExceptionA(b: Boolean) = run { if (b) throw ExcA() } + +class ExcA() : Exception() +class ExcB() : Exception() + +open class A(var data: T) { + fun foo(d: A) {} +} + +class B(data: T) : A(data) + + fun case2() { val tryVal: A = @@ -45,10 +65,20 @@ fun case2() { } } -/* - * TESTCASE NUMBER: 3 - * ISSUES: KT-35494 - */ + +// FILE: TestCase.kt +// TESTCASE NUMBER: 3 +// ISSUES: KT-35494 +package testPackCase3 + +fun throwExceptionA(b: Boolean) = run { if (b) throw ExcA() } + +open class A(var data: T) { + fun foo(d: A) {} +} + +class B(data: T) : A(data) + fun case3() { val tryVal: A = try { diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/type-checking-and-containment-checking-expressions/containment-checking-expression/p-5/pos/2.1.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/type-checking-and-containment-checking-expressions/containment-checking-expression/p-5/pos/2.1.kt index 2444c3a75bd..2cd2ebfb992 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/type-checking-and-containment-checking-expressions/containment-checking-expression/p-5/pos/2.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/type-checking-and-containment-checking-expressions/containment-checking-expression/p-5/pos/2.1.kt @@ -13,6 +13,13 @@ * HELPERS: checkType */ + +// FILE: TestCase.kt +// TESTCASE NUMBER: 1 +package testPackCase1 +import checkType +import check + class A(val a: Set) { operator fun contains(other: Any?): Boolean = run { this.a.contains(other) } @@ -27,7 +34,6 @@ class C() { } } -// TESTCASE NUMBER: 1 fun case1() { val b = A(mutableSetOf(1, C(), 3, false, 2, "azaza")) val c = C() @@ -35,14 +41,52 @@ fun case1() { a checkType { check() } } +// FILE: TestCase.kt // TESTCASE NUMBER: 2 +package testPackCase2 +import checkType +import check + +class A(val a: Set) { + operator fun contains(other: Any?): Boolean = run { this.a.contains(other) } + + fun throwException(b: Boolean): A { if (b) throw Exception() else return this } +} + +class C() { + var isEvaluated: Boolean = false + fun foo(): C { + this.isEvaluated = true + return this + } +} + fun case2() { val b = A(mutableSetOf(1, C(), 3, false, 2, "azaza")) val a = (null in b) a checkType { check() } } +// FILE: TestCase.kt // TESTCASE NUMBER: 3 +package testPackCase3 +import checkType +import check + +class A(val a: Set) { + operator fun contains(other: Any?): Boolean = run { this.a.contains(other) } + + fun throwException(b: Boolean): A { if (b) throw Exception() else return this } +} + +class C() { + var isEvaluated: Boolean = false + fun foo(): C { + this.isEvaluated = true + return this + } +} + fun case3() { val b = A(mutableSetOf(1, C(), 3, false, 2, "azaza")) val x = "" @@ -50,7 +94,26 @@ fun case3() { a checkType { check() } } +// FILE: TestCase.kt // TESTCASE NUMBER: 4 +package testPackCase4 +import checkType +import check + +class A(val a: Set) { + operator fun contains(other: Any?): Boolean = run { this.a.contains(other) } + + fun throwException(b: Boolean): A { if (b) throw Exception() else return this } +} + +class C() { + var isEvaluated: Boolean = false + fun foo(): C { + this.isEvaluated = true + return this + } +} + fun case4(nothing: Nothing) { val b = A(mutableSetOf(1, C(), 3, false, 2, "azaza")) val a = (nothing in b) diff --git a/compiler/tests-spec/testData/diagnostics/linked/statements/assignments/operator-assignments/p-2/neg/1.1.kt b/compiler/tests-spec/testData/diagnostics/linked/statements/assignments/operator-assignments/p-2/neg/1.1.kt index f344c3c3af5..fdef319ecb4 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/statements/assignments/operator-assignments/p-2/neg/1.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/statements/assignments/operator-assignments/p-2/neg/1.1.kt @@ -15,6 +15,12 @@ */ +// TESTCASE NUMBER: 1 +fun case1() { + var b = B(1) + b += 1 +} + class B(var a: Int) { operator fun plus(value: Int): B { a= a + value @@ -24,9 +30,3 @@ class B(var a: Int) { a= a + value } } - -// TESTCASE NUMBER: 1 -fun case1() { - var b = B(1) - b += 1 -} \ No newline at end of file diff --git a/compiler/tests-spec/testData/diagnostics/linked/statements/assignments/operator-assignments/p-2/pos/1.1.kt b/compiler/tests-spec/testData/diagnostics/linked/statements/assignments/operator-assignments/p-2/pos/1.1.kt index 5409cc80409..74196bf838a 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/statements/assignments/operator-assignments/p-2/pos/1.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/statements/assignments/operator-assignments/p-2/pos/1.1.kt @@ -15,6 +15,11 @@ * DESCRIPTION: An operator assignment A+=B */ +// TESTCASE NUMBER: 1 +fun case1() { + val b = B(1) + b += 1 +} class B(var a: Int) { operator fun plus(value: Int): B { @@ -24,10 +29,4 @@ class B(var a: Int) { operator fun plusAssign(value: Int): Unit { a= a + value } -} - -// TESTCASE NUMBER: 1 -fun case1() { - val b = B(1) - b += 1 } \ No newline at end of file diff --git a/compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.nothing/p-1/pos/1.1.kt b/compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.nothing/p-1/pos/1.1.kt index 83835c8a098..a385f6588e9 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.nothing/p-1/pos/1.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.nothing/p-1/pos/1.1.kt @@ -16,14 +16,16 @@ */ - +// FILE: TestCase1.kt +// TESTCASE NUMBER: 1 +package testPackCase1 +import checkSubtype class NothingWrapper() { val data: Nothing = TODO() } class CustomClass() {} -// TESTCASE NUMBER: 1 fun case1() { val wrapper: NothingWrapper = NothingWrapper() checkSubtype(wrapper.data) @@ -39,7 +41,16 @@ fun case1() { checkSubtype(wrapper.data) } +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 +package testPackCase2 +import checkSubtype +class NothingWrapper() { + val data: Nothing = TODO() +} + +class CustomClass() {} + fun case2(wrapper: NothingWrapper) { checkSubtype>(wrapper.data) checkSubtype>(wrapper.data) @@ -48,5 +59,4 @@ fun case2(wrapper: NothingWrapper) { checkSubtype>(wrapper.data) checkSubtype(wrapper.data) - } \ No newline at end of file