Prohibit super delegation call if there is primary constructor

This commit is contained in:
Denis Zharkov
2015-02-13 16:38:45 +03:00
parent 835a0df13a
commit f673f4ff47
6 changed files with 47 additions and 0 deletions
@@ -0,0 +1,8 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
class A(x: Int) {
<!PRIMARY_CONSTRUCTOR_DELEGATION_CALL_EXPECTED!>constructor<!>() {}
}
open class B(x: Int)
class C(x: Int) : B(x) {
constructor(): <!PRIMARY_CONSTRUCTOR_DELEGATION_CALL_EXPECTED!>super<!>(1) {}
}
@@ -0,0 +1,24 @@
package
internal final class A {
public constructor A()
public constructor A(/*0*/ x: kotlin.Int)
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
internal open class B {
public constructor B(/*0*/ x: kotlin.Int)
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
internal final class C : B {
public constructor C()
public constructor C(/*0*/ x: kotlin.Int)
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}