diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/diagnostics/FirDiagnostics.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/diagnostics/FirDiagnostics.kt index 510f3bbf04a..a13458613d3 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/diagnostics/FirDiagnostics.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/diagnostics/FirDiagnostics.kt @@ -14,7 +14,7 @@ import org.jetbrains.kotlin.name.ClassId import org.jetbrains.kotlin.name.Name class FirUnresolvedReferenceError(val name: Name? = null) : FirDiagnostic() { - override val reason: String get() = "Unresolved reference" + (name?.asString() ?: "") + override val reason: String get() = "Unresolved reference" + if (name != null) ": ${name.asString()}" else "" } class FirUnresolvedSymbolError(val classId: ClassId) : FirDiagnostic() { diff --git a/compiler/fir/resolve/testData/resolve/arguments/default.kt b/compiler/fir/resolve/testData/resolve/arguments/default.kt index 762f7da88ac..933b0b52f39 100644 --- a/compiler/fir/resolve/testData/resolve/arguments/default.kt +++ b/compiler/fir/resolve/testData/resolve/arguments/default.kt @@ -8,19 +8,19 @@ fun test() { foo(1, 2.0, true) foo(1, third = true) - foo() - foo(0, 0.0, false, "") + foo() + foo(0, 0.0, false, "") bar(1, third = true) bar(1, 2.0, true) bar(1, 2.0, true, "my") - bar(1, true) + bar(1, true) baz(1) baz(1, "my", "yours") baz(1, z = true) - baz(0, "", false) + baz(0, "", false) } diff --git a/compiler/fir/resolve/testData/resolve/arguments/lambda.kt b/compiler/fir/resolve/testData/resolve/arguments/lambda.kt index acc2e223bf2..0c2c596a69f 100644 --- a/compiler/fir/resolve/testData/resolve/arguments/lambda.kt +++ b/compiler/fir/resolve/testData/resolve/arguments/lambda.kt @@ -8,21 +8,21 @@ fun test() { foo() {} foo({}) - foo(1) {} - foo(f = {}) {} + foo(1) {} + foo(f = {}) {} bar(1) {} bar(x = 1) {} bar(1, {}) bar(x = 1, f = {}) - bar {} - bar({}) + bar {} + bar({}) baz(other = false, f = {}) baz({}, false) - baz {} - baz() {} - baz(other = false) {} + baz {} + baz() {} + baz(other = false) {} } \ No newline at end of file diff --git a/compiler/fir/resolve/testData/resolve/arguments/simple.kt b/compiler/fir/resolve/testData/resolve/arguments/simple.kt index feaefbc3214..7967530d7d9 100644 --- a/compiler/fir/resolve/testData/resolve/arguments/simple.kt +++ b/compiler/fir/resolve/testData/resolve/arguments/simple.kt @@ -7,11 +7,11 @@ fun test() { foo(1, second = 3.14, third = false, fourth = "!?") foo(third = false, second = 2.71, fourth = "?!", first = 0) - foo() - foo(0.0, false, 0, "") - foo(1, 2.0, third = true, "") - foo(second = 0.0, first = 0, fourth = "") - foo(first = 0.0, second = 0, third = "", fourth = false) - foo(first = 0, second = 0.0, third = false, fourth = "", first = 1) - foo(0, 0.0, false, foth = "") + foo() + foo(0.0, false, 0, "") + foo(1, 2.0, third = true, "") + foo(second = 0.0, first = 0, fourth = "") + foo(first = 0.0, second = 0, third = "", fourth = false) + foo(first = 0, second = 0.0, third = false, fourth = "", first = 1) + foo(0, 0.0, false, foth = "") } \ No newline at end of file diff --git a/compiler/fir/resolve/testData/resolve/arguments/vararg.kt b/compiler/fir/resolve/testData/resolve/arguments/vararg.kt index 4702d5958cd..68bdafea581 100644 --- a/compiler/fir/resolve/testData/resolve/arguments/vararg.kt +++ b/compiler/fir/resolve/testData/resolve/arguments/vararg.kt @@ -7,11 +7,11 @@ fun test() { foo(1, "my", "yours") foo(1, *arrayOf("my", "yours")) - foo("") - foo(1, 2) + foo("") + foo(1, 2) bar(1, z = true, y = *arrayOf("my", "yours")) - bar(0, z = false, y = "", y = "other") - bar(0, "", true) + bar(0, z = false, y = "", y = "other") + bar(0, "", true) } diff --git a/compiler/fir/resolve/testData/resolve/cfg/complex.kt b/compiler/fir/resolve/testData/resolve/cfg/complex.kt index 8fe537b543d..49f02f2ea5c 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/complex.kt +++ b/compiler/fir/resolve/testData/resolve/cfg/complex.kt @@ -1,15 +1,15 @@ -@Throws(IOException::class, ResponseParseException::class) +@Throws(IOException::class, ResponseParseException::class) fun fetchPluginReleaseDate(pluginId: PluginId, version: String, channel: String?): LocalDate? { - val url = "https://plugins.jetbrains.com/api/plugins/${pluginId.idString}/updates?version=$version" + val url = "https://plugins.jetbrains.com/api/plugins/${pluginId.idString}/updates?version=$version" val pluginDTOs: Array = try { - HttpRequests.request(url).connect { + HttpRequests.request(url).connect { GsonBuilder().create().fromJson(it.inputStream.reader(), Array::class.java) - } + } } catch (ioException: JsonIOException) { - throw IOException(ioException) + throw IOException(ioException) } catch (syntaxException: JsonSyntaxException) { - throw ResponseParseException("Can't parse json response", syntaxException) + throw ResponseParseException("Can't parse json response", syntaxException) } } diff --git a/compiler/fir/resolve/testData/resolve/cfg/jumps.kt b/compiler/fir/resolve/testData/resolve/cfg/jumps.kt index 09602f88207..3ac7aa9d9ed 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/jumps.kt +++ b/compiler/fir/resolve/testData/resolve/cfg/jumps.kt @@ -13,7 +13,7 @@ fun test_2(x: Int?) { } else { x } - y.inc() + y.inc() } fun test_3(x: Int?) { diff --git a/compiler/fir/resolve/testData/resolve/expresssions/access.kt b/compiler/fir/resolve/testData/resolve/expresssions/access.kt index b96a0e0900a..2a8b03e6313 100644 --- a/compiler/fir/resolve/testData/resolve/expresssions/access.kt +++ b/compiler/fir/resolve/testData/resolve/expresssions/access.kt @@ -21,7 +21,7 @@ class Bar { } // NB! abc() here is resolved to member Foo.abc(), and not to extension member of Bar - fun Foo.check() = abc() + bar() + fun Foo.check() = abc() + bar() // NB! + here is resolved to member String.plus (not to extension member above) fun Foo.check2() = "" + bar() @@ -41,9 +41,9 @@ fun f() { val a = 10 val b = a val d = "" - val c = c + val c = c - abc() + abc() fun bcd() {} @@ -57,7 +57,7 @@ fun f() { dcb() } - dcb() + dcb() abc() } \ No newline at end of file diff --git a/compiler/fir/resolve/testData/resolve/expresssions/companion.kt b/compiler/fir/resolve/testData/resolve/expresssions/companion.kt index 9c162f4419a..74431e75404 100644 --- a/compiler/fir/resolve/testData/resolve/expresssions/companion.kt +++ b/compiler/fir/resolve/testData/resolve/expresssions/companion.kt @@ -22,5 +22,5 @@ fun test() { B.baz() val x = A.D val y = B.C - val z = B.D + val z = B.D } \ No newline at end of file diff --git a/compiler/fir/resolve/testData/resolve/expresssions/inference/typeParameters.kt b/compiler/fir/resolve/testData/resolve/expresssions/inference/typeParameters.kt index d41cc7c59f6..9f11c3fe884 100644 --- a/compiler/fir/resolve/testData/resolve/expresssions/inference/typeParameters.kt +++ b/compiler/fir/resolve/testData/resolve/expresssions/inference/typeParameters.kt @@ -7,5 +7,5 @@ fun foo(t: T) = t fun main(fooImpl: FooImpl, bar: Bar) { val a = foo(fooImpl) - val b = foo(bar) + val b = foo(bar) } \ No newline at end of file diff --git a/compiler/fir/resolve/testData/resolve/expresssions/inference/typeParameters2.kt b/compiler/fir/resolve/testData/resolve/expresssions/inference/typeParameters2.kt index fe9dbcb1be5..8e155e73b7b 100644 --- a/compiler/fir/resolve/testData/resolve/expresssions/inference/typeParameters2.kt +++ b/compiler/fir/resolve/testData/resolve/expresssions/inference/typeParameters2.kt @@ -6,6 +6,6 @@ fun foo(t: T) = t fun main(fooImpl: FooImpl, fooBarImpl: FooBarImpl) { - val a = foo(fooBarImpl) + val a = foo(fooBarImpl) val b = foo(fooImpl) } \ No newline at end of file diff --git a/compiler/fir/resolve/testData/resolve/expresssions/invoke/threeReceivers.kt b/compiler/fir/resolve/testData/resolve/expresssions/invoke/threeReceivers.kt index 9ab37a82079..f4c2db1e540 100644 --- a/compiler/fir/resolve/testData/resolve/expresssions/invoke/threeReceivers.kt +++ b/compiler/fir/resolve/testData/resolve/expresssions/invoke/threeReceivers.kt @@ -12,6 +12,6 @@ class Foo { val Buz.foobar: Bar get() = Bar() fun FooBar.chk(buz: Buz) { - buz.foobar() + buz.foobar() } } diff --git a/compiler/fir/resolve/testData/resolve/expresssions/lambdaWithReceiver.kt b/compiler/fir/resolve/testData/resolve/expresssions/lambdaWithReceiver.kt index d38dbf0d514..ad5b56a6811 100644 --- a/compiler/fir/resolve/testData/resolve/expresssions/lambdaWithReceiver.kt +++ b/compiler/fir/resolve/testData/resolve/expresssions/lambdaWithReceiver.kt @@ -3,11 +3,11 @@ interface A { } fun myWith(receiver: T, block: T.() -> Unit) { - receiver.block() + receiver.block() } fun T.myApply(block: T.() -> Unit) { - this.block() + this.block() } fun withA(block: A.() -> Unit) {} diff --git a/compiler/fir/resolve/testData/resolve/expresssions/localScopes.kt b/compiler/fir/resolve/testData/resolve/expresssions/localScopes.kt index 568c3628cc5..69ce60b3adf 100644 --- a/compiler/fir/resolve/testData/resolve/expresssions/localScopes.kt +++ b/compiler/fir/resolve/testData/resolve/expresssions/localScopes.kt @@ -23,6 +23,6 @@ fun test() { val derived = DerivedLocal() derived.gau() - derived.baz() - derived.foo() + derived.baz() + derived.foo() } \ No newline at end of file diff --git a/compiler/fir/resolve/testData/resolve/expresssions/operators/plusAndPlusAssign.kt b/compiler/fir/resolve/testData/resolve/expresssions/operators/plusAndPlusAssign.kt index 0733d749ea4..c89e1843cd2 100644 --- a/compiler/fir/resolve/testData/resolve/expresssions/operators/plusAndPlusAssign.kt +++ b/compiler/fir/resolve/testData/resolve/expresssions/operators/plusAndPlusAssign.kt @@ -5,5 +5,5 @@ class Foo { fun test() { var f = Foo() - f += f + f += f } \ No newline at end of file diff --git a/compiler/fir/resolve/testData/resolve/expresssions/operators/plusAndPlusAssign.txt b/compiler/fir/resolve/testData/resolve/expresssions/operators/plusAndPlusAssign.txt index 67179e3324d..f1b322bcb53 100644 --- a/compiler/fir/resolve/testData/resolve/expresssions/operators/plusAndPlusAssign.txt +++ b/compiler/fir/resolve/testData/resolve/expresssions/operators/plusAndPlusAssign.txt @@ -13,5 +13,5 @@ FILE: plusAndPlusAssign.kt } public final fun test(): R|kotlin/Unit| { lvar f: R|Foo| = R|/Foo.Foo|() - ERROR_EXPR(Operator overload ambiguity. plusAssign and plus are compatible) + ERROR_EXPR(Operator overload ambiguity. Compatible candidates: [/Foo.plus, /Foo.plusAssign]) } diff --git a/compiler/fir/resolve/testData/resolve/expresssions/operators/plusAssign.kt b/compiler/fir/resolve/testData/resolve/expresssions/operators/plusAssign.kt index fd87067b6c7..9d519b6f571 100644 --- a/compiler/fir/resolve/testData/resolve/expresssions/operators/plusAssign.kt +++ b/compiler/fir/resolve/testData/resolve/expresssions/operators/plusAssign.kt @@ -7,7 +7,7 @@ class Foo { fun test_1() { val f = Foo() - f + f + f + f } fun test_2() { diff --git a/compiler/fir/resolve/testData/resolve/expresssions/receiverConsistency.kt b/compiler/fir/resolve/testData/resolve/expresssions/receiverConsistency.kt index b41054cdb68..f7e43a90d67 100644 --- a/compiler/fir/resolve/testData/resolve/expresssions/receiverConsistency.kt +++ b/compiler/fir/resolve/testData/resolve/expresssions/receiverConsistency.kt @@ -6,7 +6,7 @@ class C { class Nested { fun test() { - err() + err() } } } @@ -17,5 +17,5 @@ fun test() { c.bar() val err = C() - err.foo() + err.foo() } \ No newline at end of file diff --git a/compiler/fir/resolve/testData/resolve/fromBuilder/enums.kt b/compiler/fir/resolve/testData/resolve/fromBuilder/enums.kt index d9193ae313b..5254289c608 100644 --- a/compiler/fir/resolve/testData/resolve/fromBuilder/enums.kt +++ b/compiler/fir/resolve/testData/resolve/fromBuilder/enums.kt @@ -9,17 +9,17 @@ enum class Order { enum class Planet(val m: Double, internal val r: Double) { MERCURY(1.0, 2.0) { override fun sayHello() { - println("Hello!!!") + println("Hello!!!") } }, VENERA(3.0, 4.0) { override fun sayHello() { - println("Ola!!!") + println("Ola!!!") } }, EARTH(5.0, 6.0) { override fun sayHello() { - println("Privet!!!") + println("Privet!!!") } }; diff --git a/compiler/fir/resolve/testData/resolve/fromBuilder/typeParameters.kt b/compiler/fir/resolve/testData/resolve/fromBuilder/typeParameters.kt index e267b1ada73..2dec3fea65a 100644 --- a/compiler/fir/resolve/testData/resolve/fromBuilder/typeParameters.kt +++ b/compiler/fir/resolve/testData/resolve/fromBuilder/typeParameters.kt @@ -1,7 +1,7 @@ interface List { operator fun get(index: Int): T - infix fun concat(other: List): List + infix fun concat(other: List): List } typealias StringList = List diff --git a/compiler/fir/resolve/testData/resolve/functionTypes.kt b/compiler/fir/resolve/testData/resolve/functionTypes.kt index d147e89102c..b9762085001 100644 --- a/compiler/fir/resolve/testData/resolve/functionTypes.kt +++ b/compiler/fir/resolve/testData/resolve/functionTypes.kt @@ -4,7 +4,7 @@ fun List.simpleMap(f: (T) -> R): R { } -fun simpleWith(t: T, f: T.() -> Unit): Unit = t.f() +fun simpleWith(t: T, f: T.() -> Unit): Unit = t.f() interface KMutableProperty1 : KProperty1, KMutableProperty diff --git a/compiler/fir/resolve/testData/resolve/nested/inner.kt b/compiler/fir/resolve/testData/resolve/nested/inner.kt index dba41526db9..552246a1eb8 100644 --- a/compiler/fir/resolve/testData/resolve/nested/inner.kt +++ b/compiler/fir/resolve/testData/resolve/nested/inner.kt @@ -23,7 +23,7 @@ class Owner { o.foo() foo() this@Owner.foo() - this.err() + this.err() } } } @@ -31,8 +31,8 @@ class Owner { fun test() { val o = Owner() o.foo() - val err = Owner.Inner() - err.baz() + val err = Owner.Inner() + err.baz() val i = o.Inner() i.gau() } \ No newline at end of file diff --git a/compiler/fir/resolve/testData/resolve/nested/simple.kt b/compiler/fir/resolve/testData/resolve/nested/simple.kt index 7fe3ba6591f..fa13698ff65 100644 --- a/compiler/fir/resolve/testData/resolve/nested/simple.kt +++ b/compiler/fir/resolve/testData/resolve/nested/simple.kt @@ -22,8 +22,8 @@ class Owner { } fun err() { - foo() - this.foo() + foo() + this.foo() } } } diff --git a/compiler/fir/resolve/testData/resolve/overrides/simple.kt b/compiler/fir/resolve/testData/resolve/overrides/simple.kt index 74f6740c812..cc34d3d2e91 100644 --- a/compiler/fir/resolve/testData/resolve/overrides/simple.kt +++ b/compiler/fir/resolve/testData/resolve/overrides/simple.kt @@ -14,7 +14,7 @@ class B : A() { fun test() { foo() bar() - buz() + buz() } } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/booleanOperators.kt b/compiler/fir/resolve/testData/resolve/smartcasts/booleanOperators.kt index 79913c76e2d..c0e129b999e 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/booleanOperators.kt +++ b/compiler/fir/resolve/testData/resolve/smartcasts/booleanOperators.kt @@ -23,8 +23,8 @@ fun test_1(x: Any) { fun test_2(x: Any) { if (x is B || x is C) { x.foo() - x.bar() - x.baz() + x.bar() + x.baz() } } @@ -36,20 +36,20 @@ fun test_3(x: Any) { fun test_4(x: Any) { if (x !is String || x.length == 0) { - x.length + x.length } - x.length + x.length } fun test_5(x: A?) { if (x != null || false) { - x.foo() + x.foo() } } fun test_6(x: A?) { if (false || x != null) { - x.foo() + x.foo() } } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/boundSmartcasts.kt b/compiler/fir/resolve/testData/resolve/smartcasts/boundSmartcasts.kt index bfcd44a0aa4..51ec509eab4 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/boundSmartcasts.kt +++ b/compiler/fir/resolve/testData/resolve/smartcasts/boundSmartcasts.kt @@ -29,7 +29,7 @@ fun test_3(x: Any, y: Any) { } z = y if (y is B) { - z.bar() + z.bar() } } @@ -40,7 +40,7 @@ fun test_4(y: Any) { x = y x.inc() if (y is A) { - x.foo() + x.foo() y.foo() } } \ No newline at end of file diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/casts.kt b/compiler/fir/resolve/testData/resolve/smartcasts/casts.kt index ae5cbbf2d30..f6060dd8605 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/casts.kt +++ b/compiler/fir/resolve/testData/resolve/smartcasts/casts.kt @@ -14,31 +14,31 @@ fun test_3(b: Boolean, x: Any?) { if (b && x as Boolean) { x.not() } - x.not() + x.not() if (b && x as Boolean == true) { x.not() } - x.not() + x.not() if (b || x as Boolean) { - x.not() + x.not() } - x.not() + x.not() } fun test_4(b: Any) { if (b as? Boolean != null) { b.not() } else { - b.not() + b.not() } - b.not() + b.not() if (b as? Boolean == null) { - b.not() + b.not() } else { b.not() } - b.not() + b.not() } \ No newline at end of file diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/endlessLoops.kt b/compiler/fir/resolve/testData/resolve/smartcasts/endlessLoops.kt index e0475542bbe..0693f478231 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/endlessLoops.kt +++ b/compiler/fir/resolve/testData/resolve/smartcasts/endlessLoops.kt @@ -43,7 +43,7 @@ fun test_4(x: Any, b: Boolean) { } break } - x.foo() // No smartcast + x.foo() // No smartcast } fun test_5(x: Any, b: Boolean) { diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/equalsAndIdentity.kt b/compiler/fir/resolve/testData/resolve/smartcasts/equalsAndIdentity.kt index a53fe324127..63f6fa27d39 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/equalsAndIdentity.kt +++ b/compiler/fir/resolve/testData/resolve/smartcasts/equalsAndIdentity.kt @@ -15,12 +15,12 @@ fun test_1(x: A, y: A?) { fun test_2(x: A?, y: A?) { if (x == y) { - x.foo() - y.foo() + x.foo() + y.foo() } if (x === y) { - x.foo() - y.foo() + x.foo() + y.foo() } } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/equalsToBoolean.kt b/compiler/fir/resolve/testData/resolve/smartcasts/equalsToBoolean.kt index 05614a38909..f151b158d20 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/equalsToBoolean.kt +++ b/compiler/fir/resolve/testData/resolve/smartcasts/equalsToBoolean.kt @@ -7,13 +7,13 @@ fun test_1(b: Boolean?) { if ((b == true) == true) { b.not() // OK } else { - b.not() // Bad + b.not() // Bad } } fun test_2(b: Boolean?) { if ((b == true) != true) { - b.not() // Bad + b.not() // Bad } else { b.not() // OK } @@ -21,7 +21,7 @@ fun test_2(b: Boolean?) { fun test_3(b: Boolean?) { if ((b == true) == false) { - b.not() // Bad + b.not() // Bad } else { b.not() // OK } @@ -31,13 +31,13 @@ fun test_4(b: Boolean?) { if ((b == true) != false) { b.not() // OK } else { - b.not() // Bad + b.not() // Bad } } fun test_5(b: Boolean?) { if ((b != true) == true) { - b.not() // Bad + b.not() // Bad } else { b.not() // OK } @@ -47,7 +47,7 @@ fun test_6(b: Boolean?) { if ((b != true) != true) { b.not() // OK } else { - b.not() // Bad + b.not() // Bad } } @@ -55,13 +55,13 @@ fun test_7(b: Boolean?) { if ((b != true) == false) { b.not() // OK } else { - b.not() // Bad + b.not() // Bad } } fun test_8(b: Boolean?) { if ((b != true) != false) { - b.not() // Bad + b.not() // Bad } else { b.not() // OK } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/implicitReceivers.kt b/compiler/fir/resolve/testData/resolve/smartcasts/implicitReceivers.kt index 6b47bf76cff..b813372e481 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/implicitReceivers.kt +++ b/compiler/fir/resolve/testData/resolve/smartcasts/implicitReceivers.kt @@ -9,23 +9,23 @@ fun Any?.test_1() { this.foo() foo() } else { - this.foo() - foo() + this.foo() + foo() } - this.foo() - foo() + this.foo() + foo() } fun Any?.test_2() { if (this !is A) { - this.foo() - foo() + this.foo() + foo() } else { this.foo() foo() } - this.foo() - foo() + this.foo() + foo() } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/nullability.kt b/compiler/fir/resolve/testData/resolve/smartcasts/nullability.kt index 75932b33f5b..ace76949121 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/nullability.kt +++ b/compiler/fir/resolve/testData/resolve/smartcasts/nullability.kt @@ -21,18 +21,18 @@ fun test_1(x: A?) { if (x != null) { x.foo() } else { - x.foo() + x.foo() } - x.foo() + x.foo() } fun test_2(x: A?) { if (x == null) { - x.foo() + x.foo() } else { x.foo() } - x.foo() + x.foo() } fun test_3(x: A?) { @@ -63,8 +63,8 @@ fun test_6(q: Q?) { fun test_7(q: Q?) { if (q?.fdata()?.fs()?.inc() != null) { q.fdata() // good - q.fdata().fs() // bad - q.fdata().fs().inc() // bad + q.fdata().fs() // bad + q.fdata().fs().inc() // bad } } @@ -78,42 +78,42 @@ fun test_9(a: Int, b: Int?) { if (a == b) { b.inc() } - b.inc() + b.inc() if (a === b) { b.inc() } - b.inc() + b.inc() if (b == a) { b.inc() } - b.inc() + b.inc() if (b === a) { b.inc() } - b.inc() + b.inc() } fun test_10(a: Int?, b: Int?) { if (a == b) { - b.inc() + b.inc() } - b.inc() + b.inc() if (a === b) { - b.inc() + b.inc() } - b.inc() + b.inc() if (b == a) { - b.inc() + b.inc() } - b.inc() + b.inc() if (b === a) { - b.inc() + b.inc() } - b.inc() + b.inc() } \ No newline at end of file diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/returns.kt b/compiler/fir/resolve/testData/resolve/smartcasts/returns.kt index dea1b5fb25c..a926f998181 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/returns.kt +++ b/compiler/fir/resolve/testData/resolve/smartcasts/returns.kt @@ -4,7 +4,7 @@ fun test_0(x: Any) { } else { } - x.length + x.length } fun test_1(x: Any) { @@ -35,8 +35,8 @@ fun test_2(x: Any) { else -> return } x.foo() - x.bar() - x.baz() + x.bar() + x.baz() } fun test_3(x: Any) { @@ -44,7 +44,7 @@ fun test_3(x: Any) { x is B -> x.bar() x is C -> x.baz() } - x.foo() - x.bar() - x.baz() + x.foo() + x.bar() + x.baz() } \ No newline at end of file diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/simpleIf.kt b/compiler/fir/resolve/testData/resolve/smartcasts/simpleIf.kt index d971fd64bea..c8490a36422 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/simpleIf.kt +++ b/compiler/fir/resolve/testData/resolve/smartcasts/simpleIf.kt @@ -2,7 +2,7 @@ fun test_1(x: Any) { if (x is String) { x.length } - x.length + x.length } fun test_2(x: Any) { @@ -10,7 +10,7 @@ fun test_2(x: Any) { if (b) { x.length } - x.length + x.length } fun test_3(x: Any) { diff --git a/compiler/fir/resolve/testData/resolve/stdlib/contracts/conditionalEffects.kt b/compiler/fir/resolve/testData/resolve/stdlib/contracts/conditionalEffects.kt index e94a2b3f30e..fa6e57374d8 100644 --- a/compiler/fir/resolve/testData/resolve/stdlib/contracts/conditionalEffects.kt +++ b/compiler/fir/resolve/testData/resolve/stdlib/contracts/conditionalEffects.kt @@ -24,9 +24,9 @@ fun test_5(x: Any, b: Boolean) { require(x is String) x.length } else { - x.length + x.length } - x.length + x.length } fun test_6(x: Any, b: Boolean) { diff --git a/compiler/fir/resolve/testData/resolve/stdlib/problems.kt b/compiler/fir/resolve/testData/resolve/stdlib/problems.kt index 0e2fbd0418a..f9fad433f52 100644 --- a/compiler/fir/resolve/testData/resolve/stdlib/problems.kt +++ b/compiler/fir/resolve/testData/resolve/stdlib/problems.kt @@ -30,5 +30,5 @@ class BC : B, C fun C.analyze() {} inline fun T.analyze() where T : A, T : B {} fun testAnalyze() { - BC().analyze() + BC().analyze() } diff --git a/compiler/fir/resolve/testData/resolve/typeAliasWithTypeArguments.kt b/compiler/fir/resolve/testData/resolve/typeAliasWithTypeArguments.kt index 1e83b6eff6b..a9f364cdd67 100644 --- a/compiler/fir/resolve/testData/resolve/typeAliasWithTypeArguments.kt +++ b/compiler/fir/resolve/testData/resolve/typeAliasWithTypeArguments.kt @@ -42,7 +42,7 @@ fun test_2(inv: Inv2) { fun test_3(inv: Inv3) { inv.k().foo() - inv.t().bar() + inv.t().bar() inv.t().baz() } diff --git a/compiler/fir/resolve/testData/resolve/whenAsReceiver.kt b/compiler/fir/resolve/testData/resolve/whenAsReceiver.kt index 860ba609ef7..2706a6e1936 100644 --- a/compiler/fir/resolve/testData/resolve/whenAsReceiver.kt +++ b/compiler/fir/resolve/testData/resolve/whenAsReceiver.kt @@ -1,8 +1,8 @@ fun T.also(block: () -> R): R { - null!! + return null!! } -fun foo(b: Boolean) { +fun foo(b: Boolean, a: Int) { val x = when (b) { true -> a else -> null diff --git a/compiler/fir/resolve/testData/resolve/whenAsReceiver.txt b/compiler/fir/resolve/testData/resolve/whenAsReceiver.txt index 6bef5a8169a..460c0a93171 100644 --- a/compiler/fir/resolve/testData/resolve/whenAsReceiver.txt +++ b/compiler/fir/resolve/testData/resolve/whenAsReceiver.txt @@ -1,6 +1,6 @@ FILE: whenAsReceiver.kt public final fun R|T|.also(block: R|kotlin/Function0|): R|R| { - when (lval : R|kotlin/Nothing?| = Null(null)) { + ^also when (lval : R|kotlin/Nothing?| = Null(null)) { ==($subj$, Null(null)) -> { throw #() } @@ -10,16 +10,16 @@ FILE: whenAsReceiver.kt } } - public final fun foo(b: R|kotlin/Boolean|): R|kotlin/Unit| { - lval x: = when (R|/b|) { + public final fun foo(b: R|kotlin/Boolean|, a: R|kotlin/Int|): R|kotlin/Unit| { + lval x: R|kotlin/Int?| = when (R|/b|) { ==($subj$, Boolean(true)) -> { - # + R|/a| } else -> { Null(null) } } - ?.#( = also@fun .(): { + ?.R|/also|( = also@fun (): R|kotlin/Int| { Int(1) } ) diff --git a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/AbstractFirResolveTestCase.kt b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/AbstractFirResolveTestCase.kt index 8e3f7eb695a..886a624d140 100644 --- a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/AbstractFirResolveTestCase.kt +++ b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/AbstractFirResolveTestCase.kt @@ -5,17 +5,32 @@ package org.jetbrains.kotlin.fir +import com.intellij.openapi.util.TextRange import com.intellij.psi.search.GlobalSearchScope +import org.jetbrains.kotlin.checkers.DiagnosedRange +import org.jetbrains.kotlin.checkers.DiagnosticDiffCallbacks +import org.jetbrains.kotlin.checkers.TestCheckerUtil +import org.jetbrains.kotlin.checkers.diagnostics.ActualDiagnostic +import org.jetbrains.kotlin.checkers.diagnostics.PositionalTextDiagnostic +import org.jetbrains.kotlin.checkers.diagnostics.TextDiagnostic +import org.jetbrains.kotlin.checkers.utils.CheckerTestUtil import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment import org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM +import org.jetbrains.kotlin.diagnostics.PsiDiagnosticUtils import org.jetbrains.kotlin.fir.builder.RawFirBuilder import org.jetbrains.kotlin.fir.declarations.FirFile +import org.jetbrains.kotlin.fir.resolve.diagnostics.ConeDiagnostic +import org.jetbrains.kotlin.fir.resolve.diagnostics.collectors.AbstractDiagnosticCollector +import org.jetbrains.kotlin.fir.resolve.diagnostics.collectors.ParallelDiagnosticsCollector +import org.jetbrains.kotlin.fir.resolve.diagnostics.collectors.registerAllComponents import org.jetbrains.kotlin.fir.resolve.firProvider import org.jetbrains.kotlin.fir.resolve.impl.FirProviderImpl import org.jetbrains.kotlin.fir.resolve.transformers.FirTotalResolveTransformer +import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.psi.KtFile import org.jetbrains.kotlin.test.ConfigurationKind import org.jetbrains.kotlin.test.KotlinTestUtils +import org.jetbrains.kotlin.test.TestFiles import java.io.File abstract class AbstractFirResolveTestCase : AbstractFirResolveWithSessionTestCase() { @@ -69,7 +84,12 @@ abstract class AbstractFirResolveTestCase : AbstractFirResolveWithSessionTestCas } open fun doTest(path: String) { - checkFir(path, processInputFile(path)) + val file = File(path) + val expectedText = KotlinTestUtils.doLoadFile(file) + val testFiles = createTestFiles(file, expectedText) + val firFiles = doCreateAndProcessFir(testFiles.mapNotNull { it.ktFile }) + checkDiagnostics(file, testFiles, firFiles) + checkFir(path, firFiles) } fun checkFir(path: String, firFiles: List) { @@ -77,4 +97,155 @@ abstract class AbstractFirResolveTestCase : AbstractFirResolveWithSessionTestCas val expectedPath = path.replace(".kt", ".txt") KotlinTestUtils.assertEqualsToFile(File(expectedPath), firFileDump) } + + private fun createCollector(): AbstractDiagnosticCollector { +// val collector = SimpleDiagnosticsCollector() + val collector = ParallelDiagnosticsCollector(4) + collector.registerAllComponents() + return collector + } + + private fun checkDiagnostics(file: File, testFiles: List, firFiles: List) { + val collector = createCollector() + val actualText = StringBuilder() + for ((testFile, firFile) in testFiles zip firFiles) { + val coneDiagnostics = collector.collectDiagnostics(firFile) + testFile.getActualText(coneDiagnostics, actualText) + } + KotlinTestUtils.assertEqualsToFile(file, actualText.toString()) + } + + private fun createTestFiles(file: File, expectedText: String?): List { + return TestFiles.createTestFiles(file.name, expectedText, object : TestFiles.TestFileFactory { + override fun createFile(module: Nothing?, fileName: String, text: String, directives: MutableMap): TestFile { + return TestFile(fileName, text, directives) + } + + override fun createModule(name: String, dependencies: MutableList, friends: MutableList): Nothing? { + return null + } + }) + } + + + private inner class TestFile( + fileName: String, + textWithMarkers: String, + val directives: Map + ) { + private val diagnosedRanges: MutableList = mutableListOf() + private val diagnosedRangesToDiagnosticNames: MutableMap> = mutableMapOf() + val ktFile: KtFile? by lazy { + if (fileName.endsWith(".java")) { + null + } else { + TestCheckerUtil.createCheckAndReturnPsiFile(fileName, clearText, project) + } + } + val actualDiagnostics: MutableList = mutableListOf() + val clearText: String + val expectedText: String + + init { + if (fileName.endsWith(".java")) { + clearText = textWithMarkers + expectedText = clearText + } else { + expectedText = textWithMarkers + clearText = CheckerTestUtil.parseDiagnosedRanges(addExtracts(expectedText), diagnosedRanges, diagnosedRangesToDiagnosticNames) + } + } + + fun addExtracts(text: String): String { + // TODO + return text + } + + fun getActualText( + coneDiagnostics: Iterable, + actualText: StringBuilder + ): Boolean { + val ktFile = this.ktFile + if (ktFile == null) { + // TODO: check java files too + actualText.append(this.clearText) + return true + } + + if (ktFile.name.endsWith("CoroutineUtil.kt") && ktFile.packageFqName == FqName("helpers")) return true + + // TODO: report JVM signature diagnostics also for implementing modules + + val ok = booleanArrayOf(true) + val diagnostics = coneDiagnostics.toActualDiagnostic() + val filteredDiagnostics = diagnostics // TODO + + actualDiagnostics.addAll(filteredDiagnostics) + + val uncheckedDiagnostics = mutableListOf() + + val diagnosticToExpectedDiagnostic = + CheckerTestUtil.diagnosticsDiff(diagnosedRanges, filteredDiagnostics, object : DiagnosticDiffCallbacks { + override fun missingDiagnostic(diagnostic: TextDiagnostic, expectedStart: Int, expectedEnd: Int) { + val message = "Missing " + diagnostic.description + PsiDiagnosticUtils.atLocation( + ktFile, + TextRange(expectedStart, expectedEnd) + ) + System.err.println(message) + ok[0] = false + } + + override fun wrongParametersDiagnostic( + expectedDiagnostic: TextDiagnostic, + actualDiagnostic: TextDiagnostic, + start: Int, + end: Int + ) { + val message = "Parameters of diagnostic not equal at position " + + PsiDiagnosticUtils.atLocation(ktFile, TextRange(start, end)) + + ". Expected: ${expectedDiagnostic.asString()}, actual: $actualDiagnostic" + System.err.println(message) + ok[0] = false + } + + override fun unexpectedDiagnostic(diagnostic: TextDiagnostic, actualStart: Int, actualEnd: Int) { + val message = "Unexpected ${diagnostic.description}${PsiDiagnosticUtils.atLocation( + ktFile, + TextRange(actualStart, actualEnd) + )}" + System.err.println(message) + ok[0] = false + } + + fun updateUncheckedDiagnostics(diagnostic: TextDiagnostic, start: Int, end: Int) { + uncheckedDiagnostics.add(PositionalTextDiagnostic(diagnostic, start, end)) + } + }) + + actualText.append( + CheckerTestUtil.addDiagnosticMarkersToText( + ktFile, + filteredDiagnostics, + diagnosticToExpectedDiagnostic, + { file -> file.text }, + uncheckedDiagnostics, + false, + false + ) + ) + + stripExtras(actualText) + + return ok[0] + } + + private fun stripExtras(text: StringBuilder): StringBuilder { + // TODO + return text + } + } + + private fun Iterable.toActualDiagnostic(): Collection { + return map { ActualDiagnostic(it.diagnostic, null, true) } + } } diff --git a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/AbstractFirResolveWithDiagnosticsTestCase.kt b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/AbstractFirResolveWithDiagnosticsTestCase.kt deleted file mode 100644 index 1d7cfabaac2..00000000000 --- a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/AbstractFirResolveWithDiagnosticsTestCase.kt +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.fir - -import com.intellij.openapi.util.TextRange -import org.jetbrains.kotlin.checkers.DiagnosedRange -import org.jetbrains.kotlin.checkers.DiagnosticDiffCallbacks -import org.jetbrains.kotlin.checkers.TestCheckerUtil -import org.jetbrains.kotlin.checkers.diagnostics.ActualDiagnostic -import org.jetbrains.kotlin.checkers.diagnostics.PositionalTextDiagnostic -import org.jetbrains.kotlin.checkers.diagnostics.TextDiagnostic -import org.jetbrains.kotlin.checkers.utils.CheckerTestUtil -import org.jetbrains.kotlin.diagnostics.PsiDiagnosticUtils -import org.jetbrains.kotlin.fir.declarations.FirFile -import org.jetbrains.kotlin.fir.resolve.diagnostics.ConeDiagnostic -import org.jetbrains.kotlin.fir.resolve.diagnostics.collectors.AbstractDiagnosticCollector -import org.jetbrains.kotlin.fir.resolve.diagnostics.collectors.ParallelDiagnosticsCollector -import org.jetbrains.kotlin.fir.resolve.diagnostics.collectors.components.DeclarationCheckersDiagnosticComponent -import org.jetbrains.kotlin.fir.resolve.diagnostics.collectors.registerAllComponents -import org.jetbrains.kotlin.name.FqName -import org.jetbrains.kotlin.psi.KtFile -import org.jetbrains.kotlin.test.KotlinTestUtils -import org.jetbrains.kotlin.test.TestFiles -import java.io.File - -abstract class AbstractFirResolveWithDiagnosticsTestCase : AbstractFirResolveTestCase() { - override fun doTest(path: String) { - val file = File(path) - val expectedText = KotlinTestUtils.doLoadFile(file) - val testFiles = createTestFiles(file, expectedText) - val firFiles = doCreateAndProcessFir(testFiles.mapNotNull { it.ktFile }) - checkFir(path, firFiles) - checkDiagnostics(file, testFiles, firFiles) - } - - private fun createCollector(): AbstractDiagnosticCollector { -// val collector = SimpleDiagnosticsCollector() - val collector = ParallelDiagnosticsCollector(4) - collector.registerAllComponents() - return collector - } - - private fun checkDiagnostics(file: File, testFiles: List, firFiles: List) { - val collector = createCollector() - val actualText = StringBuilder() - for ((testFile, firFile) in testFiles zip firFiles) { - val coneDiagnostics = collector.collectDiagnostics(firFile) - testFile.getActualText(coneDiagnostics, actualText) - } - KotlinTestUtils.assertEqualsToFile(file, actualText.toString()) - } - - private fun createTestFiles(file: File, expectedText: String?): List { - return TestFiles.createTestFiles(file.name, expectedText, object : TestFiles.TestFileFactory { - override fun createFile(module: Nothing?, fileName: String, text: String, directives: MutableMap): TestFile { - return TestFile(fileName, text, directives) - } - - override fun createModule(name: String, dependencies: MutableList, friends: MutableList): Nothing? { - return null - } - }) - } - - - private inner class TestFile( - fileName: String, - textWithMarkers: String, - val directives: Map - ) { - private val diagnosedRanges: MutableList = mutableListOf() - private val diagnosedRangesToDiagnosticNames: MutableMap> = mutableMapOf() - val ktFile: KtFile? by lazy { - if (fileName.endsWith(".java")) { - null - } else { - TestCheckerUtil.createCheckAndReturnPsiFile(fileName, clearText, project) - } - } - val actualDiagnostics: MutableList = mutableListOf() - val clearText: String - val expectedText: String - - init { - if (fileName.endsWith(".java")) { - clearText = textWithMarkers - expectedText = clearText - } else { - expectedText = textWithMarkers - clearText = CheckerTestUtil.parseDiagnosedRanges(addExtracts(expectedText), diagnosedRanges, diagnosedRangesToDiagnosticNames) - } - } - - fun addExtracts(text: String): String { - // TODO - return text - } - - fun getActualText( - coneDiagnostics: Iterable, - actualText: StringBuilder - ): Boolean { - val ktFile = this.ktFile - if (ktFile == null) { - // TODO: check java files too - actualText.append(this.clearText) - return true - } - - if (ktFile.name.endsWith("CoroutineUtil.kt") && ktFile.packageFqName == FqName("helpers")) return true - - // TODO: report JVM signature diagnostics also for implementing modules - - val ok = booleanArrayOf(true) - val diagnostics = coneDiagnostics.toActualDiagnostic() - val filteredDiagnostics = diagnostics // TODO - - actualDiagnostics.addAll(filteredDiagnostics) - - val uncheckedDiagnostics = mutableListOf() - - val diagnosticToExpectedDiagnostic = - CheckerTestUtil.diagnosticsDiff(diagnosedRanges, filteredDiagnostics, object : DiagnosticDiffCallbacks { - override fun missingDiagnostic(diagnostic: TextDiagnostic, expectedStart: Int, expectedEnd: Int) { - val message = "Missing " + diagnostic.description + PsiDiagnosticUtils.atLocation( - ktFile, - TextRange(expectedStart, expectedEnd) - ) - System.err.println(message) - ok[0] = false - } - - override fun wrongParametersDiagnostic( - expectedDiagnostic: TextDiagnostic, - actualDiagnostic: TextDiagnostic, - start: Int, - end: Int - ) { - val message = "Parameters of diagnostic not equal at position " + - PsiDiagnosticUtils.atLocation(ktFile, TextRange(start, end)) + - ". Expected: ${expectedDiagnostic.asString()}, actual: $actualDiagnostic" - System.err.println(message) - ok[0] = false - } - - override fun unexpectedDiagnostic(diagnostic: TextDiagnostic, actualStart: Int, actualEnd: Int) { - val message = "Unexpected ${diagnostic.description}${PsiDiagnosticUtils.atLocation( - ktFile, - TextRange(actualStart, actualEnd) - )}" - System.err.println(message) - ok[0] = false - } - - fun updateUncheckedDiagnostics(diagnostic: TextDiagnostic, start: Int, end: Int) { - uncheckedDiagnostics.add(PositionalTextDiagnostic(diagnostic, start, end)) - } - }) - - actualText.append( - CheckerTestUtil.addDiagnosticMarkersToText( - ktFile, - filteredDiagnostics, - diagnosticToExpectedDiagnostic, - { file -> file.text }, - uncheckedDiagnostics, - false, - false - ) - ) - - stripExtras(actualText) - - return ok[0] - } - - private fun stripExtras(text: StringBuilder): StringBuilder { - // TODO - return text - } - } - - private fun Iterable.toActualDiagnostic(): Collection { - return map { ActualDiagnostic(it.diagnostic, null, true) } - } -} \ No newline at end of file diff --git a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirResolveTestCaseGenerated.java b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirResolveTestCaseGenerated.java index 1f0ff3f59d0..9bca501380f 100644 --- a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirResolveTestCaseGenerated.java +++ b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirResolveTestCaseGenerated.java @@ -25,7 +25,7 @@ public class FirResolveTestCaseGenerated extends AbstractFirResolveTestCase { } public void testAllFilesPresentInResolve() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/fir/resolve/testData/resolve"), Pattern.compile("^([^.]+)\\.kt$"), true, "stdlib", "cfg", "smartcasts", "diagnostics"); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/fir/resolve/testData/resolve"), Pattern.compile("^([^.]+)\\.kt$"), true, "stdlib", "cfg", "smartcasts"); } @TestMetadata("cast.kt") @@ -264,6 +264,24 @@ public class FirResolveTestCaseGenerated extends AbstractFirResolveTestCase { } } + @TestMetadata("compiler/fir/resolve/testData/resolve/diagnostics") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Diagnostics extends AbstractFirResolveTestCase { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInDiagnostics() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/fir/resolve/testData/resolve/diagnostics"), Pattern.compile("^([^.]+)\\.kt$"), true); + } + + @TestMetadata("infixFunctions.kt") + public void testInfixFunctions() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/diagnostics/infixFunctions.kt"); + } + } + @TestMetadata("compiler/fir/resolve/testData/resolve/expresssions") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirResolveWithDiagnosticsTestCaseGenerated.java b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirResolveWithDiagnosticsTestCaseGenerated.java deleted file mode 100644 index 80e5630e7db..00000000000 --- a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirResolveWithDiagnosticsTestCaseGenerated.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.fir; - -import com.intellij.testFramework.TestDataPath; -import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; -import org.jetbrains.kotlin.test.KotlinTestUtils; -import org.jetbrains.kotlin.test.TestMetadata; -import org.junit.runner.RunWith; - -import java.io.File; -import java.util.regex.Pattern; - -/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ -@SuppressWarnings("all") -@TestMetadata("compiler/fir/resolve/testData/resolve/diagnostics") -@TestDataPath("$PROJECT_ROOT") -@RunWith(JUnit3RunnerWithInners.class) -public class FirResolveWithDiagnosticsTestCaseGenerated extends AbstractFirResolveWithDiagnosticsTestCase { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInDiagnostics() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/fir/resolve/testData/resolve/diagnostics"), Pattern.compile("^([^.]+)\\.kt$"), true); - } - - @TestMetadata("infixFunctions.kt") - public void testInfixFunctions() throws Exception { - runTest("compiler/fir/resolve/testData/resolve/diagnostics/infixFunctions.kt"); - } -} diff --git a/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt b/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt index c6099360f52..c8886ab8a07 100644 --- a/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt +++ b/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt @@ -513,7 +513,7 @@ fun main(args: Array) { testGroup("compiler/fir/resolve/tests", "compiler/fir/resolve/testData") { testClass { - model("resolve", pattern = KT_WITHOUT_DOTS_IN_NAME, excludeDirs = listOf("stdlib", "cfg", "smartcasts", "diagnostics")) + model("resolve", pattern = KT_WITHOUT_DOTS_IN_NAME, excludeDirs = listOf("stdlib", "cfg", "smartcasts")) } testClass { @@ -528,10 +528,6 @@ fun main(args: Array) { testClass { model("resolve/stdlib/contracts", pattern = KT_WITHOUT_DOTS_IN_NAME) } - - testClass { - model("resolve/diagnostics", pattern = KT_WITHOUT_DOTS_IN_NAME) - } } testGroup("compiler/fir/resolve/tests", "compiler/testData") {