K2: Refine how JDK members are mapped to built-in classes

Previously, the semantic was more-or-less correct for most of the cases
but some corner one, like `sort` in MutableList didn't work properly.

Namely, `sort` should be marked there in a way to forbid to call it
everywhere beside super-calls.
Also, overriding it should be allowed.

Mostly, the logic was re-written to K2 model from K1-related
JvmBuiltInsCustomizer.

^KT-57694 In progress
^KT-57269 Fixed
This commit is contained in:
Denis.Zharkov
2023-04-13 11:50:54 +02:00
committed by Space Team
parent 161fe1d2ca
commit 2e5b783cc6
59 changed files with 1225 additions and 595 deletions
@@ -51,3 +51,11 @@ CLASS IR_EXTERNAL_JAVA_DECLARATION_STUB ENUM_CLASS name:JEnum modality:FINAL vis
overridden:
public final fun <get-ordinal> (): kotlin.Int declared in kotlin.Enum
$this: VALUE_PARAMETER FAKE_OVERRIDE name:<this> type:<root>.JEnum
FUN FAKE_OVERRIDE name:getDeclaringClass visibility:public modality:FINAL <> ($this:<root>.JEnum) returnType:@[FlexibleNullability] java.lang.Class<@[FlexibleNullability] <root>.JEnum?>? [fake_override]
overridden:
public final fun getDeclaringClass (): @[FlexibleNullability] java.lang.Class<@[FlexibleNullability] E of kotlin.Enum?>? declared in kotlin.Enum
$this: VALUE_PARAMETER FAKE_OVERRIDE name:<this> type:<root>.JEnum
FUN FAKE_OVERRIDE name:finalize visibility:protected/*protected and package*/ modality:FINAL <> ($this:<root>.JEnum) returnType:kotlin.Unit [fake_override]
overridden:
protected/*protected and package*/ final fun finalize (): kotlin.Unit declared in kotlin.Enum
$this: VALUE_PARAMETER FAKE_OVERRIDE name:<this> type:<root>.JEnum