[FIR] Fix type annotation arguments rendering inside symbols
...in ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT diagnostic. ^KT-62585
This commit is contained in:
committed by
Space Team
parent
b3467353b2
commit
cb6ec46de1
+4
-2
@@ -9,6 +9,7 @@ import org.jetbrains.kotlin.diagnostics.rendering.Renderer
|
|||||||
import org.jetbrains.kotlin.fir.expressions.FirAnnotation
|
import org.jetbrains.kotlin.fir.expressions.FirAnnotation
|
||||||
import org.jetbrains.kotlin.fir.renderer.ConeIdShortRenderer
|
import org.jetbrains.kotlin.fir.renderer.ConeIdShortRenderer
|
||||||
import org.jetbrains.kotlin.fir.renderer.ConeTypeRenderer
|
import org.jetbrains.kotlin.fir.renderer.ConeTypeRenderer
|
||||||
|
import org.jetbrains.kotlin.fir.renderer.ConeTypeRendererForReadability
|
||||||
import org.jetbrains.kotlin.fir.renderer.FirRenderer
|
import org.jetbrains.kotlin.fir.renderer.FirRenderer
|
||||||
import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol
|
import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol
|
||||||
import org.jetbrains.kotlin.fir.symbols.SymbolInternals
|
import org.jetbrains.kotlin.fir.symbols.SymbolInternals
|
||||||
@@ -18,9 +19,10 @@ import org.jetbrains.kotlin.utils.Printer
|
|||||||
internal object FirExpectActualAnnotationIncompatibilityDiagnosticRenderers {
|
internal object FirExpectActualAnnotationIncompatibilityDiagnosticRenderers {
|
||||||
@OptIn(SymbolInternals::class)
|
@OptIn(SymbolInternals::class)
|
||||||
val SYMBOL_RENDERER = Renderer<FirBasedSymbol<*>> {
|
val SYMBOL_RENDERER = Renderer<FirBasedSymbol<*>> {
|
||||||
|
val idRendererCreator = { ConeIdShortRenderer() }
|
||||||
FirRenderer(
|
FirRenderer(
|
||||||
typeRenderer = ConeTypeRenderer(),
|
typeRenderer = ConeTypeRendererForReadability(idRendererCreator),
|
||||||
idRenderer = ConeIdShortRenderer(),
|
idRenderer = idRendererCreator(),
|
||||||
classMemberRenderer = null,
|
classMemberRenderer = null,
|
||||||
bodyRenderer = null,
|
bodyRenderer = null,
|
||||||
annotationRenderer = null,
|
annotationRenderer = null,
|
||||||
|
|||||||
Vendored
+1
-1
@@ -19,4 +19,4 @@ expect fun onType(): @Ann2("") Any?
|
|||||||
<!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT!>actual fun <!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT("fun stringConcat(): Unit; fun stringConcat(): Unit; Annotation `@Ann2(s = String(1).R|kotlin/String.plus|(String(2)))` is missing on actual declaration")!>stringConcat<!>() {}<!>
|
<!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT!>actual fun <!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT("fun stringConcat(): Unit; fun stringConcat(): Unit; Annotation `@Ann2(s = String(1).R|kotlin/String.plus|(String(2)))` is missing on actual declaration")!>stringConcat<!>() {}<!>
|
||||||
|
|
||||||
// Not reported in K1, because supported starting from K2
|
// Not reported in K1, because supported starting from K2
|
||||||
<!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT!>actual fun <!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT("fun onType(): @R|Ann2|(s = String()) Any?; fun onType(): Any?; Annotation `@Ann2(s = String())` is missing on actual declaration")!>onType<!>(): Any? = null<!>
|
<!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT!>actual fun <!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT("fun onType(): @Ann2(...) Any?; fun onType(): Any?; Annotation `@Ann2(s = String())` is missing on actual declaration")!>onType<!>(): Any? = null<!>
|
||||||
|
|||||||
+1
-1
@@ -23,4 +23,4 @@ All annotations from expect 'fun <T> inTypeParam(): Unit' must be present with t
|
|||||||
All annotations from expect 'val onGetter: String get(): String' must be present with the same arguments on actual 'val onGetter: String get(): String', otherwise they might behave incorrectly.
|
All annotations from expect 'val onGetter: String get(): String' must be present with the same arguments on actual 'val onGetter: String get(): String', otherwise they might behave incorrectly.
|
||||||
|
|
||||||
/jvm.kt:(547,553): warning: Annotation `@Ann()` is missing on actual declaration.
|
/jvm.kt:(547,553): warning: Annotation `@Ann()` is missing on actual declaration.
|
||||||
All annotations from expect 'fun onType(param: @R|Ann|() Any): Unit' must be present with the same arguments on actual 'fun onType(param: Any): Unit', otherwise they might behave incorrectly.
|
All annotations from expect 'fun onType(param: @Ann() Any): Unit' must be present with the same arguments on actual 'fun onType(param: Any): Unit', otherwise they might behave incorrectly.
|
||||||
|
|||||||
Reference in New Issue
Block a user