FirSupertypesChecker: implement six more diagnostics
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
FILE: classInSupertypeForEnum.kt
|
||||
public final class A : R|kotlin/Any| {
|
||||
public open class A : R|kotlin/Any| {
|
||||
public constructor(): R|A| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
class A
|
||||
open class A
|
||||
|
||||
interface C
|
||||
|
||||
enum class B : C, <!CLASS_IN_SUPERTYPE_FOR_ENUM!>A<!>(), Any()
|
||||
enum class B : C, <!CLASS_IN_SUPERTYPE_FOR_ENUM!>A<!>(), <!MANY_CLASSES_IN_SUPERTYPE_LIST!>Any<!>()
|
||||
|
||||
+3
-1
@@ -1,3 +1,5 @@
|
||||
// FIR_IDE_IGNORE
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun test(x: Int)<!> {}
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun test(y: Int)<!> {}
|
||||
@@ -16,7 +18,7 @@ fun test(z: Int, c: Char) {}
|
||||
|
||||
}<!>
|
||||
|
||||
<!REDECLARATION!>class B : <!SUPERTYPE_NOT_INITIALIZED!>A<!> {
|
||||
<!REDECLARATION!>class B : <!FINAL_SUPERTYPE, SUPERTYPE_NOT_INITIALIZED!>A<!> {
|
||||
<!CONFLICTING_OVERLOADS!>override fun rest(s: String)<!> {}
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun rest(s: String)<!> {}
|
||||
|
||||
Vendored
+1
-1
@@ -125,7 +125,7 @@ FILE: cyclicConstructorDelegationCall.kt
|
||||
}
|
||||
|
||||
}
|
||||
public final class M : R|kotlin/Any| {
|
||||
public open class M : R|kotlin/Any| {
|
||||
public constructor(m: R|kotlin/Int|): R|M| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -58,7 +58,7 @@ class K(x: Int) {
|
||||
constructor() : <!CYCLIC_CONSTRUCTOR_DELEGATION_CALL!>this<!>() {}
|
||||
}
|
||||
|
||||
class M {
|
||||
open class M {
|
||||
constructor(m: Int)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
FILE: delegationInInterface.kt
|
||||
public final class A : R|kotlin/Any| {
|
||||
public open class A : R|kotlin/Any| {
|
||||
public constructor(): R|A| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
class A
|
||||
open class A
|
||||
|
||||
interface B : <!DELEGATION_IN_INTERFACE, INTERFACE_WITH_SUPERCLASS!>A<!> by <!UNRESOLVED_REFERENCE!>a<!> {
|
||||
val a: A
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
FILE: explicitDelegationCallRequired.kt
|
||||
public final class A : R|kotlin/Any| {
|
||||
public open class A : R|kotlin/Any| {
|
||||
public constructor(x: R|kotlin/Int|): R|A| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
class A(x: Int) {
|
||||
open class A(x: Int) {
|
||||
constructor(z: String) : this(10)
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
FILE: interfaceWithSuperclass.kt
|
||||
public final class A : R|kotlin/Any| {
|
||||
public open class A : R|kotlin/Any| {
|
||||
public constructor(): R|A| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
@@ -9,7 +9,7 @@ FILE: interfaceWithSuperclass.kt
|
||||
}
|
||||
public abstract interface C : R|kotlin/Any| {
|
||||
}
|
||||
public final class D : R|kotlin/Any| {
|
||||
public open class D : R|kotlin/Any| {
|
||||
public constructor(): R|D| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
class A
|
||||
open class A
|
||||
|
||||
interface B : <!INTERFACE_WITH_SUPERCLASS, SUPERTYPE_INITIALIZED_IN_INTERFACE!>A<!>()
|
||||
|
||||
interface C
|
||||
class D
|
||||
open class D
|
||||
|
||||
interface E : <!INTERFACE_WITH_SUPERCLASS, SUPERTYPE_INITIALIZED_IN_INTERFACE!>A<!>(), C, <!SUPERTYPE_INITIALIZED_IN_INTERFACE!>D<!>()
|
||||
interface E : <!INTERFACE_WITH_SUPERCLASS, SUPERTYPE_INITIALIZED_IN_INTERFACE!>A<!>(), C, <!MANY_CLASSES_IN_SUPERTYPE_LIST, SUPERTYPE_INITIALIZED_IN_INTERFACE!>D<!>()
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
FILE: notASupertype.kt
|
||||
public final class A : R|kotlin/Any| {
|
||||
public open class A : R|kotlin/Any| {
|
||||
public constructor(): R|A| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class A {
|
||||
open class A {
|
||||
fun f() {}
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -1,3 +1,5 @@
|
||||
// FIR_IDE_IGNORE
|
||||
|
||||
sealed class A
|
||||
|
||||
<!REDECLARATION!>class B : A()<!>
|
||||
@@ -6,7 +8,7 @@ interface C : <!INTERFACE_WITH_SUPERCLASS!>A<!>
|
||||
|
||||
interface D : C, <!INTERFACE_WITH_SUPERCLASS!>A<!>
|
||||
|
||||
class E : B, A()
|
||||
class E : <!SINGLETON_IN_SUPERTYPE!>B<!>, <!MANY_CLASSES_IN_SUPERTYPE_LIST!>A<!>()
|
||||
|
||||
sealed class P {
|
||||
object H: P()
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
FILE: superIsNotAnExpression.kt
|
||||
public final class A : R|kotlin/Any| {
|
||||
public open class A : R|kotlin/Any| {
|
||||
public constructor(): R|A| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
class A
|
||||
open class A
|
||||
|
||||
class B: A() {
|
||||
fun act() {
|
||||
|
||||
Vendored
+1
-1
@@ -3,7 +3,7 @@ FILE: supertypeInitializedInInterface.kt
|
||||
}
|
||||
public abstract interface B : R|A| {
|
||||
}
|
||||
public final class C : R|kotlin/Any| {
|
||||
public open class C : R|kotlin/Any| {
|
||||
public constructor(): R|C| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -2,12 +2,12 @@ interface A
|
||||
|
||||
interface B : <!SUPERTYPE_INITIALIZED_IN_INTERFACE!>A<!>()
|
||||
|
||||
class C
|
||||
open class C
|
||||
|
||||
interface D : <!INTERFACE_WITH_SUPERCLASS, SUPERTYPE_INITIALIZED_IN_INTERFACE!>C<!>()
|
||||
|
||||
interface E : <!INTERFACE_WITH_SUPERCLASS, SUPERTYPE_INITIALIZED_IN_INTERFACE!>Any<!>()
|
||||
|
||||
interface F : A, <!SUPERTYPE_INITIALIZED_IN_INTERFACE!>B<!>(), <!INTERFACE_WITH_SUPERCLASS!>C<!>, <!SUPERTYPE_INITIALIZED_IN_INTERFACE!>D<!>(), <!SUPERTYPE_INITIALIZED_IN_INTERFACE!>Any<!>() {
|
||||
interface F : A, <!SUPERTYPE_INITIALIZED_IN_INTERFACE!>B<!>(), <!INTERFACE_WITH_SUPERCLASS!>C<!>, <!SUPERTYPE_INITIALIZED_IN_INTERFACE!>D<!>(), <!MANY_CLASSES_IN_SUPERTYPE_LIST, SUPERTYPE_INITIALIZED_IN_INTERFACE!>Any<!>() {
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
FILE: supertypeInitializedWithoutPrimaryConstructor.kt
|
||||
public final class A : R|kotlin/Any| {
|
||||
public open class A : R|kotlin/Any| {
|
||||
public constructor(): R|A| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
@@ -11,7 +11,7 @@ FILE: supertypeInitializedWithoutPrimaryConstructor.kt
|
||||
}
|
||||
|
||||
}
|
||||
public final class C : R|kotlin/Any| {
|
||||
public open class C : R|kotlin/Any| {
|
||||
public constructor(x: R|kotlin/Int|): R|C| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
class A
|
||||
open class A
|
||||
class B : <!SUPERTYPE_NOT_INITIALIZED!>A<!>
|
||||
|
||||
class C(x: Int)
|
||||
open class C(x: Int)
|
||||
<!NO_VALUE_FOR_PARAMETER!>class D : <!SUPERTYPE_NOT_INITIALIZED!>C<!><!>
|
||||
class E : C(10)
|
||||
class F() : C(10)
|
||||
|
||||
+3
-3
@@ -1,17 +1,17 @@
|
||||
FILE: fakeRecursiveSupertype.kt
|
||||
public final class My : <ERROR TYPE REF: Loop in supertype: /My -> /My> {
|
||||
public open class My : <ERROR TYPE REF: Loop in supertype: /My -> /My> {
|
||||
public constructor(): R|My| {
|
||||
super<R|My|>()
|
||||
}
|
||||
|
||||
}
|
||||
public final class Your : R|His| {
|
||||
public open class Your : R|His| {
|
||||
public constructor(): R|Your| {
|
||||
super<R|His|>()
|
||||
}
|
||||
|
||||
}
|
||||
public final class His : <ERROR TYPE REF: Loop in supertype: /His -> /Your> {
|
||||
public open class His : <ERROR TYPE REF: Loop in supertype: /His -> /Your> {
|
||||
public constructor(): R|His| {
|
||||
super<R|Your|>()
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import incorrect.directory.My
|
||||
|
||||
class My : <!OTHER_ERROR!>My<!>()
|
||||
open class My : <!OTHER_ERROR!>My<!>()
|
||||
|
||||
class Your : His()
|
||||
open class Your : His()
|
||||
|
||||
class His : <!OTHER_ERROR!>Your<!>()
|
||||
open class His : <!OTHER_ERROR!>Your<!>()
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
FILE: supertypeGenericsComplex.kt
|
||||
public final class Out<out T> : R|kotlin/Any| {
|
||||
public open class Out<out T> : R|kotlin/Any| {
|
||||
public constructor<out T>(): R|Out<T>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
class Out<out T>
|
||||
open class Out<out T>
|
||||
|
||||
interface X : <!INTERFACE_WITH_SUPERCLASS!>Out<String><!>
|
||||
|
||||
|
||||
+2
-2
@@ -7,12 +7,12 @@ FILE: Test.kt
|
||||
}
|
||||
public final fun listOf(): R|kotlin/collections/List<kotlin/String>| {
|
||||
}
|
||||
public final class LightMember<D> : R|Member<D>|, R|Light| {
|
||||
public open class LightMember<D> : R|Member<D>|, R|Light| {
|
||||
public constructor<D>(): R|LightMember<D>| {
|
||||
super<R|Light|>()
|
||||
}
|
||||
|
||||
public final override fun getName(): R|kotlin/String| {
|
||||
public open override fun getName(): R|kotlin/String| {
|
||||
^getName String(Light)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ fun List<Int>.single(): Int = 2
|
||||
|
||||
fun listOf(): List<String> {}
|
||||
|
||||
public class LightMember<D> : Member<D>, Light() {
|
||||
public open class LightMember<D> : Member<D>, Light() {
|
||||
override fun getName(): String = "Light"
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -28,7 +28,7 @@ private class C {
|
||||
}
|
||||
}
|
||||
|
||||
class D : <!SUPERTYPE_NOT_INITIALIZED!>A<!> {
|
||||
class D : <!FINAL_SUPERTYPE, SUPERTYPE_NOT_INITIALIZED!>A<!> {
|
||||
class Test1 : A.AProtectedI {
|
||||
|
||||
}
|
||||
@@ -38,11 +38,11 @@ interface E {
|
||||
|
||||
}
|
||||
|
||||
class Test2 : A.APublicI, <!UNRESOLVED_REFERENCE!>B.BInner<!>() {
|
||||
class Test2 : A.APublicI, <!FINAL_SUPERTYPE, UNRESOLVED_REFERENCE!>B.BInner<!>() {
|
||||
|
||||
}
|
||||
|
||||
class Test3 : C.CPublicI, <!EXPOSED_SUPER_CLASS, SUPERTYPE_NOT_INITIALIZED!>C<!> {
|
||||
class Test3 : C.CPublicI, <!EXPOSED_SUPER_CLASS, FINAL_SUPERTYPE, SUPERTYPE_NOT_INITIALIZED!>C<!> {
|
||||
|
||||
}
|
||||
|
||||
@@ -50,11 +50,11 @@ class Test4 : E, A.AProtectedI {
|
||||
|
||||
}
|
||||
|
||||
class Test5 : C.CPublicI, <!UNRESOLVED_REFERENCE!>B.BInner<!>() {
|
||||
class Test5 : C.CPublicI, <!FINAL_SUPERTYPE, UNRESOLVED_REFERENCE!>B.BInner<!>() {
|
||||
|
||||
}
|
||||
|
||||
class Test6 : E, <!EXPOSED_SUPER_CLASS, SUPERTYPE_NOT_INITIALIZED!>C.CPublic<!> {
|
||||
class Test6 : E, <!EXPOSED_SUPER_CLASS, FINAL_SUPERTYPE, SUPERTYPE_NOT_INITIALIZED!>C.CPublic<!> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ FILE: common.kt
|
||||
}
|
||||
Module: m1-jvm
|
||||
FILE: jvm.kt
|
||||
public final actual class MyList : R|kotlin/Any| {
|
||||
public open actual class MyList : R|kotlin/Any| {
|
||||
public constructor(): R|MyList| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ open class Wrapper(val list: MyList)
|
||||
// MODULE: m1-jvm(m1-common)
|
||||
// FILE: jvm.kt
|
||||
|
||||
actual class MyList {
|
||||
actual open class MyList {
|
||||
actual fun get(i: Int): Int = i
|
||||
|
||||
fun set(i: Int, v: Int) {}
|
||||
|
||||
@@ -38,7 +38,7 @@ FILE: problems.kt
|
||||
public get(): R|kotlin/String|
|
||||
public final val p: R|kotlin/Pair<kotlin/Int, kotlin/String>| = R|kotlin/Pair.Pair|<R|kotlin/Int|, R|kotlin/String|>(Int(0), String())
|
||||
public get(): R|kotlin/Pair<kotlin/Int, kotlin/String>|
|
||||
public final class Base<T> : R|kotlin/Any| {
|
||||
public open class Base<T> : R|kotlin/Any| {
|
||||
public constructor<T>(x: R|T|): R|Base<T>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ val String.bar get() = "987"
|
||||
|
||||
val p = Pair(0, "")
|
||||
|
||||
class Base<T>(val x: T)
|
||||
open class Base<T>(val x: T)
|
||||
class Derived : Base<Int>(10)
|
||||
val xx = Derived().x + 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user