FE tests: don't render text of disabled diagnostics

This commit is contained in:
Mikhail Glukhikh
2024-01-02 13:57:48 +01:00
committed by Space Team
parent e1b7b0e768
commit 8a560d2629
18 changed files with 13 additions and 101 deletions
@@ -1,12 +1,3 @@
/kt47986Default.kt:4:18: warning: parameter 'builderAction' is never used
fun <K> buildFoo(builderAction: Foo<K>.() -> Unit): Foo<K> = Foo()
^
/kt47986Default.kt:6:20: warning: parameter 'x' is never used
fun <K> Foo<K>.bar(x: Int = 1) {}
^
/kt47986Default.kt:9:9: warning: variable 'x' is never used
val x = buildFoo {
^
/kt47986Default.kt:9:13: warning: type parameter for a type argument K can't be inferred into declared upper bounds. Please provide any use-site type information. It will become an error in future releases.
val x = buildFoo {
^
@@ -1,12 +1,4 @@
/kt47986Disabled.kt:5:18: warning: parameter 'builderAction' is never used
fun <K> buildFoo(builderAction: Foo<K>.() -> Unit): Foo<K> = Foo()
^
/kt47986Disabled.kt:7:20: warning: parameter 'x' is never used
fun <K> Foo<K>.bar(x: Int = 1) {}
^
/kt47986Disabled.kt:10:9: warning: variable 'x' is never used
val x = buildFoo {
^
/kt47986Disabled.kt:10:13: warning: type parameter for a type argument K can't be inferred into declared upper bounds. Please provide any use-site type information. It will become an error in future releases.
val x = buildFoo {
^
@@ -1,13 +1,4 @@
/kt47986_2.kt:4:18: warning: parameter 'builderAction' is never used
fun <K> buildFoo(builderAction: Foo<K>.() -> Unit): Foo<K> = Foo()
^
/kt47986_2.kt:11:9: warning: variable 'x' is never used
val x = buildFoo { // can't infer
^
/kt47986_2.kt:11:13: warning: type parameter for a type argument K can't be inferred into declared upper bounds. Please provide any use-site type information. It will become an error in future releases.
val x = buildFoo { // can't infer
^
/kt47986_2.kt:12:13: warning: variable 'y' is never used
val y = id(::bar)
^
@@ -1,12 +1,3 @@
/kt47986_3.kt:4:18: warning: parameter 'builderAction' is never used
fun <K> buildFoo(builderAction: Foo<K>.() -> Unit): Foo<K> = Foo()
^
/kt47986_3.kt:6:26: warning: parameter 'x' is never used
fun <K: N, N> Foo<K>.bar(x: Int = 1) {}
^
/kt47986_3.kt:9:9: warning: variable 'x' is never used
val x = buildFoo {
^
/kt47986_3.kt:9:13: warning: type parameter for a type argument K can't be inferred into declared upper bounds. Please provide any use-site type information. It will become an error in future releases.
val x = buildFoo {
^
@@ -1,12 +1,3 @@
/kt51464.kt:2:16: warning: parameter 'value' is never used
fun <T> flowOf(value: T): Flow<T> = TODO()
^
/kt51464.kt:8:30: warning: parameter 'transform' is never used
fun <T, R> Flow<T>.transform(transform: FlowCollector<R>.(T) -> Unit): Flow<R> = TODO()
^
/kt51464.kt:11:20: warning: parameter 'collector' is never used
fun <T> doEmit(collector: FlowCollector<T>) {}
^
/kt51464.kt:12:15: warning: type parameter for a type argument R can't be inferred into declared upper bounds. Please provide any use-site type information. It will become an error in future releases.
flowOf(1).transform { doEmit(this) }
^
@@ -1,6 +1,4 @@
/kt45461.kt:7:25: warning: parameter 'foo' is never used
fun <S : T> takeFoo(foo: Foo<in S>) {}
^
/kt45461.kt:12:19: warning: type argument for a type parameter S can't be inferred because it has incompatible upper bounds: String, Int (multiple incompatible classes). This will become an error in Kotlin 2.0
Bar<String>().takeFoo(foo) // error in 1.3.72, no error in 1.4.31
^
@@ -1,3 +0,0 @@
/kt45461_11.kt:6:25: warning: parameter 'foo' is never used
fun <S : T> takeFoo(foo: Foo<in S>) {}
^
@@ -1,5 +1,4 @@
// FIR_IDENTICAL
// RENDER_DIAGNOSTICS_FULL_TEXT
class Foo<T>
class Bar<T> {
@@ -1,6 +1,3 @@
/kt45461_12.kt:7:25: warning: parameter 'foo' is never used
fun <S : T> takeFoo(foo: Foo<in S>) {}
^
/kt45461_12.kt:14:19: warning: type argument for a type parameter S can't be inferred because it has incompatible upper bounds: String, K (multiple incompatible classes: String, Number). This will become an error in Kotlin 2.0
Bar<String>().takeFoo(foo) // error in 1.3.72, no error in 1.4.31
^
@@ -1,6 +1,3 @@
/kt45461_2.kt:7:25: warning: parameter 'foo' is never used
fun <S : T> takeFoo(foo: Foo<in S>) {}
^
/kt45461_2.kt:10:10: warning: 'Int' is a final type, and thus a value of the type parameter is predetermined
fun <K : Int> main() {
^
@@ -1,6 +1,4 @@
/kt45461_5.kt:7:25: warning: parameter 'foo' is never used
fun <S : T> takeFoo(foo: Foo<in S>) {}
^
/kt45461_5.kt:12:19: warning: type argument for a type parameter S can't be inferred because it has incompatible upper bounds: String, K (multiple incompatible classes: String, Number). This will become an error in Kotlin 2.0
Bar<String>().takeFoo(foo) // error in 1.3.72, no error in 1.4.31
^
@@ -1,9 +1,3 @@
/kt48765.kt:6:44: warning: parameter 'x1' is never used
fun <T1: Number, T2: A<Float, T1>> foo(x1: T2, x2: T1) {}
^
/kt48765.kt:6:52: warning: parameter 'x2' is never used
fun <T1: Number, T2: A<Float, T1>> foo(x1: T2, x2: T1) {}
^
/kt48765.kt:10:13: warning: type argument for a type parameter T can't be inferred because it has incompatible upper bounds: String, Number (multiple incompatible classes). This will become an error in Kotlin 2.0
B().foo(x, foo())
^
@@ -1,6 +1,3 @@
/kt48935.kt:7:35: warning: parameter 'func' is never used
fun <T, V> exampleGenericFunction(func: V) where T: Base, V: (T) -> Unit {
^
/kt48935.kt:13:5: warning: type argument for a type parameter T has possible incompatible upper bounds: Base, DoesNotImplementBase (final class and interface)
exampleGenericFunction(func) // expected this to be a compilation error as the T: Base constraint should not be satisfied
^
@@ -1,12 +1,4 @@
/selectFromCovariantAndContravariantTypes.kt:12:22: warning: parameter 'y' is never used
fun <K> select(x: K, y: K): K = x
^
/selectFromCovariantAndContravariantTypes.kt:13:19: warning: parameter 'x' is never used
fun <V> genericIn(x: In<V>) {}
^
/selectFromCovariantAndContravariantTypes.kt:14:20: warning: parameter 'x' is never used
fun <V> genericOut(x: Out<V>) {}
^
/selectFromCovariantAndContravariantTypes.kt:17:5: warning: type argument for a type parameter V can't be inferred because it has incompatible upper bounds: A, B (multiple incompatible classes). This will become an error in Kotlin 2.0
genericIn(select(a, b))
^
@@ -1,12 +1,6 @@
// -- Module: <m1> --
// -- Module: <m2> --
/m2.kt:14:9: warning: parameter 'f' is never used
fun foo(f: (Some, String) -> Unit) {}
^
/m2.kt:15:9: warning: parameter 'f' is never used
fun bar(f: (Some) -> Unit) {}
^
// -- Module: <m3> --
/m3.kt:24:17: error: unresolved reference: Some
@@ -4,21 +4,13 @@
/labelClashes.kt:11:13: warning: this label is now resolved to 'function bar' but soon it will be resolved to the closest 'anonymous function'. Please consider introducing or changing explicit label name
this@bar.inc()
^
/labelClashes.kt:15:9: warning: parameter 'f' is never used
fun foo(f: with.() -> Unit) {}
^
/labelClashes.kt:20:17: warning: this label is now resolved to 'class with' but soon it will be resolved to the closest 'anonymous function'. Please consider introducing or changing explicit label name
this@with.foo()
^
/labelClashes.kt:24:17: warning: this label is now resolved to 'class with' but soon it will be resolved to the closest 'anonymous function'. Please consider introducing or changing explicit label name
this@with.foo()
^
/labelClashes.kt:37:9: warning: the expression is unused
this@TypedThis
^
/labelClashes.kt:37:13: warning: this label is now resolved to 'class TypedThis' but soon it will be resolved to the closest 'function baz extension receiver'. Please consider introducing or changing explicit label name
this@TypedThis
^
/labelClashes.kt:41:9: warning: the expression is unused
this@TypedThis
^
@@ -1,12 +1,6 @@
/labelClashesWithContextReceivers.kt:8:9: warning: the expression is unused
this@Some
^
/labelClashesWithContextReceivers.kt:8:13: warning: this label is now resolved to 'class Some' but soon it will be resolved to the closest 'function foo context receiver'. Please consider introducing or changing explicit label name
this@Some
^
/labelClashesWithContextReceivers.kt:9:9: warning: the expression is unused
this@String
^
/labelClashesWithContextReceivers.kt:14:21: warning: this label is now resolved to 'class Some' but soon it will be resolved to the closest 'property self context receiver'. Please consider introducing or changing explicit label name
get() = this@Some
^
@@ -9,11 +9,14 @@ import org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport
import org.jetbrains.kotlin.cli.common.messages.GroupingMessageCollector
import org.jetbrains.kotlin.cli.common.messages.MessageRenderer
import org.jetbrains.kotlin.cli.common.messages.PrintingMessageCollector
import org.jetbrains.kotlin.diagnostics.GenericDiagnostics
import org.jetbrains.kotlin.diagnostics.UnboundDiagnostic
import org.jetbrains.kotlin.test.directives.DiagnosticsDirectives
import org.jetbrains.kotlin.test.directives.model.DirectivesContainer
import org.jetbrains.kotlin.test.frontend.classic.ClassicFrontendOutputArtifact
import org.jetbrains.kotlin.test.model.TestModule
import org.jetbrains.kotlin.test.services.TestServices
import org.jetbrains.kotlin.test.services.diagnosticsService
import org.jetbrains.kotlin.test.services.moduleStructure
import org.jetbrains.kotlin.test.utils.MultiModuleInfoDumper
import org.jetbrains.kotlin.test.utils.withExtension
@@ -50,7 +53,11 @@ class DiagnosticMessagesTextHandler(
)
AnalyzerWithCompilerReport.reportDiagnostics(
info.analysisResult.bindingContext.diagnostics,
object : GenericDiagnostics<UnboundDiagnostic> {
override fun all() = info.analysisResult.bindingContext.diagnostics.filter {
testServices.diagnosticsService.shouldRenderDiagnostic(module, it.factoryName, it.severity)
}
},
diagnosticsFullTextCollector,
renderInternalDiagnosticName = false
)