[IR] Don't print multifile/synthetic facade class names in irText tests

This only applies to JVM and fq-names in declaration references
in IR dumps.

This enables us to run more irText tests on platforms other than JVM
(see KT-58605).
This commit is contained in:
Sergej Jaskiewicz
2023-06-01 16:43:17 +02:00
committed by Space Team
parent cc76bbd09d
commit f2031ae642
191 changed files with 744 additions and 440 deletions
@@ -105,7 +105,7 @@ FILE fqName:<root> fileName:/canvas.kt
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with declared in kotlin.StandardKt' type=kotlin.String origin=null
CALL 'public final fun with <T, R> (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.with, R of kotlin.with>): R of kotlin.with declared in kotlin' type=kotlin.String origin=null
<T>: <root>.MyCanvas
<R>: kotlin.String
receiver: GET_OBJECT 'CLASS OBJECT name:MyCanvas modality:FINAL visibility:public superTypes:[<root>.Canvas]' type=<root>.MyCanvas
@@ -1,6 +1,5 @@
// FIR_IDENTICAL
// !LANGUAGE: +ContextReceivers
// IGNORE_BACKEND: JS_IR
interface Canvas {
val suffix: String
@@ -10,6 +10,9 @@ class Circle : Shape {
// CHECK JVM_IR:
// Mangled name: Circle#draw!Canvas(){}kotlin.String
// Public signature: /Circle.draw|-6733499063990640842[0]
// CHECK JS_IR NATIVE:
// Mangled name: Circle#draw!Canvas(){}
// Public signature: /Circle.draw|4876755509620013985[0]
override fun draw($context_receiver_0: Canvas): String
}
@@ -26,6 +29,9 @@ interface Canvas {
// CHECK JVM_IR:
// Mangled name: Canvas#<get-suffix>(){}kotlin.String
// Public signature: /Canvas.suffix.<get-suffix>|8958072538558116778[0]
// CHECK JS_IR NATIVE:
// Mangled name: Canvas#<get-suffix>(){}
// Public signature: /Canvas.suffix.<get-suffix>|-7634976832113083262[0]
abstract get
}
@@ -38,6 +44,9 @@ interface Shape {
// CHECK JVM_IR:
// Mangled name: Shape#draw!Canvas(){}kotlin.String
// Public signature: /Shape.draw|-6733499063990640842[0]
// CHECK JS_IR NATIVE:
// Mangled name: Shape#draw!Canvas(){}
// Public signature: /Shape.draw|4876755509620013985[0]
abstract fun draw($context_receiver_0: Canvas): String
}
@@ -53,6 +62,9 @@ object MyCanvas : Canvas {
// CHECK JVM_IR:
// Mangled name: MyCanvas#<get-suffix>(){}kotlin.String
// Public signature: /MyCanvas.suffix.<get-suffix>|8958072538558116778[0]
// CHECK JS_IR NATIVE:
// Mangled name: MyCanvas#<get-suffix>(){}
// Public signature: /MyCanvas.suffix.<get-suffix>|-7634976832113083262[0]
override get
// CHECK:
@@ -65,5 +77,8 @@ object MyCanvas : Canvas {
// CHECK JVM_IR:
// Mangled name: #box(){}kotlin.String
// Public signature: /box|-9347091776561469[0]
// CHECK JS_IR NATIVE:
// Mangled name: #box(){}
// Public signature: /box|2173511048851971368[0]
fun box(): String
@@ -225,7 +225,7 @@ FILE fqName:<root> fileName:/compareTo.kt
other: CALL 'public open fun <get-length> (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR 'b: @[FlexibleNullability] kotlin.String? declared in <root>.box.<anonymous>' type=@[FlexibleNullability] kotlin.String? origin=null
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with declared in kotlin.StandardKt' type=kotlin.String origin=null
CALL 'public final fun with <T, R> (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.with, R of kotlin.with>): R of kotlin.with declared in kotlin' type=kotlin.String origin=null
<T>: java.util.Comparator<kotlin.String>
<R>: kotlin.String
receiver: GET_VAR 'val comparator: java.util.Comparator<kotlin.String> declared in <root>.box' type=java.util.Comparator<kotlin.String> origin=null
@@ -229,7 +229,7 @@ FILE fqName:<root> fileName:/compareTo.kt
$this: TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String
GET_VAR 'b: @[FlexibleNullability] kotlin.String? declared in <root>.box.<anonymous>' type=@[FlexibleNullability] kotlin.String? origin=null
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with declared in kotlin.StandardKt' type=kotlin.String origin=null
CALL 'public final fun with <T, R> (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.with, R of kotlin.with>): R of kotlin.with declared in kotlin' type=kotlin.String origin=null
<T>: java.util.Comparator<kotlin.String>
<R>: kotlin.String
receiver: GET_VAR 'val comparator: java.util.Comparator<kotlin.String> declared in <root>.box' type=java.util.Comparator<kotlin.String> origin=null
@@ -43,7 +43,7 @@ FILE fqName:<root> fileName:/dp.kt
other: GET_VAR '<this>: kotlin.Int declared in <root>.<get-dp>' type=kotlin.Int origin=null
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
BLOCK_BODY
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with declared in kotlin.StandardKt' type=kotlin.Nothing origin=null
CALL 'public final fun with <T, R> (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.with, R of kotlin.with>): R of kotlin.with declared in kotlin' type=kotlin.Nothing origin=null
<T>: <root>.View
<R>: kotlin.Nothing
receiver: CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.View' type=<root>.View origin=null
@@ -54,10 +54,10 @@ FILE fqName:<root> fileName:/dp.kt
WHEN type=kotlin.Unit origin=IF
BRANCH
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
arg0: CALL 'public final fun map <T, R> (transform: kotlin.Function1<T of kotlin.collections.CollectionsKt.map, R of kotlin.collections.CollectionsKt.map>): kotlin.collections.List<R of kotlin.collections.CollectionsKt.map> declared in kotlin.collections.CollectionsKt' type=kotlin.collections.List<kotlin.Int> origin=null
arg0: CALL 'public final fun map <T, R> (transform: kotlin.Function1<T of kotlin.collections.map, R of kotlin.collections.map>): kotlin.collections.List<R of kotlin.collections.map> declared in kotlin.collections' type=kotlin.collections.List<kotlin.Int> origin=null
<T>: kotlin.Int
<R>: kotlin.Int
$receiver: CALL 'public final fun listOf <T> (vararg elements: T of kotlin.collections.CollectionsKt.listOf): kotlin.collections.List<T of kotlin.collections.CollectionsKt.listOf> declared in kotlin.collections.CollectionsKt' type=kotlin.collections.List<kotlin.Int> origin=null
$receiver: CALL 'public final fun listOf <T> (vararg elements: T of kotlin.collections.listOf): kotlin.collections.List<T of kotlin.collections.listOf> declared in kotlin.collections' type=kotlin.collections.List<kotlin.Int> origin=null
<T>: kotlin.Int
elements: VARARG type=kotlin.Array<out kotlin.Int> varargElementType=kotlin.Int
CONST Int type=kotlin.Int value=1
@@ -71,7 +71,7 @@ FILE fqName:<root> fileName:/dp.kt
CALL 'public final fun <get-dp> ($context_receiver_0: <root>.View): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
$receiver: GET_VAR 'it: kotlin.Int declared in <root>.box.<anonymous>.<anonymous>' type=kotlin.Int origin=null
$context_receiver_0: GET_VAR '$this$with: <root>.View declared in <root>.box.<anonymous>' type=<root>.View origin=null
arg1: CALL 'public final fun listOf <T> (vararg elements: T of kotlin.collections.CollectionsKt.listOf): kotlin.collections.List<T of kotlin.collections.CollectionsKt.listOf> declared in kotlin.collections.CollectionsKt' type=kotlin.collections.List<kotlin.Int> origin=null
arg1: CALL 'public final fun listOf <T> (vararg elements: T of kotlin.collections.listOf): kotlin.collections.List<T of kotlin.collections.listOf> declared in kotlin.collections' type=kotlin.collections.List<kotlin.Int> origin=null
<T>: kotlin.Int
elements: VARARG type=kotlin.Array<out kotlin.Int> varargElementType=kotlin.Int
CONST Int type=kotlin.Int value=42
@@ -43,7 +43,7 @@ FILE fqName:<root> fileName:/dp.kt
other: GET_VAR '<this>: kotlin.Int declared in <root>.<get-dp>' type=kotlin.Int origin=null
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
BLOCK_BODY
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with declared in kotlin.StandardKt' type=kotlin.Nothing origin=null
CALL 'public final fun with <T, R> (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.with, R of kotlin.with>): R of kotlin.with declared in kotlin' type=kotlin.Nothing origin=null
<T>: <root>.View
<R>: kotlin.Nothing
receiver: CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.View' type=<root>.View origin=null
@@ -54,10 +54,10 @@ FILE fqName:<root> fileName:/dp.kt
WHEN type=kotlin.Unit origin=IF
BRANCH
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
arg0: CALL 'public final fun map <T, R> (transform: kotlin.Function1<T of kotlin.collections.CollectionsKt.map, R of kotlin.collections.CollectionsKt.map>): kotlin.collections.List<R of kotlin.collections.CollectionsKt.map> declared in kotlin.collections.CollectionsKt' type=kotlin.collections.List<kotlin.Int> origin=null
arg0: CALL 'public final fun map <T, R> (transform: kotlin.Function1<T of kotlin.collections.map, R of kotlin.collections.map>): kotlin.collections.List<R of kotlin.collections.map> declared in kotlin.collections' type=kotlin.collections.List<kotlin.Int> origin=null
<T>: kotlin.Int
<R>: kotlin.Int
$receiver: CALL 'public final fun listOf <T> (vararg elements: T of kotlin.collections.CollectionsKt.listOf): kotlin.collections.List<T of kotlin.collections.CollectionsKt.listOf> declared in kotlin.collections.CollectionsKt' type=kotlin.collections.List<kotlin.Int> origin=null
$receiver: CALL 'public final fun listOf <T> (vararg elements: T of kotlin.collections.listOf): kotlin.collections.List<T of kotlin.collections.listOf> declared in kotlin.collections' type=kotlin.collections.List<kotlin.Int> origin=null
<T>: kotlin.Int
elements: VARARG type=kotlin.Array<out kotlin.Int> varargElementType=kotlin.Int
CONST Int type=kotlin.Int value=1
@@ -71,7 +71,7 @@ FILE fqName:<root> fileName:/dp.kt
CALL 'public final fun <get-dp> ($context_receiver_0: <root>.View): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
$receiver: GET_VAR 'it: kotlin.Int declared in <root>.box.<anonymous>.<anonymous>' type=kotlin.Int origin=null
$context_receiver_0: GET_VAR '$this$with: <root>.View declared in <root>.box.<anonymous>' type=<root>.View origin=null
arg1: CALL 'public final fun listOf <T> (vararg elements: T of kotlin.collections.CollectionsKt.listOf): kotlin.collections.List<T of kotlin.collections.CollectionsKt.listOf> declared in kotlin.collections.CollectionsKt' type=kotlin.collections.List<kotlin.Int> origin=null
arg1: CALL 'public final fun listOf <T> (vararg elements: T of kotlin.collections.listOf): kotlin.collections.List<T of kotlin.collections.listOf> declared in kotlin.collections' type=kotlin.collections.List<kotlin.Int> origin=null
<T>: kotlin.Int
elements: VARARG type=kotlin.Array<out kotlin.Int> varargElementType=kotlin.Int
CONST Int type=kotlin.Int value=42
@@ -1,5 +1,4 @@
// !LANGUAGE: +ContextReceivers
// IGNORE_BACKEND: JS_IR
// WITH_STDLIB
class View {
val coefficient = 42
@@ -9,6 +9,9 @@ class View {
// CHECK JVM_IR:
// Mangled name: View#<get-coefficient>(){}kotlin.Int
// Public signature: /View.coefficient.<get-coefficient>|2286291581442465794[0]
// CHECK JS_IR NATIVE:
// Mangled name: View#<get-coefficient>(){}
// Public signature: /View.coefficient.<get-coefficient>|5285326162631504309[0]
get
// CHECK:
@@ -21,6 +24,9 @@ class View {
// CHECK JVM_IR:
// Mangled name: #box(){}kotlin.String
// Public signature: /box|-9347091776561469[0]
// CHECK JS_IR NATIVE:
// Mangled name: #box(){}
// Public signature: /box|2173511048851971368[0]
fun box(): String
// CHECK:
@@ -30,5 +36,8 @@ val Int.dp: Int
// CHECK JVM_IR:
// Mangled name: #<get-dp>!View@kotlin.Int(){}kotlin.Int
// Public signature: /dp.<get-dp>|933397372434095199[0]
// CHECK JS_IR NATIVE:
// Mangled name: #<get-dp>!View@kotlin.Int(){}
// Public signature: /dp.<get-dp>|-92585254995500394[0]
get($context_receiver_0: View): Int
@@ -94,7 +94,7 @@ FILE fqName:<root> fileName:/functionalType.kt
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with declared in kotlin.StandardKt' type=kotlin.String origin=null
CALL 'public final fun with <T, R> (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.with, R of kotlin.with>): R of kotlin.with declared in kotlin' type=kotlin.String origin=null
<T>: <root>.O
<R>: kotlin.String
receiver: CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.O' type=<root>.O origin=null
@@ -94,7 +94,7 @@ FILE fqName:<root> fileName:/functionalType.kt
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with declared in kotlin.StandardKt' type=kotlin.String origin=null
CALL 'public final fun with <T, R> (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.with, R of kotlin.with>): R of kotlin.with declared in kotlin' type=kotlin.String origin=null
<T>: <root>.O
<R>: kotlin.String
receiver: CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.O' type=<root>.O origin=null
@@ -1,5 +1,4 @@
// !LANGUAGE: +ContextReceivers
// IGNORE_BACKEND: JS_IR
class Param
class O {
@@ -9,6 +9,9 @@ class K {
// CHECK JVM_IR:
// Mangled name: K#<get-k>(){}kotlin.String
// Public signature: /K.k.<get-k>|-8248201737917988340[0]
// CHECK JS_IR NATIVE:
// Mangled name: K#<get-k>(){}
// Public signature: /K.k.<get-k>|2619553883593572199[0]
get
// CHECK:
@@ -29,6 +32,9 @@ class O {
// CHECK JVM_IR:
// Mangled name: O#<get-o>(){}kotlin.String
// Public signature: /O.o.<get-o>|2606027183154875572[0]
// CHECK JS_IR NATIVE:
// Mangled name: O#<get-o>(){}
// Public signature: /O.o.<get-o>|-5005637647237604760[0]
get
// CHECK:
@@ -52,10 +58,16 @@ class Param {
// CHECK JVM_IR:
// Mangled name: #box(){}kotlin.String
// Public signature: /box|-9347091776561469[0]
// CHECK JS_IR NATIVE:
// Mangled name: #box(){}
// Public signature: /box|2173511048851971368[0]
fun box(): String
// CHECK JVM_IR:
// Mangled name: #f!O@K(kotlin.Function3<O,K,Param,0:0>){0§<kotlin.Any?>}0:0
// Public signature: /f|-7653040485655702379[0]
// CHECK JS_IR NATIVE:
// Mangled name: #f!O@K(kotlin.Function3<O,K,Param,0:0>){0§<kotlin.Any?>}
// Public signature: /f|6244942347355309773[0]
fun <T : Any?> K.f($context_receiver_0: O, g: @ExtensionFunctionType Function3<O, K, Param, T>): T
@@ -142,7 +142,7 @@ FILE fqName:<root> fileName:/monoidSum.kt
VALUE_PARAMETER name:$context_receiver_0 index:0 type:<root>.Monoid<T of <root>.sum>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun sum <T> ($context_receiver_0: <root>.Monoid<T of <root>.sum>): T of <root>.sum declared in <root>'
CALL 'public final fun fold <T, R> (initial: R of kotlin.collections.CollectionsKt.fold, operation: kotlin.Function2<R of kotlin.collections.CollectionsKt.fold, T of kotlin.collections.CollectionsKt.fold, R of kotlin.collections.CollectionsKt.fold>): R of kotlin.collections.CollectionsKt.fold declared in kotlin.collections.CollectionsKt' type=T of <root>.sum origin=null
CALL 'public final fun fold <T, R> (initial: R of kotlin.collections.fold, operation: kotlin.Function2<R of kotlin.collections.fold, T of kotlin.collections.fold, R of kotlin.collections.fold>): R of kotlin.collections.fold declared in kotlin.collections' type=T of <root>.sum origin=null
<T>: T of <root>.sum
<R>: T of <root>.sum
$receiver: GET_VAR '<this>: kotlin.collections.List<T of <root>.sum> declared in <root>.sum' type=kotlin.collections.List<T of <root>.sum> origin=null
@@ -161,7 +161,7 @@ FILE fqName:<root> fileName:/monoidSum.kt
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
BLOCK_BODY
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with declared in kotlin.StandardKt' type=kotlin.Int origin=null
CALL 'public final fun with <T, R> (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.with, R of kotlin.with>): R of kotlin.with declared in kotlin' type=kotlin.Int origin=null
<T>: <root>.IntMonoid
<R>: kotlin.Int
receiver: GET_OBJECT 'CLASS OBJECT name:IntMonoid modality:FINAL visibility:public superTypes:[<root>.Monoid<kotlin.Int>]' type=<root>.IntMonoid
@@ -172,7 +172,7 @@ FILE fqName:<root> fileName:/monoidSum.kt
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.Int declared in <root>.box'
CALL 'public final fun sum <T> ($context_receiver_0: <root>.Monoid<T of <root>.sum>): T of <root>.sum declared in <root>' type=kotlin.Int origin=null
<T>: kotlin.Int
$receiver: CALL 'public final fun listOf <T> (vararg elements: T of kotlin.collections.CollectionsKt.listOf): kotlin.collections.List<T of kotlin.collections.CollectionsKt.listOf> declared in kotlin.collections.CollectionsKt' type=kotlin.collections.List<kotlin.Int> origin=null
$receiver: CALL 'public final fun listOf <T> (vararg elements: T of kotlin.collections.listOf): kotlin.collections.List<T of kotlin.collections.listOf> declared in kotlin.collections' type=kotlin.collections.List<kotlin.Int> origin=null
<T>: kotlin.Int
elements: VARARG type=kotlin.Array<out kotlin.Int> varargElementType=kotlin.Int
CONST Int type=kotlin.Int value=1
@@ -180,7 +180,7 @@ FILE fqName:<root> fileName:/monoidSum.kt
CONST Int type=kotlin.Int value=3
$context_receiver_0: GET_VAR '$this$with: <root>.IntMonoid declared in <root>.box.<anonymous>' type=<root>.IntMonoid origin=null
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with declared in kotlin.StandardKt' type=kotlin.String origin=null
CALL 'public final fun with <T, R> (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.with, R of kotlin.with>): R of kotlin.with declared in kotlin' type=kotlin.String origin=null
<T>: <root>.StringMonoid
<R>: kotlin.String
receiver: GET_OBJECT 'CLASS OBJECT name:StringMonoid modality:FINAL visibility:public superTypes:[<root>.Monoid<kotlin.String>]' type=<root>.StringMonoid
@@ -191,7 +191,7 @@ FILE fqName:<root> fileName:/monoidSum.kt
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.String declared in <root>.box'
CALL 'public final fun sum <T> ($context_receiver_0: <root>.Monoid<T of <root>.sum>): T of <root>.sum declared in <root>' type=kotlin.String origin=null
<T>: kotlin.String
$receiver: CALL 'public final fun listOf <T> (vararg elements: T of kotlin.collections.CollectionsKt.listOf): kotlin.collections.List<T of kotlin.collections.CollectionsKt.listOf> declared in kotlin.collections.CollectionsKt' type=kotlin.collections.List<kotlin.String> origin=null
$receiver: CALL 'public final fun listOf <T> (vararg elements: T of kotlin.collections.listOf): kotlin.collections.List<T of kotlin.collections.listOf> declared in kotlin.collections' type=kotlin.collections.List<kotlin.String> origin=null
<T>: kotlin.String
elements: VARARG type=kotlin.Array<out kotlin.String> varargElementType=kotlin.String
CONST String type=kotlin.String value="O"
@@ -142,7 +142,7 @@ FILE fqName:<root> fileName:/monoidSum.kt
VALUE_PARAMETER name:$context_receiver_0 index:0 type:<root>.Monoid<T of <root>.sum>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun sum <T> ($context_receiver_0: <root>.Monoid<T of <root>.sum>): T of <root>.sum declared in <root>'
CALL 'public final fun fold <T, R> (initial: R of kotlin.collections.CollectionsKt.fold, operation: kotlin.Function2<@[ParameterName(name = 'acc')] R of kotlin.collections.CollectionsKt.fold, T of kotlin.collections.CollectionsKt.fold, R of kotlin.collections.CollectionsKt.fold>): R of kotlin.collections.CollectionsKt.fold declared in kotlin.collections.CollectionsKt' type=T of <root>.sum origin=null
CALL 'public final fun fold <T, R> (initial: R of kotlin.collections.fold, operation: kotlin.Function2<@[ParameterName(name = 'acc')] R of kotlin.collections.fold, T of kotlin.collections.fold, R of kotlin.collections.fold>): R of kotlin.collections.fold declared in kotlin.collections' type=T of <root>.sum origin=null
<T>: T of <root>.sum
<R>: T of <root>.sum
$receiver: GET_VAR '<this>: kotlin.collections.List<T of <root>.sum> declared in <root>.sum' type=kotlin.collections.List<T of <root>.sum> origin=null
@@ -161,7 +161,7 @@ FILE fqName:<root> fileName:/monoidSum.kt
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
BLOCK_BODY
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with declared in kotlin.StandardKt' type=kotlin.Int origin=null
CALL 'public final fun with <T, R> (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.with, R of kotlin.with>): R of kotlin.with declared in kotlin' type=kotlin.Int origin=null
<T>: <root>.IntMonoid
<R>: kotlin.Int
receiver: GET_OBJECT 'CLASS OBJECT name:IntMonoid modality:FINAL visibility:public superTypes:[<root>.Monoid<kotlin.Int>]' type=<root>.IntMonoid
@@ -172,7 +172,7 @@ FILE fqName:<root> fileName:/monoidSum.kt
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.Int declared in <root>.box'
CALL 'public final fun sum <T> ($context_receiver_0: <root>.Monoid<T of <root>.sum>): T of <root>.sum declared in <root>' type=kotlin.Int origin=null
<T>: kotlin.Int
$receiver: CALL 'public final fun listOf <T> (vararg elements: T of kotlin.collections.CollectionsKt.listOf): kotlin.collections.List<T of kotlin.collections.CollectionsKt.listOf> declared in kotlin.collections.CollectionsKt' type=kotlin.collections.List<kotlin.Int> origin=null
$receiver: CALL 'public final fun listOf <T> (vararg elements: T of kotlin.collections.listOf): kotlin.collections.List<T of kotlin.collections.listOf> declared in kotlin.collections' type=kotlin.collections.List<kotlin.Int> origin=null
<T>: kotlin.Int
elements: VARARG type=kotlin.Array<out kotlin.Int> varargElementType=kotlin.Int
CONST Int type=kotlin.Int value=1
@@ -180,7 +180,7 @@ FILE fqName:<root> fileName:/monoidSum.kt
CONST Int type=kotlin.Int value=3
$context_receiver_0: GET_VAR '$this$with: <root>.IntMonoid declared in <root>.box.<anonymous>' type=<root>.IntMonoid origin=null
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with declared in kotlin.StandardKt' type=kotlin.String origin=null
CALL 'public final fun with <T, R> (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.with, R of kotlin.with>): R of kotlin.with declared in kotlin' type=kotlin.String origin=null
<T>: <root>.StringMonoid
<R>: kotlin.String
receiver: GET_OBJECT 'CLASS OBJECT name:StringMonoid modality:FINAL visibility:public superTypes:[<root>.Monoid<kotlin.String>]' type=<root>.StringMonoid
@@ -191,7 +191,7 @@ FILE fqName:<root> fileName:/monoidSum.kt
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.String declared in <root>.box'
CALL 'public final fun sum <T> ($context_receiver_0: <root>.Monoid<T of <root>.sum>): T of <root>.sum declared in <root>' type=kotlin.String origin=null
<T>: kotlin.String
$receiver: CALL 'public final fun listOf <T> (vararg elements: T of kotlin.collections.CollectionsKt.listOf): kotlin.collections.List<T of kotlin.collections.CollectionsKt.listOf> declared in kotlin.collections.CollectionsKt' type=kotlin.collections.List<kotlin.String> origin=null
$receiver: CALL 'public final fun listOf <T> (vararg elements: T of kotlin.collections.listOf): kotlin.collections.List<T of kotlin.collections.listOf> declared in kotlin.collections' type=kotlin.collections.List<kotlin.String> origin=null
<T>: kotlin.String
elements: VARARG type=kotlin.Array<out kotlin.String> varargElementType=kotlin.String
CONST String type=kotlin.String value="O"
@@ -1,5 +1,4 @@
// !LANGUAGE: +ContextReceivers
// IGNORE_BACKEND: JS_IR
// WITH_STDLIB
interface Semigroup<T> {
infix fun T.combine(other: T): T
@@ -5,6 +5,9 @@ interface Monoid<T : Any?> : Semigroup<T> {
// CHECK JVM_IR:
// Mangled name: Monoid#combine@1:0(1:0){}1:0
// Public signature: /Monoid.combine|-3517256775590682507[0]
// CHECK JS_IR NATIVE:
// Mangled name: Monoid#combine@1:0(1:0){}
// Public signature: /Monoid.combine|8412967464389689937[0]
abstract /* fake */ override infix fun T.combine(other: T): T
// CHECK:
@@ -14,6 +17,9 @@ interface Monoid<T : Any?> : Semigroup<T> {
// CHECK JVM_IR:
// Mangled name: Monoid#<get-unit>(){}1:0
// Public signature: /Monoid.unit.<get-unit>|-2842189358620964971[0]
// CHECK JS_IR NATIVE:
// Mangled name: Monoid#<get-unit>(){}
// Public signature: /Monoid.unit.<get-unit>|1530864625432111105[0]
abstract get
}
@@ -26,6 +32,9 @@ interface Semigroup<T : Any?> {
// CHECK JVM_IR:
// Mangled name: Semigroup#combine@1:0(1:0){}1:0
// Public signature: /Semigroup.combine|-3517256775590682507[0]
// CHECK JS_IR NATIVE:
// Mangled name: Semigroup#combine@1:0(1:0){}
// Public signature: /Semigroup.combine|8412967464389689937[0]
abstract infix fun T.combine(other: T): T
}
@@ -41,6 +50,9 @@ object IntMonoid : Monoid<Int> {
// CHECK JVM_IR:
// Mangled name: IntMonoid#<get-unit>(){}kotlin.Int
// Public signature: /IntMonoid.unit.<get-unit>|3772729924213749256[0]
// CHECK JS_IR NATIVE:
// Mangled name: IntMonoid#<get-unit>(){}
// Public signature: /IntMonoid.unit.<get-unit>|1530864625432111105[0]
override get
// CHECK:
@@ -51,6 +63,9 @@ object IntMonoid : Monoid<Int> {
// CHECK JVM_IR:
// Mangled name: IntMonoid#combine@kotlin.Int(kotlin.Int){}kotlin.Int
// Public signature: /IntMonoid.combine|4765448259581317405[0]
// CHECK JS_IR NATIVE:
// Mangled name: IntMonoid#combine@kotlin.Int(kotlin.Int){}
// Public signature: /IntMonoid.combine|4429091503069708823[0]
override infix fun Int.combine(other: Int): Int
}
@@ -66,6 +81,9 @@ object StringMonoid : Monoid<String> {
// CHECK JVM_IR:
// Mangled name: StringMonoid#<get-unit>(){}kotlin.String
// Public signature: /StringMonoid.unit.<get-unit>|4504480110251605077[0]
// CHECK JS_IR NATIVE:
// Mangled name: StringMonoid#<get-unit>(){}
// Public signature: /StringMonoid.unit.<get-unit>|1530864625432111105[0]
override get
// CHECK:
@@ -76,6 +94,9 @@ object StringMonoid : Monoid<String> {
// CHECK JVM_IR:
// Mangled name: StringMonoid#combine@kotlin.String(kotlin.String){}kotlin.String
// Public signature: /StringMonoid.combine|-5815259829474546918[0]
// CHECK JS_IR NATIVE:
// Mangled name: StringMonoid#combine@kotlin.String(kotlin.String){}
// Public signature: /StringMonoid.combine|-2748332935123183663[0]
override infix fun String.combine(other: String): String
}
@@ -83,10 +104,16 @@ object StringMonoid : Monoid<String> {
// CHECK JVM_IR:
// Mangled name: #box(){}kotlin.String
// Public signature: /box|-9347091776561469[0]
// CHECK JS_IR NATIVE:
// Mangled name: #box(){}
// Public signature: /box|2173511048851971368[0]
fun box(): String
// CHECK JVM_IR:
// Mangled name: #sum!Monoid<0:0>@kotlin.collections.List<0:0>(){0§<kotlin.Any?>}0:0
// Public signature: /sum|7635142307973834922[0]
// CHECK JS_IR NATIVE:
// Mangled name: #sum!Monoid<0:0>@kotlin.collections.List<0:0>(){0§<kotlin.Any?>}
// Public signature: /sum|6490726678726957775[0]
fun <T : Any?> List<T>.sum($context_receiver_0: Monoid<T>): T