K2/Java: implement platform-dependent function filtering in JvmMappedScope

We drop Kotlin function 'remove' or 'getOrDefault' from JvmMappedScope,
if it has platform-dependent annotation, and the bound Java class scope
does not contain a function with the same signature.

#KT-57268 Fixed
This commit is contained in:
Mikhail Glukhikh
2024-01-24 16:50:47 +01:00
committed by Space Team
parent 7d584e0eb4
commit 672b5ba0d7
87 changed files with 352 additions and 373 deletions
@@ -113,15 +113,6 @@ FILE fqName:<root> fileName:/kt43342.kt
CALL 'public abstract fun <get-values> (): kotlin.collections.Collection<V of kotlin.collections.Map> declared in kotlin.collections.Map' type=kotlin.collections.Collection<V of <root>.ControlFlowInfo> origin=null
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> origin=null
receiver: GET_VAR '<this>: <root>.ControlFlowInfo<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> declared in <root>.ControlFlowInfo.<get-values>' type=<root>.ControlFlowInfo<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> origin=null
FUN FAKE_OVERRIDE name:getOrDefault visibility:public modality:OPEN <> ($this:kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo>, key:K of <root>.ControlFlowInfo, defaultValue:V of <root>.ControlFlowInfo) returnType:V of <root>.ControlFlowInfo [fake_override]
annotations:
SinceKotlin(version = "1.1")
PlatformDependent
overridden:
public open fun getOrDefault (key: K of kotlin.collections.Map, defaultValue: V of kotlin.collections.Map): V of kotlin.collections.Map declared in kotlin.collections.Map
$this: VALUE_PARAMETER name:<this> type:kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo>
VALUE_PARAMETER name:key index:0 type:K of <root>.ControlFlowInfo
VALUE_PARAMETER name:defaultValue index:1 type:V of <root>.ControlFlowInfo
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.collections.Map
@@ -178,15 +169,6 @@ FILE fqName:<root> fileName:/kt43342.kt
public open fun get (key: K of <root>.ControlFlowInfo): V of <root>.ControlFlowInfo? declared in <root>.ControlFlowInfo
$this: VALUE_PARAMETER name:<this> type:<root>.ControlFlowInfo<kotlin.String, kotlin.String>
VALUE_PARAMETER name:key index:0 type:kotlin.String
FUN FAKE_OVERRIDE name:getOrDefault visibility:public modality:OPEN <> ($this:kotlin.collections.Map<kotlin.String, kotlin.String>, key:kotlin.String, defaultValue:kotlin.String) returnType:kotlin.String [fake_override]
annotations:
SinceKotlin(version = "1.1")
PlatformDependent
overridden:
public open fun getOrDefault (key: K of <root>.ControlFlowInfo, defaultValue: V of <root>.ControlFlowInfo): V of <root>.ControlFlowInfo declared in <root>.ControlFlowInfo
$this: VALUE_PARAMETER name:<this> type:kotlin.collections.Map<kotlin.String, kotlin.String>
VALUE_PARAMETER name:key index:0 type:kotlin.String
VALUE_PARAMETER name:defaultValue index:1 type:kotlin.String
FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:OPEN <> ($this:<root>.ControlFlowInfo<kotlin.String, kotlin.String>) returnType:kotlin.Boolean [fake_override]
overridden:
public open fun isEmpty (): kotlin.Boolean declared in <root>.ControlFlowInfo
-1
View File
@@ -2,7 +2,6 @@
// IGNORE_BACKEND_K1: JS_IR, JS_IR_ES6
// ^ Map has js specific methods
// IGNORE_BACKEND_K2: JS_IR
// IGNORE_BACKEND_K2: NATIVE
open class ControlFlowInfo<K, V>(val map: Map<K, V>): Map<K, V> by map