Change Signature: Do not add default values to parameters of overriding functions
#KT-6160 Fixed
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
trait T {
|
||||
fun foo(a: Int = 1,
|
||||
b: String = "2")
|
||||
}
|
||||
|
||||
open class A: T {
|
||||
override fun foo(a: Int,
|
||||
b: String) {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
}
|
||||
|
||||
class B: A() {
|
||||
override fun foo(a: Int,
|
||||
b: String) {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
trait T {
|
||||
fun <caret>foo(b: String = "2",
|
||||
a: Int = 1)
|
||||
}
|
||||
|
||||
open class A: T {
|
||||
override fun foo(b: String,
|
||||
a: Int) {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
}
|
||||
|
||||
class B: A() {
|
||||
override fun foo(b: String,
|
||||
a: Int) {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user