[Test] Sort FIR diagnostics by offset for consistent rendering

This commit is contained in:
Brian Norman
2023-06-07 06:37:24 -05:00
committed by Space Team
parent 2abe04132b
commit 5fe5113344
6 changed files with 14 additions and 14 deletions
@@ -1,3 +1,3 @@
/kt45461_2.kt:(253,260): warning: Type argument for a type parameter S can't be inferred because it has incompatible upper bounds: kotlin/String, K (multiple incompatible classes: kotlin/String, kotlin/Int). This will become an error in a future release
/kt45461_2.kt:(198,201): warning: 'kotlin/Int' is a final type, and thus a value of the type parameter is predetermined
/kt45461_2.kt:(253,260): warning: Type argument for a type parameter S can't be inferred because it has incompatible upper bounds: kotlin/String, K (multiple incompatible classes: kotlin/String, kotlin/Int). This will become an error in a future release
@@ -1,5 +1,5 @@
/kt45461_25.fir.kt:(176,180): warning: Unchecked cast: kotlin/Nothing? to S
/kt45461_25.fir.kt:(276,283): error: Type argument for a type parameter S can't be inferred because it has incompatible upper bounds: kotlin/String, K (multiple incompatible classes: kotlin/String, kotlin/Int)
/kt45461_25.fir.kt:(206,209): warning: 'kotlin/Int' is a final type, and thus a value of the type parameter is predetermined
/kt45461_25.fir.kt:(276,283): error: Type argument for a type parameter S can't be inferred because it has incompatible upper bounds: kotlin/String, K (multiple incompatible classes: kotlin/String, kotlin/Int)
@@ -1,5 +1,5 @@
/kt48765.kt:(282,285): warning: Type argument for a type parameter T can't be inferred because it has incompatible upper bounds: kotlin/String, kotlin/Number (multiple incompatible classes). This will become an error in a future release
/kt48765.kt:(379,383): warning: Unchecked cast: kotlin/String to T
/kt48765.kt:(345,351): warning: 'kotlin/String' is a final type, and thus a value of the type parameter is predetermined
/kt48765.kt:(379,383): warning: Unchecked cast: kotlin/String to T
@@ -342,7 +342,7 @@ class FirDiagnosticsHandler(testServices: TestServices) : FirAnalysisHandler(tes
if (DiagnosticsDirectives.RENDER_DIAGNOSTICS_FULL_TEXT !in module.directives) return
if (diagnostics.isEmpty()) return
val reportedDiagnostics = diagnostics.map {
val reportedDiagnostics = diagnostics.sortedBy { it.textRanges.first().startOffset }.map {
val severity = AnalyzerWithCompilerReport.convertSeverity(it.severity).toString().toLowerCaseAsciiOnly()
val message = RootDiagnosticRendererFactory(it).render(it)
"/${file.name}:${it.textRanges.first()}: $severity: $message"
@@ -1,7 +1,7 @@
/incorrectUsage.fir.kt:(396,397): error:
/incorrectUsage.fir.kt:(390,395): error: None of the following functions are applicable: [fun assign(v: String): Unit, fun assign(v: StringProperty): Unit]
/incorrectUsage.fir.kt:(542,543): error:
/incorrectUsage.fir.kt:(396,397): error:
/incorrectUsage.fir.kt:(536,541): error: None of the following functions are applicable: [fun assign(v: String): Unit, fun assign(v: StringProperty): Unit]
/incorrectUsage.fir.kt:(542,543): error:
@@ -22,8 +22,12 @@
/otherOperators.fir.kt:(1057,1066): error: No set method providing array access
/otherOperators.fir.kt:(1128,1129): error: Too many arguments for public final fun /StringProperty.get(): R|kotlin/String|
/otherOperators.fir.kt:(1131,1133): error: Unresolved reference: +=
/otherOperators.fir.kt:(1177,1178): error: Too many arguments for public final fun /StringProperty.get(): R|kotlin/String|
/otherOperators.fir.kt:(1180,1182): error: Unresolved reference: +=
/otherOperators.fir.kt:(1325,1328): error: No set method providing array access
@@ -31,7 +35,3 @@
/otherOperators.fir.kt:(1431,1437): error: Variable expected
/otherOperators.fir.kt:(1477,1483): error: Variable expected
/otherOperators.fir.kt:(1128,1129): error: Too many arguments for public final fun /StringProperty.get(): R|kotlin/String|
/otherOperators.fir.kt:(1177,1178): error: Too many arguments for public final fun /StringProperty.get(): R|kotlin/String|