[FIR] Fix duplicate spaces in FirPartialModifierRenderer
This commit is contained in:
committed by
Space Team
parent
7abeb05c8d
commit
6a073e0b17
+6
-6
@@ -15,28 +15,28 @@ class FirPartialModifierRenderer : FirModifierRenderer() {
|
||||
renderModifier("expect")
|
||||
}
|
||||
if (memberDeclaration.isActual) {
|
||||
renderModifier("actual ")
|
||||
renderModifier("actual")
|
||||
}
|
||||
if (memberDeclaration.isStatic) {
|
||||
renderModifier("static ")
|
||||
renderModifier("static")
|
||||
}
|
||||
if (memberDeclaration.isInner) {
|
||||
renderModifier("inner ")
|
||||
renderModifier("inner")
|
||||
}
|
||||
// `companion/data/fun` modifiers are only valid for FirRegularClass, but we render them to make sure they are not
|
||||
// incorrectly loaded for other declarations during deserialization.
|
||||
if (memberDeclaration.status.isCompanion) {
|
||||
renderModifier("companion ")
|
||||
renderModifier("companion")
|
||||
}
|
||||
if (memberDeclaration.status.isData) {
|
||||
renderModifier("data ")
|
||||
renderModifier("data")
|
||||
}
|
||||
// All Java interfaces are considered `fun` (functional interfaces) for resolution purposes
|
||||
// (see JavaSymbolProvider.createFirJavaClass). Don't render `fun` for Java interfaces; it's not a modifier in Java.
|
||||
val isJavaInterface =
|
||||
memberDeclaration is FirRegularClass && memberDeclaration.classKind == ClassKind.INTERFACE && memberDeclaration.isJava
|
||||
if (memberDeclaration.status.isFun && !isJavaInterface) {
|
||||
renderModifier("fun ")
|
||||
renderModifier("fun")
|
||||
}
|
||||
if (memberDeclaration.isSuspend) {
|
||||
renderModifier("suspend")
|
||||
|
||||
@@ -9,7 +9,7 @@ as no stability/compatibility guarantees are given on
|
||||
compiler or generated code. Use it at your own risk!
|
||||
|
||||
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
|
||||
compiler/testData/cli/jvm/firMultiplatformCompilationWithError/jvm.kt:1:18: error: actual class 'actual interface A : Any' has no corresponding members for expected class members:
|
||||
compiler/testData/cli/jvm/firMultiplatformCompilationWithError/jvm.kt:1:18: error: actual class 'actual interface A : Any' has no corresponding members for expected class members:
|
||||
|
||||
expect fun foo(): Unit
|
||||
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
/test.kt:(154,158): error: Overload resolution ambiguity between candidates: [static field SOME: String = String(Some), static enum entry SOME: SomeEnum]
|
||||
/test.kt:(154,158): error: Overload resolution ambiguity between candidates: [static field SOME: String = String(Some), static enum entry SOME: SomeEnum]
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
/test.kt:(160,164): error: Overload resolution ambiguity between candidates: [static field SOME: String = String(Some), static enum entry SOME: SomeEnum]
|
||||
/test.kt:(160,164): error: Overload resolution ambiguity between candidates: [static field SOME: String = String(Some), static enum entry SOME: SomeEnum]
|
||||
|
||||
+1
-1
@@ -2,6 +2,6 @@
|
||||
|
||||
/kt55179.fir.kt:(240,243): error: Non-private inline function 'fun foo(): Unit' cannot access members of private classes: 'constructor(): Foo'
|
||||
|
||||
/kt55179.fir.kt:(254,263): error: Non-private inline function 'fun foo(): Unit' cannot access members of private classes: 'companion object Companion : Any'
|
||||
/kt55179.fir.kt:(254,263): error: Non-private inline function 'fun foo(): Unit' cannot access members of private classes: 'companion object Companion : Any'
|
||||
|
||||
/kt55179.fir.kt:(272,280): error: Non-private inline function 'fun foo(): Unit' cannot access members of private classes: 'fun buildFoo(): Foo'
|
||||
|
||||
@@ -34,7 +34,7 @@ interface KotlinXStringDemoInterface {
|
||||
// FILE: StringDemoInterface.kt
|
||||
actual typealias StringDemoInterface = KotlinXStringDemoInterface
|
||||
|
||||
<!ACTUAL_WITHOUT_EXPECT("actual fun StringDemoInterface.plusK(): <ERROR TYPE REF: Unresolved name: value>; The following declaration is incompatible: expect fun StringDemoInterface.plusK(): String")!>actual fun StringDemoIn<!INCOMPATIBLE_MATCHING!>terface.plusK() = <!EXPECT_CLASS_AS_FUNCTION!>StringValue<!>(value).plus("K")<!>.<!UNRESOLVED_REFERENCE!>value<!><!>
|
||||
<!ACTUAL_WITHOUT_EXPECT("actual fun StringDemoInterface.plusK(): <ERROR TYPE REF: Unresolved name: value>; The following declaration is incompatible: expect fun StringDemoInterface.plusK(): String")!>actual fun StringDemoIn<!INCOMPATIBLE_MATCHING!>terface.plusK() = <!EXPECT_CLASS_AS_FUNCTION!>StringValue<!>(value).plus("K")<!>.<!UNRESOLVED_REFERENCE!>value<!><!>
|
||||
|
||||
// FILE: main.kt
|
||||
class StringDemo(override val value: String) : StringDemoInterface
|
||||
|
||||
Reference in New Issue
Block a user