K2: fix NSME on toChar for subclasses of Number

Code in `ReplaceNumberToCharCallSitesLowering` relies on `Number.toChar`
being declared in IR as non-abstract. Otherwise the
`resolveFakeOverride` call there doesn't work, and the lowering can't
rewrite the call to `toInt().toChar()`, and we end up with a call to the
missing method `Number.toChar` in the bytecode.

 #KT-57217 Fixed
This commit is contained in:
Alexander Udalov
2023-06-20 00:10:19 +02:00
committed by Space Team
parent 175cf5e833
commit 13baf43ae3
3 changed files with 3 additions and 5 deletions
@@ -22,7 +22,7 @@ CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Int modality:FINAL visibility:publ
annotations:
IntrinsicConstEvaluation
overridden:
public abstract fun toChar (): kotlin.Char declared in kotlin.Number
public open fun toChar (): kotlin.Char declared in kotlin.Number
$this: VALUE_PARAMETER name:$this type:kotlin.Int
FUN BUILTIN_CLASS_METHOD name:toByte visibility:public modality:OPEN <> ($this:kotlin.Int) returnType:kotlin.Byte
annotations: