FIR2IR: don't generate default parameters for delegated members

#KT-55465 Fixed
This commit is contained in:
Mikhail Glukhikh
2023-02-16 19:43:40 +01:00
committed by Space Team
parent b68a26865a
commit f7036aa79c
7 changed files with 2 additions and 9 deletions
@@ -349,7 +349,7 @@ class Fir2IrDeclarationStorage(
valueParameter, index + contextReceiverParametersCount,
useStubForDefaultValueStub = function !is FirConstructor || containingClass?.name != Name.identifier("Enum"),
typeContext,
skipDefaultParameter = isFakeOverride
skipDefaultParameter = isFakeOverride || origin == IrDeclarationOrigin.DELEGATED_MEMBER
).apply {
this.parent = parent
}
@@ -1,5 +1,3 @@
// KT-55465
// IGNORE_BACKEND_K2: NATIVE
// MODULE: lib
// FILE: A.kt
package lib
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_K2: JS_IR, NATIVE
// FILE: lib.kt
interface ResolutionScope {
fun getContributedDescriptors(s: String = "OK"): String
@@ -1,7 +1,6 @@
// WITH_STDLIB
// IGNORE_LIGHT_ANALYSIS
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND_K2: JS_IR, NATIVE
// LANGUAGE: +InlineClassImplementationByDelegation
interface I {
@@ -1,7 +1,6 @@
// WITH_STDLIB
// IGNORE_LIGHT_ANALYSIS
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND_K2: JS_IR, NATIVE
// LANGUAGE: +InlineClassImplementationByDelegation, +GenericInlineClassParameter
interface I {
@@ -58,8 +58,6 @@ FILE fqName:<root> fileName:/ErrorInDefaultValue.kt
public abstract fun f (x: kotlin.String): kotlin.String declared in <root>.A
$this: VALUE_PARAMETER name:<this> type:<root>.C
VALUE_PARAMETER name:x index:0 type:kotlin.String
EXPRESSION_BODY
ERROR_EXPR 'Stub expression for default value of x' type=kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun f (x: kotlin.String): kotlin.String declared in <root>.C'
CALL 'public abstract fun f (x: kotlin.String): kotlin.String declared in <root>.A' type=kotlin.String origin=null
@@ -23,7 +23,7 @@ class C : A {
}
override fun f(x: String = error("") /* ErrorExpression */): String {
override fun f(x: String): String {
return <this>.#x.f(x = x)
}