Do not count receivers in default parameters mask
If we implement default function with default parameters in inline
class, the receivers will be added to parameter list
(see ac7538a269). But since they
are not present in source parameters, we should not count them when we
compute mask for default parameters.
#KT-49977 Fixed
This commit is contained in:
+24
@@ -0,0 +1,24 @@
|
||||
// WITH_STDLIB
|
||||
|
||||
// !JVM_DEFAULT_MODE: all-compatibility
|
||||
// TARGET_BACKEND: JVM
|
||||
// IGNORE_BACKEND: JVM
|
||||
// JVM_TARGET: 1.8
|
||||
|
||||
interface Path {
|
||||
fun dispatch(s: String = "K") = "dispatch$s"
|
||||
fun Int.extension(s: String = "K") = "${this}extension$s"
|
||||
}
|
||||
|
||||
@JvmInline
|
||||
value class RealPath(val x: Int) : Path
|
||||
|
||||
fun box(): String {
|
||||
val rp = RealPath(1)
|
||||
val res = "${rp.dispatch()};${rp.dispatch("KK")};" +
|
||||
with(rp) {
|
||||
"${1.extension()};${2.extension("KK")}"
|
||||
}
|
||||
if (res != "dispatchK;dispatchKK;1extensionK;2extensionKK") return res
|
||||
return "OK"
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
// WITH_STDLIB
|
||||
|
||||
// !JVM_DEFAULT_MODE: all
|
||||
// TARGET_BACKEND: JVM
|
||||
// IGNORE_BACKEND: JVM
|
||||
// JVM_TARGET: 1.8
|
||||
|
||||
interface Path {
|
||||
fun dispatch(s: String = "K") = "dispatch$s"
|
||||
fun Int.extension(s: String = "K") = "${this}extension$s"
|
||||
}
|
||||
|
||||
@JvmInline
|
||||
value class RealPath(val x: Int) : Path
|
||||
|
||||
fun box(): String {
|
||||
val rp = RealPath(1)
|
||||
val res = "${rp.dispatch()};${rp.dispatch("KK")};" +
|
||||
with(rp) {
|
||||
"${1.extension()};${2.extension("KK")}"
|
||||
}
|
||||
if (res != "dispatchK;dispatchKK;1extensionK;2extensionKK") return res
|
||||
return "OK"
|
||||
}
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
// WITH_STDLIB
|
||||
|
||||
// !JVM_DEFAULT_MODE: compatibility
|
||||
// TARGET_BACKEND: JVM
|
||||
// IGNORE_BACKEND: JVM
|
||||
// JVM_TARGET: 1.8
|
||||
|
||||
interface Path {
|
||||
fun dispatch(s: String = "K") = "dispatch$s"
|
||||
fun Int.extension(s: String = "K") = "${this}extension$s"
|
||||
}
|
||||
|
||||
@JvmInline
|
||||
value class RealPath(val x: Int) : Path
|
||||
|
||||
fun box(): String {
|
||||
val rp = RealPath(1)
|
||||
val res = "${rp.dispatch()};${rp.dispatch("KK")};" +
|
||||
with(rp) {
|
||||
"${1.extension()};${2.extension("KK")}"
|
||||
}
|
||||
if (res != "dispatchK;dispatchKK;1extensionK;2extensionKK") return res
|
||||
return "OK"
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
// WITH_STDLIB
|
||||
|
||||
// TARGET_BACKEND: JVM
|
||||
// IGNORE_BACKEND: JVM
|
||||
// JVM_TARGET: 1.8
|
||||
|
||||
interface Path {
|
||||
fun dispatch(s: String = "K") = "dispatch$s"
|
||||
fun Int.extension(s: String = "K") = "${this}extension$s"
|
||||
}
|
||||
|
||||
@JvmInline
|
||||
value class RealPath(val x: Int) : Path
|
||||
|
||||
fun box(): String {
|
||||
val rp = RealPath(1)
|
||||
val res = "${rp.dispatch()};${rp.dispatch("KK")};" +
|
||||
with(rp) {
|
||||
"${1.extension()};${2.extension("KK")}"
|
||||
}
|
||||
if (res != "dispatchK;dispatchKK;1extensionK;2extensionKK") return res
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user