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