Initial implementation of KT-4046 Support 'Create constructor matching superclass'
#KT-4046 Fixed
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
// "Add constructor parameters and use them" "true"
|
||||
import java.io.DataInputStream
|
||||
|
||||
class C : DataInputStream<caret>
|
||||
@@ -0,0 +1,5 @@
|
||||
// "Add constructor parameters and use them" "true"
|
||||
import java.io.DataInputStream
|
||||
import java.io.InputStream
|
||||
|
||||
class C(p0: InputStream) : DataInputStream<caret>(p0)
|
||||
@@ -0,0 +1,4 @@
|
||||
// "Add constructor parameters and use them" "true"
|
||||
open class Base(p1: Int, val p2: Int)
|
||||
|
||||
class C(p: Int) : Base<caret>
|
||||
@@ -0,0 +1,4 @@
|
||||
// "Add constructor parameters and use them" "true"
|
||||
open class Base(p1: Int, val p2: Int)
|
||||
|
||||
class C(p: Int, p1: Int, p2: Int) : Base<caret>(p1, p2)
|
||||
@@ -0,0 +1,4 @@
|
||||
// "Add constructor parameters and use them" "true"
|
||||
open class Base(p1: Int, val p2: Int)
|
||||
|
||||
class C : Base<caret>
|
||||
@@ -0,0 +1,4 @@
|
||||
// "Add constructor parameters and use them" "true"
|
||||
open class Base(p1: Int, val p2: Int)
|
||||
|
||||
class C(p1: Int, p2: Int) : Base<caret>(p1, p2)
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Add constructor parameters and use them" "true"
|
||||
trait I
|
||||
|
||||
open class Base<T1, T2>(p1: T1, p2: T2, p3: Base<T1, T2>?)
|
||||
|
||||
class C<T> : I, Base<T, String><caret>
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Add constructor parameters and use them" "true"
|
||||
trait I
|
||||
|
||||
open class Base<T1, T2>(p1: T1, p2: T2, p3: Base<T1, T2>?)
|
||||
|
||||
class C<T>(p1: T, p2: String, p3: Base<T, String>?) : I, Base<T, String><caret>(p1, p2, p3)
|
||||
@@ -0,0 +1,4 @@
|
||||
// "Add constructor parameters and use them" "true"
|
||||
open class Base(p1: Int, val p2: Int)
|
||||
|
||||
class C private : Base<caret>
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// "Add constructor parameters and use them" "true"
|
||||
open class Base(p1: Int, val p2: Int)
|
||||
|
||||
class C private (p1: Int, p2: Int) : Base<caret>(p1, p2)
|
||||
@@ -0,0 +1,4 @@
|
||||
// "Add constructor parameters and use them" "true"
|
||||
open class Base(`fun`: Int, val `class`: Int)
|
||||
|
||||
class C : Base<caret>
|
||||
@@ -0,0 +1,4 @@
|
||||
// "Add constructor parameters and use them" "true"
|
||||
open class Base(`fun`: Int, val `class`: Int)
|
||||
|
||||
class C(`fun`: Int, `class`: Int) : Base(`fun`, `class`)
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Add constructor parameters and use them" "false"
|
||||
// ACTION: Change to constructor invocation
|
||||
// ERROR: This type has a constructor, and thus must be initialized here
|
||||
open class Base
|
||||
|
||||
class C : Base<caret>
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Add constructor parameters and use them" "true"
|
||||
open class Base private(p1: Int, val p2: Int) {
|
||||
private constructor() : this(0, 1)
|
||||
protected constructor(s: String) : this(s.length(), 1)
|
||||
}
|
||||
|
||||
class C : Base<caret>
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Add constructor parameters and use them" "true"
|
||||
open class Base private(p1: Int, val p2: Int) {
|
||||
private constructor() : this(0, 1)
|
||||
protected constructor(s: String) : this(s.length(), 1)
|
||||
}
|
||||
|
||||
class C(s: String) : Base<caret>(s)
|
||||
Reference in New Issue
Block a user