Create from Usage: Generate secondary constructors by delegation calls
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
// "Create secondary constructor" "true"
|
||||
|
||||
open class A {
|
||||
constructor(i: Int) {
|
||||
//To change body of created constructors use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class B: A {
|
||||
constructor(): super(1) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Create secondary constructor" "true"
|
||||
|
||||
class A {
|
||||
constructor(): this(1) {
|
||||
|
||||
}
|
||||
|
||||
constructor(i: Int) {
|
||||
//To change body of created constructors use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Create secondary constructor" "true"
|
||||
|
||||
open class A {
|
||||
|
||||
}
|
||||
|
||||
class B: A {
|
||||
constructor(): super(<caret>1) {
|
||||
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Create secondary constructor" "false"
|
||||
// ERROR: Too many arguments for public constructor Any() defined in kotlin.Any
|
||||
|
||||
trait T {
|
||||
|
||||
}
|
||||
|
||||
class A: T {
|
||||
constructor(): super(<caret>1) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Create secondary constructor" "true"
|
||||
|
||||
class A {
|
||||
constructor(): this(<caret>1) {
|
||||
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
class J {
|
||||
|
||||
public J(int i) {
|
||||
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Create secondary constructor" "true"
|
||||
// ERROR: Too many arguments for public/*package*/ constructor J() defined in J
|
||||
|
||||
class B: J {
|
||||
constructor(): super(1) {
|
||||
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Create secondary constructor" "true"
|
||||
// ERROR: Too many arguments for public/*package*/ constructor J() defined in J
|
||||
|
||||
class B: J {
|
||||
constructor(): super(<caret>1) {
|
||||
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class J {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user