FIR: report ABSTRACT_*_NOT_IMPLEMENTED on appropriate intersections
This commit is contained in:
+1
-1
@@ -25,7 +25,7 @@ interface G<T> {
|
||||
fun foo(t : T) : T
|
||||
}
|
||||
|
||||
class GC() : G<Int> {
|
||||
<!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>class GC<!>() : G<Int> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ abstract class A<T> {
|
||||
public abstract fun bar(x: T)
|
||||
|
||||
public inner abstract class B<S> : A<B<S>>() {
|
||||
public inner class C<U> : <!UNRESOLVED_REFERENCE!>B<C<U>><!>()
|
||||
public inner <!ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED!>class C<!><U> : <!UNRESOLVED_REFERENCE!>B<C<U>><!>()
|
||||
{
|
||||
// Here B<C<U>> means A<A<A<T>.B<S>>.B<A<T>.B<S>.C<U>>>.B<A<A<T>.B<S>>.B<A<T>.B<S>.C<U>>.C<U>>
|
||||
// while for being a correct override it should be A<A<T>.B<S>>.B<A<T>.B<S>.C<U>>
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
package typeReferenceError
|
||||
|
||||
class Pair<<!SYNTAX!><!>:<!UNRESOLVED_REFERENCE!>(val c: <!SYNTAX!><!SYNTAX!><!>fun<!><!SYNTAX!><!> <!UNRESOLVED_REFERENCE!>main<!><!>()
|
||||
<!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>class Pair<!><<!SYNTAX!><!>:<!UNRESOLVED_REFERENCE!>(val c: <!SYNTAX!><!SYNTAX!><!>fun<!><!SYNTAX!><!> <!UNRESOLVED_REFERENCE!>main<!><!>()
|
||||
|
||||
Vendored
+1
-1
@@ -108,7 +108,7 @@ public class A extends AImpl implements List<String> {
|
||||
}
|
||||
|
||||
// FILE: X.kt
|
||||
<!ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED!>class X<!> : A()
|
||||
<!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>class X<!> : A()
|
||||
|
||||
fun main() {
|
||||
val x = X()
|
||||
|
||||
Vendored
+1
-1
@@ -95,7 +95,7 @@ public class A extends AImpl implements List<String> {
|
||||
}
|
||||
|
||||
// FILE: X.kt
|
||||
<!ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED!>class X<!> : A()
|
||||
<!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>class X<!> : A()
|
||||
|
||||
fun main() {
|
||||
val x = X()
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
interface ILeft {
|
||||
fun foo()
|
||||
}
|
||||
|
||||
interface IRight {
|
||||
fun foo()
|
||||
}
|
||||
|
||||
interface IDerived : ILeft, IRight
|
||||
|
||||
class CDerived : ILeft, IRight
|
||||
|
||||
abstract class ADerived : ILeft, IRight
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
interface ILeft {
|
||||
fun foo()
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
package extendFunctionClass
|
||||
|
||||
class A : Function1<Int, Int> {
|
||||
|
||||
}
|
||||
|
||||
class B : Function1<Int, Int> {
|
||||
override fun invoke(p1 : Int) = p1
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
package extendFunctionClass
|
||||
|
||||
<!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>class A<!> : Function1<Int, Int> {
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
interface A {
|
||||
fun foo() {}
|
||||
}
|
||||
|
||||
interface B : A {
|
||||
abstract override fun foo()
|
||||
}
|
||||
|
||||
interface C {
|
||||
abstract fun foo()
|
||||
}
|
||||
|
||||
// Fake override Z#foo should be abstract
|
||||
class Z : B, C
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
interface A {
|
||||
fun foo() {}
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
interface A {
|
||||
fun foo() {}
|
||||
}
|
||||
|
||||
interface B : A {
|
||||
abstract override fun foo()
|
||||
}
|
||||
|
||||
interface C : A {
|
||||
abstract override fun foo()
|
||||
}
|
||||
|
||||
interface D : A
|
||||
|
||||
// Fake override Z#foo should be abstract
|
||||
class Z : B, C, D
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
interface A {
|
||||
fun foo() {}
|
||||
}
|
||||
|
||||
@@ -40,15 +40,15 @@ abstract class MyAbstractClass1 : MyTrait<Int>, MyAbstractClass<String>() {
|
||||
override fun bar(t: String) = t
|
||||
}
|
||||
|
||||
class MyIllegalGenericClass1<T> : MyTrait<T>, MyAbstractClass<T>() {}
|
||||
class MyIllegalGenericClass2<T, R>(r : R) : MyTrait<T>, MyAbstractClass<R>() {
|
||||
<!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>class MyIllegalGenericClass1<!><T> : MyTrait<T>, MyAbstractClass<T>() {}
|
||||
<!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>class MyIllegalGenericClass2<!><T, R>(r : R) : MyTrait<T>, MyAbstractClass<R>() {
|
||||
override fun foo(r: R) = r
|
||||
override val <T> pr : R = r
|
||||
}
|
||||
class MyIllegalClass1 : MyTrait<Int>, MyAbstractClass<String>() {}
|
||||
<!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>class MyIllegalClass1<!> : MyTrait<Int>, MyAbstractClass<String>() {}
|
||||
abstract class MyLegalAbstractClass1 : MyTrait<Int>, MyAbstractClass<String>() {}
|
||||
|
||||
class MyIllegalClass2<T>(t : T) : MyTrait<Int>, MyAbstractClass<Int>() {
|
||||
<!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>class MyIllegalClass2<!><T>(t : T) : MyTrait<Int>, MyAbstractClass<Int>() {
|
||||
fun foo(t: T) = t
|
||||
fun bar(t: T) = t
|
||||
val <R> pr : T = t
|
||||
|
||||
Vendored
+2
-2
@@ -6,5 +6,5 @@ interface Y {
|
||||
fun foo(a : Int = 1)
|
||||
}
|
||||
|
||||
class Z1 : X, Y {} // BUG
|
||||
object Z1O : X, Y {} // BUG
|
||||
<!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>class Z1<!> : X, Y {} // BUG
|
||||
<!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>object Z1O<!> : X, Y {} // BUG
|
||||
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
package test
|
||||
|
||||
interface A {
|
||||
val a: String
|
||||
}
|
||||
|
||||
interface B {
|
||||
val a: String
|
||||
}
|
||||
|
||||
open class C {
|
||||
private val a: String = ""
|
||||
}
|
||||
|
||||
class Subject : C(), A, B {
|
||||
val c = a
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
package test
|
||||
|
||||
interface A {
|
||||
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
// http://youtrack.jetbrains.com/issue/KT-1996
|
||||
|
||||
interface Foo {
|
||||
fun foo(): Unit
|
||||
}
|
||||
|
||||
interface Bar {
|
||||
fun foo(): Unit
|
||||
}
|
||||
|
||||
class Baz : Foo, Bar
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// http://youtrack.jetbrains.com/issue/KT-1996
|
||||
|
||||
interface Foo {
|
||||
|
||||
Vendored
+1
-1
@@ -19,7 +19,7 @@ interface IDerived : ILeft, IRight {
|
||||
}
|
||||
|
||||
// Error: ILeft::copy and IRight::copy have unrelated return types
|
||||
class CDerivedInvalid1 : ILeft, IRight
|
||||
<!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>class CDerivedInvalid1<!> : ILeft, IRight
|
||||
|
||||
// Error: CLeft::copy and IRight::copy have unrelated return types
|
||||
class CDerivedInvalid2 : CLeft(), IRight
|
||||
|
||||
Vendored
+1
-1
@@ -9,7 +9,7 @@ fun test() {
|
||||
<!INAPPLICABLE_CANDIDATE!>a<!> {}
|
||||
}
|
||||
|
||||
class Ext : String.() -> Unit {
|
||||
<!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>class Ext<!> : String.() -> Unit {
|
||||
}
|
||||
|
||||
fun test2() {
|
||||
|
||||
Reference in New Issue
Block a user