Properly report diagnostics on platformStatic annotations
#KT-6937 Fixed
This commit is contained in:
+35
@@ -0,0 +1,35 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
import kotlin.platform.platformStatic
|
||||
|
||||
abstract class A {
|
||||
|
||||
open fun a() {}
|
||||
|
||||
abstract fun b()
|
||||
|
||||
open fun c() {}
|
||||
}
|
||||
|
||||
object B: A() {
|
||||
|
||||
<!OVERRIDE_CANNOT_BE_STATIC!>[platformStatic] override fun a()<!> {}
|
||||
|
||||
<!OVERRIDE_CANNOT_BE_STATIC!>[platformStatic] override fun b()<!> {}
|
||||
|
||||
<!OVERRIDE_CANNOT_BE_STATIC!>[platformStatic] final override fun c()<!> {}
|
||||
|
||||
[platformStatic] open fun d() {}
|
||||
}
|
||||
|
||||
class C {
|
||||
|
||||
default object: A() {
|
||||
[platformStatic] override fun a() {}
|
||||
|
||||
[platformStatic] override fun b() {}
|
||||
|
||||
[platformStatic] final override fun c() {}
|
||||
|
||||
[platformStatic] open fun d() {}
|
||||
}
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package
|
||||
|
||||
internal abstract class A {
|
||||
public constructor A()
|
||||
internal open fun a(): kotlin.Unit
|
||||
internal abstract fun b(): kotlin.Unit
|
||||
internal open fun c(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
internal object B : A {
|
||||
private constructor B()
|
||||
kotlin.platform.platformStatic() internal open override /*1*/ fun a(): kotlin.Unit
|
||||
kotlin.platform.platformStatic() internal open override /*1*/ fun b(): kotlin.Unit
|
||||
kotlin.platform.platformStatic() internal final override /*1*/ fun c(): kotlin.Unit
|
||||
kotlin.platform.platformStatic() internal open fun d(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
internal final class C {
|
||||
public constructor C()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
internal default object Default : A {
|
||||
private constructor Default()
|
||||
kotlin.platform.platformStatic() internal open override /*1*/ fun a(): kotlin.Unit
|
||||
kotlin.platform.platformStatic() internal open override /*1*/ fun b(): kotlin.Unit
|
||||
kotlin.platform.platformStatic() internal final override /*1*/ fun c(): kotlin.Unit
|
||||
kotlin.platform.platformStatic() internal open fun d(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -29,12 +29,12 @@ class A {
|
||||
|
||||
[platformStatic] val z = 1;
|
||||
|
||||
<!OPEN_CANNOT_BE_STATIC!>[platformStatic] override val base1: Int<!> = 0
|
||||
<!OVERRIDE_CANNOT_BE_STATIC!>[platformStatic] override val base1: Int<!> = 0
|
||||
|
||||
<!OPEN_CANNOT_BE_STATIC!>platformStatic open fun f()<!> {}
|
||||
platformStatic open fun f() {}
|
||||
|
||||
override val base2: Int = 0
|
||||
<!OPEN_CANNOT_BE_STATIC!>[platformStatic] get<!>
|
||||
<!OVERRIDE_CANNOT_BE_STATIC!>[platformStatic] get<!>
|
||||
}
|
||||
|
||||
var p:Int = 1
|
||||
|
||||
Reference in New Issue
Block a user