[FIR] NOTHING_TO_OVERRIDE diagnostic
This commit is contained in:
committed by
teamcityserver
parent
9452b788bf
commit
b44785c24e
+2
-2
@@ -19,13 +19,13 @@ fun test(z: Int, c: Char) {}
|
||||
}<!>
|
||||
|
||||
<!REDECLARATION!>class B : <!FINAL_SUPERTYPE, SUPERTYPE_NOT_INITIALIZED!>A<!> {
|
||||
<!CONFLICTING_OVERLOADS!>override fun rest(s: String)<!> {}
|
||||
<!CONFLICTING_OVERLOADS!><!NOTHING_TO_OVERRIDE!>override<!> fun rest(s: String)<!> {}
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun rest(s: String)<!> {}
|
||||
|
||||
fun rest(l: Long) {}
|
||||
|
||||
override val u = 310
|
||||
<!NOTHING_TO_OVERRIDE!>override<!> val u = 310
|
||||
}<!>
|
||||
|
||||
<!REDECLARATION!>interface B<!>
|
||||
|
||||
Vendored
+3
-3
@@ -17,17 +17,17 @@ class CallBasedInExpressionGenerator(
|
||||
private val resolvedCall = operatorReference.<!UNRESOLVED_REFERENCE!>getResolvedCallWithAssert<!>(codegen.<!UNRESOLVED_REFERENCE!>bindingContext<!>)
|
||||
private val isInverted = operatorReference.<!UNRESOLVED_REFERENCE!>getReferencedNameElementType<!>() == <!UNRESOLVED_REFERENCE!>KtTokens<!>.NOT_IN
|
||||
|
||||
override fun generate(argument: StackValue): BranchedValue =
|
||||
<!NOTHING_TO_OVERRIDE!>override<!> fun generate(argument: StackValue): BranchedValue =
|
||||
gen(argument).let { if (isInverted) <!UNRESOLVED_REFERENCE!>Invert<!>(it) else it }
|
||||
|
||||
private fun gen(argument: StackValue): BranchedValue =
|
||||
object : BranchedValue(<!TOO_MANY_ARGUMENTS!>argument<!>, <!TOO_MANY_ARGUMENTS!>null<!>, <!TOO_MANY_ARGUMENTS!>argument.<!UNRESOLVED_REFERENCE!>type<!><!>, <!TOO_MANY_ARGUMENTS!><!UNRESOLVED_REFERENCE!>Opcodes<!>.IFEQ<!>) {
|
||||
override fun putSelector(type: Type, kotlinType: KotlinType?, v: InstructionAdapter) {
|
||||
<!NOTHING_TO_OVERRIDE!>override<!> fun putSelector(type: Type, kotlinType: KotlinType?, v: InstructionAdapter) {
|
||||
invokeFunction(v)
|
||||
<!UNRESOLVED_REFERENCE!>coerceTo<!>(type, kotlinType, v)
|
||||
}
|
||||
|
||||
override fun condJump(jumpLabel: Label, v: InstructionAdapter, jumpIfFalse: Boolean) {
|
||||
<!NOTHING_TO_OVERRIDE!>override<!> fun condJump(jumpLabel: Label, v: InstructionAdapter, jumpIfFalse: Boolean) {
|
||||
invokeFunction(v)
|
||||
v.<!UNRESOLVED_REFERENCE!>visitJumpInsn<!>(if (jumpIfFalse) <!UNRESOLVED_REFERENCE!>Opcodes<!>.IFEQ else <!UNRESOLVED_REFERENCE!>Opcodes<!>.IFNE, jumpLabel)
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -25,7 +25,7 @@ interface B {
|
||||
interface Foo
|
||||
|
||||
expect abstract class AbstractClass : Foo {
|
||||
abstract override fun foo()
|
||||
abstract <!NOTHING_TO_OVERRIDE!>override<!> fun foo()
|
||||
|
||||
abstract fun bar()
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ open class A {
|
||||
class B : A() {
|
||||
override fun foo(): B = this
|
||||
fun <!VIRTUAL_MEMBER_HIDDEN!>bar<!>(): B = this // Missing 'override'
|
||||
override fun buz(p: B): B = this //No override as B not :> A
|
||||
<!NOTHING_TO_OVERRIDE!>override<!> fun buz(p: B): B = this //No override as B not :> A
|
||||
|
||||
fun test() {
|
||||
foo()
|
||||
|
||||
+2
-2
@@ -6,8 +6,8 @@ public interface JA<E> {
|
||||
// FILE: main.kt
|
||||
|
||||
interface KB<F> {
|
||||
override fun getFoo(): F
|
||||
override fun getBar(): F
|
||||
<!NOTHING_TO_OVERRIDE!>override<!> fun getFoo(): F
|
||||
<!NOTHING_TO_OVERRIDE!>override<!> fun getBar(): F
|
||||
}
|
||||
|
||||
interface D1 : JA<String>, KB<String>
|
||||
|
||||
Reference in New Issue
Block a user