Drop traits with required classes
#KT-4771 Rejected
This commit is contained in:
@@ -187,7 +187,7 @@ public native trait HTMLOptionsCollection {
|
||||
}
|
||||
|
||||
deprecated("Use declarations from org.w3c.dom instead")
|
||||
public native trait HTMLDocument : Document {
|
||||
public native class HTMLDocument : Document() {
|
||||
public native fun open(): Unit
|
||||
public native fun write(text: String): Unit
|
||||
public native fun writeln(text: String): Unit
|
||||
|
||||
@@ -101,12 +101,6 @@ public class BridgeTestGenerated extends AbstractBridgeTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("fakeOverrideInTraitWithRequiredFromTraitImpl.kt")
|
||||
public void testFakeOverrideInTraitWithRequiredFromTraitImpl() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/bridges/fakeOverrideInTraitWithRequiredFromTraitImpl.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("fakeOverrideOfPropertySetterInTraitImpl.kt")
|
||||
public void testFakeOverrideOfPropertySetterInTraitImpl() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/bridges/fakeOverrideOfPropertySetterInTraitImpl.kt");
|
||||
@@ -287,12 +281,6 @@ public class BridgeTestGenerated extends AbstractBridgeTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("traitWithRequiredCovariantOverride.kt")
|
||||
public void testTraitWithRequiredCovariantOverride() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/bridges/traitWithRequiredCovariantOverride.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("twoParentsWithDifferentMethodsTwoBridges.kt")
|
||||
public void testTwoParentsWithDifferentMethodsTwoBridges() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/bridges/twoParentsWithDifferentMethodsTwoBridges.kt");
|
||||
|
||||
@@ -44,10 +44,6 @@ public final class ClassInheritanceTest extends SingleFileTranslationTest {
|
||||
checkFooBoxIsOk();
|
||||
}
|
||||
|
||||
public void testCrazyInheritance() throws Exception {
|
||||
checkFooBoxIsOk();
|
||||
}
|
||||
|
||||
public void testValOverride() throws Exception {
|
||||
fooBoxTest();
|
||||
}
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
// Changed when traits were introduced. May not make sense any more
|
||||
|
||||
open class Base() {
|
||||
public var v: Int = 0
|
||||
}
|
||||
|
||||
open class Left() : Base() {
|
||||
}
|
||||
trait Right : Base {
|
||||
}
|
||||
|
||||
class D() : Left(), Right
|
||||
|
||||
fun vl(l: Left): Int = l.v
|
||||
fun vr(r: Right): Int = r.v
|
||||
|
||||
fun box(): String {
|
||||
val d = D()
|
||||
d.v = 42
|
||||
|
||||
if (d.v != 42) return "Fail #1"
|
||||
if (vl(d) != 42) return "Fail #2"
|
||||
if (vr(d) != 42) return "Fail #3"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
package foo
|
||||
|
||||
open class A {
|
||||
open fun f1() = "A1"
|
||||
open fun f2() = "A2"
|
||||
open fun f3() = "A3"
|
||||
open fun f4() = "A4"
|
||||
|
||||
fun getSum(): String {
|
||||
return "${f1()}|${f2()}|${f3()}|${f4()}"
|
||||
}
|
||||
}
|
||||
|
||||
trait T : A {
|
||||
override fun f1() = "T1"
|
||||
override fun f2() = "T2"
|
||||
}
|
||||
|
||||
trait B : A {
|
||||
override fun f1() = "B1"
|
||||
override fun f3() = "B3"
|
||||
}
|
||||
|
||||
trait N : B, T {
|
||||
override fun f1() = "N1"
|
||||
}
|
||||
|
||||
trait X {
|
||||
fun f4() = "X4"
|
||||
}
|
||||
|
||||
class C : A(), N, X {
|
||||
override fun f4() = "C4"
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val a = A()
|
||||
val t = object : T, A() {
|
||||
}
|
||||
val b = object : B, A() {
|
||||
}
|
||||
val n = object : N, A() {
|
||||
}
|
||||
val x = object : X {
|
||||
}
|
||||
val c = C()
|
||||
|
||||
if (a.getSum() != "A1|A2|A3|A4") return "Bad a.getSum(), it: ${a.getSum()}"
|
||||
if (t.getSum() != "T1|T2|A3|A4") return "Bad t.getSum(), it: ${t.getSum()}"
|
||||
if (b.getSum() != "B1|A2|B3|A4") return "Bad b.getSum(), it: ${b.getSum()}"
|
||||
if (n.getSum() != "N1|T2|B3|A4") return "Bad n.getSum(), it: ${n.getSum()}"
|
||||
if (c.getSum() != "N1|T2|B3|C4") return "Bad c.getSum(), it: ${c.getSum()}"
|
||||
|
||||
if (x.f4() != "X4") return "Bad x.f4(), it: ${x.f4()}"
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user