KT-2363 Drop secondary constructors
Test data updated
This commit is contained in:
@@ -157,10 +157,9 @@ abstract class B1(
|
|||||||
class B2() : B1(1, "r") {}
|
class B2() : B1(1, "r") {}
|
||||||
|
|
||||||
abstract class B3(i: Int) {
|
abstract class B3(i: Int) {
|
||||||
<warning>this(): this(1)</warning>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun foo(<warning>a</warning>: B3) {
|
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>
|
val <warning>b</warning> = <error>B1(2, "s")</error>
|
||||||
}
|
}
|
||||||
@@ -27,8 +27,4 @@ class WithC() {
|
|||||||
val zzz = <error>$a</error>
|
val zzz = <error>$a</error>
|
||||||
}
|
}
|
||||||
|
|
||||||
<warning>this(a : Int) : this() {
|
|
||||||
val <warning>b</warning> = x
|
|
||||||
}</warning>
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -8,24 +8,13 @@ class NoC2 : <error>WithC1</error>
|
|||||||
class NoC3 : WithC1()
|
class NoC3 : WithC1()
|
||||||
class WithC2() : <error>WithC1</error>
|
class WithC2() : <error>WithC1</error>
|
||||||
|
|
||||||
class <error>NoPC</error> {
|
class NoPC {
|
||||||
<error><error>this</error>() {}</error>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class WithPC0() {
|
class WithPC0() {
|
||||||
<warning>this(a : Int) : this() {}</warning>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class WithPC1(a : Int) {
|
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>
|
val a = <error>return 1</error>
|
||||||
|
|
||||||
class A() {
|
class A() {
|
||||||
<warning>this(a : Int) : this() {
|
|
||||||
if (a == 1)
|
|
||||||
return
|
|
||||||
return <error>1</error>
|
|
||||||
}</warning>
|
|
||||||
|
|
||||||
}
|
}
|
||||||
fun illegalConstantBody(): Int = <error>"s"</error>
|
fun illegalConstantBody(): Int = <error>"s"</error>
|
||||||
fun illegalConstantBlock(): String {
|
fun illegalConstantBlock(): String {
|
||||||
|
|||||||
@@ -16,11 +16,11 @@ class Test() {
|
|||||||
var a : Int = 111
|
var a : Int = 111
|
||||||
var b : Int get() = $a; set(x) {a = x; $a = x}
|
var b : Int get() = $a; set(x) {a = x; $a = x}
|
||||||
|
|
||||||
<warning>this(i : Int) : this() {
|
{
|
||||||
<error>$b</error> = $a
|
<error>$b</error> = $a
|
||||||
$a = <error>$b</error>
|
$a = <error>$b</error>
|
||||||
a = <error>$b</error>
|
a = <error>$b</error>
|
||||||
}</warning>
|
}
|
||||||
fun f() {
|
fun f() {
|
||||||
<error>$b</error> = $a
|
<error>$b</error> = $a
|
||||||
a = <error>$b</error>
|
a = <error>$b</error>
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ trait T1 {}
|
|||||||
trait T2<T> {}
|
trait T2<T> {}
|
||||||
|
|
||||||
trait Test<error>()</error> {
|
trait Test<error>()</error> {
|
||||||
<warning><error>this</error>(x : Int) {}</warning>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
trait Test1 : C2<error>()</error> {}
|
trait Test1 : C2<error>()</error> {}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
open class bar()
|
open class bar()
|
||||||
|
|
||||||
trait Foo<error>()</error> : bar<error>()</error>, <error>bar</error>, <error>bar</error> {
|
trait Foo<error>()</error> : bar<error>()</error>, <error>bar</error>, <error>bar</error> {
|
||||||
<warning><error>this</error>(x : Int) {}</warning>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
trait Foo2 : bar, Foo {
|
trait Foo2 : bar, Foo {
|
||||||
|
|||||||
@@ -7,12 +7,12 @@
|
|||||||
this : Foo
|
this : Foo
|
||||||
}
|
}
|
||||||
|
|
||||||
<warning>this(var bar : Int) : this(1, 1, 1) {
|
{
|
||||||
bar = <warning>1</warning>
|
bar = 1
|
||||||
this.bar
|
this.bar
|
||||||
1 : Int
|
1 : Int
|
||||||
val <warning>a</warning> : Int =1
|
val a : Int =1
|
||||||
this : Foo
|
this : Foo
|
||||||
}</warning>
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
class Z() {
|
|
||||||
<warning>this(x : Int) : this() {}</warning>
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user