KT-286 Check supertype lists (in progress)
Tests involving multiple inheritance fixed
This commit is contained in:
@@ -49,7 +49,7 @@ namespace html {
|
||||
|
||||
class Title() : TagWithText("title")
|
||||
|
||||
class BodyTag(name : String) : TagWithText(name) {
|
||||
abstract class BodyTag(name : String) : TagWithText(name) {
|
||||
}
|
||||
|
||||
class Body() : BodyTag("body") {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
|
||||
class NoC
|
||||
open class NoC
|
||||
class NoC1 : NoC
|
||||
|
||||
class WithC0() : NoC<error>()</error>
|
||||
class WithC1() : NoC
|
||||
open class WithC1() : NoC
|
||||
class NoC2 : <error>WithC1</error>
|
||||
class NoC3 : WithC1<error>()</error>
|
||||
class WithC2() : <error>WithC1</error>
|
||||
|
||||
@@ -4,14 +4,14 @@ open class A() {
|
||||
fun foo() : Int = 1
|
||||
}
|
||||
|
||||
open class B() {
|
||||
trait class B {
|
||||
fun bar() : Double = 1.0;
|
||||
}
|
||||
|
||||
class C() : A(), B()
|
||||
class C() : A(), B
|
||||
|
||||
class D() {
|
||||
class object : A(), B () {}
|
||||
class object : A(), B {}
|
||||
}
|
||||
|
||||
class Test1<T : A>()
|
||||
@@ -61,7 +61,7 @@ fun <T : A> test2(t : T)
|
||||
}
|
||||
|
||||
val t1 = test2<<error>A</error>>(A())
|
||||
val t2 = test2<<error>B</error>>(B())
|
||||
val t2 = test2<<error>B</error>>(C())
|
||||
val t3 = test2<C>(C())
|
||||
|
||||
class Test<<error>T</error>>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
namespace toplevelObjectDeclarations {
|
||||
class Foo(y : Int) {
|
||||
open class Foo(y : Int) {
|
||||
virtual fun foo() : Int = 1
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace localObjects {
|
||||
val x : Int = 0
|
||||
}
|
||||
|
||||
class Foo {
|
||||
open class Foo {
|
||||
fun foo() : Int = 1
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ class <error>X</error> {
|
||||
val <error>x</error> : Int
|
||||
}
|
||||
|
||||
class Y() {
|
||||
open class Y() {
|
||||
val x : Int = 2
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
// KT-286 Check supertype lists
|
||||
|
||||
/*
|
||||
In a supertype list:
|
||||
Same type should not be mentioned twice
|
||||
Same type should not be indirectly mentioned with incoherent type arguments
|
||||
Every trait's required dependencies should be satisfied
|
||||
No final types should appear
|
||||
Only one class is allowed
|
||||
*/
|
||||
|
||||
class C1()
|
||||
|
||||
open class OC1()
|
||||
|
||||
open class C2 {}
|
||||
|
||||
open class C3 {}
|
||||
|
||||
trait class T1 {}
|
||||
|
||||
trait class T2<T> {}
|
||||
|
||||
trait class Test<error>()</error> {
|
||||
<error>this</error>(x : Int) {}
|
||||
}
|
||||
|
||||
trait class Test1 : C2<error>()</error> {}
|
||||
|
||||
trait class Test2 : C2 {}
|
||||
|
||||
trait class Test3 : C2, <error>C3</error> {}
|
||||
|
||||
trait class Test4 : T1 {}
|
||||
|
||||
trait class Test5 : T1, <error>T1</error> {}
|
||||
|
||||
trait class Test6 : <error>C1</error> {}
|
||||
|
||||
class CTest1() : OC1() {}
|
||||
|
||||
class CTest2 : C2 {}
|
||||
|
||||
class CTest3 : C2, <error>C3</error> {}
|
||||
|
||||
class CTest4 : T1 {}
|
||||
|
||||
class CTest5 : T1, <error>T1</error> {}
|
||||
|
||||
class CTest6 : <error>C1</error> {}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
class bar()
|
||||
open class bar()
|
||||
|
||||
trait open class Foo<error>()</error> : bar<error>()</error>, bar, <error>bar</error> {
|
||||
trait open class Foo<error>()</error> : bar<error>()</error>, <error>bar</error>, <error>bar</error> {
|
||||
<error>this</error>(x : Int) {}
|
||||
}
|
||||
|
||||
trait open class Foo2 : bar, Foo {
|
||||
}
|
||||
|
||||
open class Foo1() : bar(), <error>bar</error>, Foo, Foo<error>()</error> {}
|
||||
open class Foo1() : bar(), <error>bar</error>, Foo, <error>Foo</error><error>()</error> {}
|
||||
open class Foo12 : bar<error>()</error>, <error>bar</error> {}
|
||||
@@ -1,4 +1,4 @@
|
||||
class A() {
|
||||
<info>open</info> class A() {
|
||||
fun foo() {}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// JET-11 Redeclaration & Forward reference for classes cause an exception
|
||||
class <error>NoC</error>
|
||||
open class <error>NoC</error>
|
||||
class NoC1 : NoC
|
||||
class <error>NoC</error>
|
||||
open class <error>NoC</error>
|
||||
|
||||
Reference in New Issue
Block a user