FIR2IR: don't generate default parameters for delegated members
#KT-55465 Fixed
This commit is contained in:
committed by
Space Team
parent
b68a26865a
commit
f7036aa79c
+1
-1
@@ -349,7 +349,7 @@ class Fir2IrDeclarationStorage(
|
|||||||
valueParameter, index + contextReceiverParametersCount,
|
valueParameter, index + contextReceiverParametersCount,
|
||||||
useStubForDefaultValueStub = function !is FirConstructor || containingClass?.name != Name.identifier("Enum"),
|
useStubForDefaultValueStub = function !is FirConstructor || containingClass?.name != Name.identifier("Enum"),
|
||||||
typeContext,
|
typeContext,
|
||||||
skipDefaultParameter = isFakeOverride
|
skipDefaultParameter = isFakeOverride || origin == IrDeclarationOrigin.DELEGATED_MEMBER
|
||||||
).apply {
|
).apply {
|
||||||
this.parent = parent
|
this.parent = parent
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
// KT-55465
|
|
||||||
// IGNORE_BACKEND_K2: NATIVE
|
|
||||||
// MODULE: lib
|
// MODULE: lib
|
||||||
// FILE: A.kt
|
// FILE: A.kt
|
||||||
package lib
|
package lib
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_K2: JS_IR, NATIVE
|
|
||||||
// FILE: lib.kt
|
// FILE: lib.kt
|
||||||
interface ResolutionScope {
|
interface ResolutionScope {
|
||||||
fun getContributedDescriptors(s: String = "OK"): String
|
fun getContributedDescriptors(s: String = "OK"): String
|
||||||
|
|||||||
-1
@@ -1,7 +1,6 @@
|
|||||||
// WITH_STDLIB
|
// WITH_STDLIB
|
||||||
// IGNORE_LIGHT_ANALYSIS
|
// IGNORE_LIGHT_ANALYSIS
|
||||||
// IGNORE_BACKEND: JVM
|
// IGNORE_BACKEND: JVM
|
||||||
// IGNORE_BACKEND_K2: JS_IR, NATIVE
|
|
||||||
// LANGUAGE: +InlineClassImplementationByDelegation
|
// LANGUAGE: +InlineClassImplementationByDelegation
|
||||||
|
|
||||||
interface I {
|
interface I {
|
||||||
|
|||||||
Vendored
-1
@@ -1,7 +1,6 @@
|
|||||||
// WITH_STDLIB
|
// WITH_STDLIB
|
||||||
// IGNORE_LIGHT_ANALYSIS
|
// IGNORE_LIGHT_ANALYSIS
|
||||||
// IGNORE_BACKEND: JVM
|
// IGNORE_BACKEND: JVM
|
||||||
// IGNORE_BACKEND_K2: JS_IR, NATIVE
|
|
||||||
// LANGUAGE: +InlineClassImplementationByDelegation, +GenericInlineClassParameter
|
// LANGUAGE: +InlineClassImplementationByDelegation, +GenericInlineClassParameter
|
||||||
|
|
||||||
interface I {
|
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
|
public abstract fun f (x: kotlin.String): kotlin.String declared in <root>.A
|
||||||
$this: VALUE_PARAMETER name:<this> type:<root>.C
|
$this: VALUE_PARAMETER name:<this> type:<root>.C
|
||||||
VALUE_PARAMETER name:x index:0 type:kotlin.String
|
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
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='public open fun f (x: kotlin.String): kotlin.String declared in <root>.C'
|
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
|
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)
|
return <this>.#x.f(x = x)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user