Change Signature: Add tests for secondary constructors and delegation calls

This commit is contained in:
Alexey Sedunov
2015-03-18 14:11:08 +03:00
parent d01cc8ac55
commit 173a28a25e
9 changed files with 129 additions and 0 deletions
@@ -0,0 +1,9 @@
class K: J {
constructor(a: Int): super(a, "foo") {
}
}
fun test() {
J(1, "foo")
}
@@ -0,0 +1,5 @@
class J {
public J(int n, String s) {
}
}
@@ -0,0 +1,9 @@
class K: J {
constructor(a: Int): super(a) {
}
}
fun test() {
J(1)
}
@@ -0,0 +1,5 @@
class J {
public <caret>J(int n) {
}
}
@@ -0,0 +1,10 @@
class J extends A {
public J() {
super("foo");
}
public J(int a) {
super("foo");
}
}
@@ -0,0 +1,29 @@
open class A {
<caret>constructor(s: String) {
}
constructor(a: Int) : this("foo") {
}
}
open class B: A {
constructor() : super("foo") {
}
}
open class C: A {
constructor() : super("foo") {
}
}
class D: A("foo") {
}
fun test() {
A("foo")
}
@@ -0,0 +1,9 @@
class J extends A {
public J() {
super();
}
public J(int a) {
}
}
@@ -0,0 +1,29 @@
open class A {
<caret>constructor() {
}
constructor(a: Int) : this() {
}
}
open class B: A {
constructor() : super() {
}
}
open class C: A {
constructor() {
}
}
class D: A() {
}
fun test() {
A()
}