KT-2363 Drop secondary constructors

Test data updated
This commit is contained in:
Andrey Breslav
2012-07-19 21:01:12 +04:00
parent 4b9df9d541
commit 255b65c667
9 changed files with 8 additions and 35 deletions
+1 -2
View File
@@ -157,10 +157,9 @@ abstract class B1(
class B2() : B1(1, "r") {}
abstract class B3(i: Int) {
<warning>this(): this(1)</warning>
}
fun foo(<warning>a</warning>: B3) {
val <warning>a</warning> = <error>B3()</error>
val <warning>a</warning> = <error>B3(1)</error>
val <warning>b</warning> = <error>B1(2, "s")</error>
}
@@ -27,8 +27,4 @@ class WithC() {
val zzz = <error>$a</error>
}
<warning>this(a : Int) : this() {
val <warning>b</warning> = x
}</warning>
}
+1 -12
View File
@@ -8,24 +8,13 @@ class NoC2 : <error>WithC1</error>
class NoC3 : WithC1()
class WithC2() : <error>WithC1</error>
class <error>NoPC</error> {
<error><error>this</error>() {}</error>
class NoPC {
}
class WithPC0() {
<warning>this(a : Int) : this() {}</warning>
}
class WithPC1(a : Int) {
<warning><error>this</error>() {}</warning>
<warning>this(b : Long) : this("") {}</warning>
<warning>this(s : String) : this(1) {}</warning>
<warning>this(b : Char) : <error>this</error>("", 2) {}</warning>
<warning>this(b : Byte) : this(""), <error>this(1)</error> {}</warning>
}
@@ -134,12 +134,6 @@ fun nonBlockNoReturnIfUnitInOneBranch(): Int = if (1 < 2) <error>{}</error> else
val a = <error>return 1</error>
class A() {
<warning>this(a : Int) : this() {
if (a == 1)
return
return <error>1</error>
}</warning>
}
fun illegalConstantBody(): Int = <error>"s"</error>
fun illegalConstantBlock(): String {
+2 -2
View File
@@ -16,11 +16,11 @@ class Test() {
var a : Int = 111
var b : Int get() = $a; set(x) {a = x; $a = x}
<warning>this(i : Int) : this() {
{
<error>$b</error> = $a
$a = <error>$b</error>
a = <error>$b</error>
}</warning>
}
fun f() {
<error>$b</error> = $a
a = <error>$b</error>
@@ -22,7 +22,6 @@ trait T1 {}
trait T2<T> {}
trait Test<error>()</error> {
<warning><error>this</error>(x : Int) {}</warning>
}
trait Test1 : C2<error>()</error> {}
@@ -1,7 +1,6 @@
open class bar()
trait Foo<error>()</error> : bar<error>()</error>, <error>bar</error>, <error>bar</error> {
<warning><error>this</error>(x : Int) {}</warning>
}
trait Foo2 : bar, Foo {
@@ -7,12 +7,12 @@
this : Foo
}
<warning>this(var bar : Int) : this(1, 1, 1) {
bar = <warning>1</warning>
{
bar = 1
this.bar
1 : Int
val <warning>a</warning> : Int =1
val a : Int =1
this : Foo
}</warning>
}
}
@@ -1,3 +0,0 @@
class Z() {
<warning>this(x : Int) : this() {}</warning>
}