FirSupertypesChecker: implement six more diagnostics
This commit is contained in:
+1
-1
@@ -18,7 +18,7 @@ class WithPC1(a : Int) {
|
||||
}
|
||||
|
||||
|
||||
class Foo() : WithPC0(), <error descr="Type expected"><error descr="[SYNTAX] Syntax error"><error descr="[SYNTAX] Syntax error">this</error></error></error>() {
|
||||
class Foo() : <error descr="[FINAL_SUPERTYPE] This type is final, so it cannot be inherited from">WithPC0</error>(), <error descr="Type expected"><error descr="[SYNTAX] Syntax error"><error descr="[SYNTAX] Syntax error">this</error></error></error>() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -13,7 +13,7 @@ package toplevelObjectDeclarations
|
||||
}
|
||||
}
|
||||
|
||||
object B : A {}
|
||||
object B : <error descr="[SINGLETON_IN_SUPERTYPE] Cannot inherit from a singleton">A</error> {}
|
||||
|
||||
val x = A.foo()
|
||||
|
||||
|
||||
+1
-1
@@ -3,4 +3,4 @@ interface B<T> {}
|
||||
interface C<T> {}
|
||||
interface D<T> {}
|
||||
|
||||
interface Test : A<in Int>, B<out Int>, C<*>???, D<Int> {}
|
||||
interface Test : A<in Int>, B<out Int>, C<*>??<error descr="[NULLABLE_SUPERTYPE] A supertype cannot be nullable">?</error>, D<Int> {}
|
||||
|
||||
+6
-6
@@ -28,22 +28,22 @@ interface Test1 : <error descr="[INTERFACE_WITH_SUPERCLASS] An interface cannot
|
||||
|
||||
interface Test2 : <error descr="[INTERFACE_WITH_SUPERCLASS] An interface cannot inherit from a class">C2</error> {}
|
||||
|
||||
interface Test3 : <error descr="[INTERFACE_WITH_SUPERCLASS] An interface cannot inherit from a class">C2</error>, C3 {}
|
||||
interface Test3 : <error descr="[INTERFACE_WITH_SUPERCLASS] An interface cannot inherit from a class">C2</error>, <error descr="[MANY_CLASSES_IN_SUPERTYPE_LIST] Only one class may appear in a supertype list">C3</error> {}
|
||||
|
||||
interface Test4 : T1 {}
|
||||
|
||||
interface Test5 : T1, T1 {}
|
||||
interface Test5 : T1, <error descr="[SUPERTYPE_APPEARS_TWICE] A supertype appears twice">T1</error> {}
|
||||
|
||||
interface Test6 : <error descr="[INTERFACE_WITH_SUPERCLASS] An interface cannot inherit from a class">C1</error> {}
|
||||
interface Test6 : <error descr="[FINAL_SUPERTYPE] This type is final, so it cannot be inherited from"><error descr="[INTERFACE_WITH_SUPERCLASS] An interface cannot inherit from a class">C1</error></error> {}
|
||||
|
||||
class CTest1() : OC1() {}
|
||||
|
||||
class CTest2 : <error descr="[SUPERTYPE_NOT_INITIALIZED] This type has a constructor, and thus must be initialized here">C2</error> {}
|
||||
|
||||
class CTest3 : <error descr="[SUPERTYPE_NOT_INITIALIZED] This type has a constructor, and thus must be initialized here">C2</error>, C3 {}
|
||||
class CTest3 : <error descr="[SUPERTYPE_NOT_INITIALIZED] This type has a constructor, and thus must be initialized here">C2</error>, <error descr="[MANY_CLASSES_IN_SUPERTYPE_LIST] Only one class may appear in a supertype list">C3</error> {}
|
||||
|
||||
class CTest4 : T1 {}
|
||||
|
||||
class CTest5 : T1, T1 {}
|
||||
class CTest5 : T1, <error descr="[SUPERTYPE_APPEARS_TWICE] A supertype appears twice">T1</error> {}
|
||||
|
||||
class CTest6 : <error descr="[SUPERTYPE_NOT_INITIALIZED] This type has a constructor, and thus must be initialized here">C1</error> {}
|
||||
class CTest6 : <error descr="[FINAL_SUPERTYPE] This type is final, so it cannot be inherited from"><error descr="[SUPERTYPE_NOT_INITIALIZED] This type has a constructor, and thus must be initialized here">C1</error></error> {}
|
||||
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
open class bar()
|
||||
|
||||
interface <error descr="[CONSTRUCTOR_IN_INTERFACE] An interface may not have a constructor">Foo()</error> : <error descr="[INTERFACE_WITH_SUPERCLASS] An interface cannot inherit from a class"><error descr="[SUPERTYPE_INITIALIZED_IN_INTERFACE] Interfaces cannot initialize supertypes">bar</error></error>(), bar, bar {
|
||||
interface <error descr="[CONSTRUCTOR_IN_INTERFACE] An interface may not have a constructor">Foo()</error> : <error descr="[INTERFACE_WITH_SUPERCLASS] An interface cannot inherit from a class"><error descr="[SUPERTYPE_INITIALIZED_IN_INTERFACE] Interfaces cannot initialize supertypes">bar</error></error>(), <error descr="[MANY_CLASSES_IN_SUPERTYPE_LIST] Only one class may appear in a supertype list"><error descr="[SUPERTYPE_APPEARS_TWICE] A supertype appears twice">bar</error></error>, <error descr="[MANY_CLASSES_IN_SUPERTYPE_LIST] Only one class may appear in a supertype list"><error descr="[SUPERTYPE_APPEARS_TWICE] A supertype appears twice">bar</error></error> {
|
||||
}
|
||||
|
||||
interface Foo2 : <error descr="[INTERFACE_WITH_SUPERCLASS] An interface cannot inherit from a class">bar</error>, Foo {
|
||||
}
|
||||
|
||||
open class Foo1() : bar(), bar, Foo, <error descr="[UNRESOLVED_REFERENCE] Unresolved reference: <init>">Foo</error>() {}
|
||||
open class Foo12 : bar(), bar {}
|
||||
open class Foo1() : bar(), <error descr="[MANY_CLASSES_IN_SUPERTYPE_LIST] Only one class may appear in a supertype list"><error descr="[SUPERTYPE_APPEARS_TWICE] A supertype appears twice">bar</error></error>, Foo, <error descr="[SUPERTYPE_APPEARS_TWICE] A supertype appears twice"><error descr="[UNRESOLVED_REFERENCE] Unresolved reference: <init>">Foo</error></error>() {}
|
||||
open class Foo12 : bar(), <error descr="[MANY_CLASSES_IN_SUPERTYPE_LIST] Only one class may appear in a supertype list"><error descr="[SUPERTYPE_APPEARS_TWICE] A supertype appears twice">bar</error></error> {}
|
||||
|
||||
Reference in New Issue
Block a user