Generate Secondary Constructor: Forbid inside of class with explicit primary constructor

This commit is contained in:
Alexey Sedunov
2015-10-23 14:28:16 +03:00
parent 22393d4cd2
commit 89132b3f66
4 changed files with 14 additions and 31 deletions
@@ -1,10 +1,7 @@
// ACTION_CLASS: org.jetbrains.kotlin.idea.actions.generate.KotlinGenerateSecondaryConstructorAction
open class Base(n: Int) {
constructor(a: Int, b: Int): this(a + b)
}
class Foo(x: Int) : Base(x) {<caret>
val x = 1
// NOT_APPLICABLE
class Foo(x: Int) {<caret>
val x: Int
fun foo() {
@@ -1,18 +0,0 @@
// ACTION_CLASS: org.jetbrains.kotlin.idea.actions.generate.KotlinGenerateSecondaryConstructorAction
open class Base(n: Int) {
constructor(a: Int, b: Int): this(a + b)
}
class Foo(x: Int) : Base(x) {
val x = 1
<caret>constructor(a: Int, b: Int) : super(a, b)
fun foo() {
}
fun bar() {
}
}