[K2] Fix stable parameter name metadata.
This commit is contained in:
committed by
Mikhail Glukhikh
parent
3a8f1ca690
commit
3795fc1106
+5
-5
@@ -451,7 +451,7 @@ class FirElementSerializer private constructor(
|
||||
simpleFunction?.isExternal == true,
|
||||
simpleFunction?.isSuspend == true,
|
||||
simpleFunction?.isExpect == true,
|
||||
shouldSetStableParameterNames(simpleFunction),
|
||||
shouldSetStableParameterNames(function),
|
||||
)
|
||||
|
||||
if (flags != builder.flags) {
|
||||
@@ -530,11 +530,11 @@ class FirElementSerializer private constructor(
|
||||
return builder
|
||||
}
|
||||
|
||||
private fun shouldSetStableParameterNames(simpleFunction: FirSimpleFunction?): Boolean {
|
||||
private fun shouldSetStableParameterNames(function: FirFunction?): Boolean {
|
||||
return when {
|
||||
simpleFunction?.hasStableParameterNames == true -> true
|
||||
function?.hasStableParameterNames == true -> true
|
||||
// for backward compatibility with K1, remove this line to fix KT-4758
|
||||
simpleFunction?.origin == FirDeclarationOrigin.Delegated -> true
|
||||
function?.origin == FirDeclarationOrigin.Delegated -> true
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
@@ -601,7 +601,7 @@ class FirElementSerializer private constructor(
|
||||
constructor.nonSourceAnnotations(session).isNotEmpty(),
|
||||
ProtoEnumFlags.visibility(normalizeVisibility(constructor)),
|
||||
!constructor.isPrimary,
|
||||
constructor.hasStableParameterNames,
|
||||
shouldSetStableParameterNames(constructor)
|
||||
)
|
||||
if (flags != builder.flags) {
|
||||
builder.flags = flags
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE K2
|
||||
|
||||
fun test() {
|
||||
val f = {}
|
||||
val g = fun Unit.(s: IntArray?, t: Set<Double>): String { return "" }
|
||||
|
||||
Reference in New Issue
Block a user