Pull Up: Drop default parameter values in function which becomes overriding. Disable function with default values if target class is the Java one
#KT-9833 Fixed
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
class A {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
class A {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
class <caret>B : A() {
|
||||
// INFO: {"checked": "true", "toAbstract": "true"}
|
||||
fun foo(n: Int = 1) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
B().foo()
|
||||
B().foo(2)
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
class B : A() {
|
||||
// INFO: {"checked": "true", "toAbstract": "true"}
|
||||
fun foo(n: Int = 1) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
B().foo()
|
||||
B().foo(2)
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
open class A {
|
||||
|
||||
}
|
||||
|
||||
class <caret>B : A() {
|
||||
// INFO: {"checked": "true", "toAbstract": "true"}
|
||||
fun foo(n: Int = 1) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
B().foo()
|
||||
B().foo(2)
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
abstract class A {
|
||||
// INFO: {"checked": "true", "toAbstract": "true"}
|
||||
abstract fun foo(n: Int = 1)
|
||||
|
||||
}
|
||||
|
||||
class B : A() {
|
||||
// INFO: {"checked": "true", "toAbstract": "true"}
|
||||
override fun foo(n: Int) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
B().foo()
|
||||
B().foo(2)
|
||||
}
|
||||
Reference in New Issue
Block a user