Skip to content

Update template to Kotlin 2.2.0 #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
kotlin("multiplatform") version "2.1.20" apply false
kotlin("jvm") version "2.1.20" apply false
kotlin("multiplatform") version "2.2.0-RC2" apply false
kotlin("jvm") version "2.2.0-RC2" apply false
id("com.github.gmazzo.buildconfig") version "5.6.5"
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.16.3" apply false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import org.jetbrains.kotlin.ir.expressions.impl.IrInstanceInitializerCallImpl
import org.jetbrains.kotlin.ir.expressions.impl.IrReturnImpl
import org.jetbrains.kotlin.ir.types.IrSimpleType
import org.jetbrains.kotlin.ir.util.primaryConstructor
import org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid
import org.jetbrains.kotlin.ir.visitors.IrVisitorVoid
import org.jetbrains.kotlin.ir.visitors.acceptChildrenVoid

abstract class AbstractTransformerForGenerator(protected val context: IrPluginContext) : IrElementVisitorVoid {
abstract class AbstractTransformerForGenerator(protected val context: IrPluginContext) : IrVisitorVoid() {
protected val irFactory = context.irFactory
protected val irBuiltIns = context.irBuiltIns

Expand Down
50 changes: 25 additions & 25 deletions compiler-plugin/testData/box/anotherBoxTest.fir.ir.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
FILE fqName:<root> fileName:/anotherBoxTest.kt
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
FUN name:box visibility:public modality:FINAL returnType:kotlin.String
BLOCK_BODY
VAR name:list type:kotlin.collections.List<kotlin.String> [val]
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
TYPE_ARG T: kotlin.String
ARG elements: VARARG type=kotlin.Array<out kotlin.String> varargElementType=kotlin.String
CONST String type=kotlin.String value="aaa"
CONST String type=kotlin.String value="bb"
CONST String type=kotlin.String value="c"
VAR name:result type:kotlin.Int [val]
CALL 'public final fun sum (): kotlin.Int declared in kotlin.collections' type=kotlin.Int origin=null
$receiver: 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.String
<R>: kotlin.Int
$receiver: GET_VAR 'val list: kotlin.collections.List<kotlin.String> declared in <root>.box' type=kotlin.collections.List<kotlin.String> origin=null
transform: FUN_EXPR type=kotlin.Function1<kotlin.String, kotlin.Int> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (it:kotlin.String) returnType:kotlin.Int
VALUE_PARAMETER name:it index:0 type:kotlin.String
CALL 'public final fun sum (<this>: kotlin.collections.Iterable<kotlin.Int>): kotlin.Int declared in kotlin.collections' type=kotlin.Int origin=null
ARG <this>: CALL 'public final fun map <T, R> (<this>: kotlin.collections.Iterable<T of kotlin.collections.map>, 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
TYPE_ARG T: kotlin.String
TYPE_ARG R: kotlin.Int
ARG <this>: GET_VAR 'val list: kotlin.collections.List<kotlin.String> declared in <root>.box' type=kotlin.collections.List<kotlin.String> origin=null
ARG transform: FUN_EXPR type=kotlin.Function1<kotlin.String, kotlin.Int> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL returnType:kotlin.Int
VALUE_PARAMETER kind:Regular name:it index:0 type:kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='local final fun <anonymous> (it: kotlin.String): kotlin.Int declared in <root>.box'
CALL 'public open fun <get-length> (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR 'it: kotlin.String declared in <root>.box.<anonymous>' type=kotlin.String origin=null
ARG <this>: GET_VAR 'it: kotlin.String declared in <root>.box.<anonymous>' type=kotlin.String origin=null
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
WHEN type=kotlin.String 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: GET_VAR 'val result: kotlin.Int declared in <root>.box' type=kotlin.Int origin=null
arg1: CONST Int type=kotlin.Int value=6
ARG arg0: GET_VAR 'val result: kotlin.Int declared in <root>.box' type=kotlin.Int origin=null
ARG arg1: CONST Int type=kotlin.Int value=6
then: CONST String type=kotlin.String value="OK"
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
Expand All @@ -35,26 +35,26 @@ FILE fqName:<root> fileName:/anotherBoxTest.kt
GET_VAR 'val result: kotlin.Int declared in <root>.box' type=kotlin.Int origin=null
FILE fqName:foo.bar fileName:__GENERATED DECLARATIONS__.kt
CLASS GENERATED[org.demiurg906.kotlin.plugin.fir.SimpleClassGenerator.Key] CLASS name:MyClass modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:foo.bar.MyClass
CONSTRUCTOR GENERATED[org.demiurg906.kotlin.plugin.fir.SimpleClassGenerator.Key] visibility:public <> () returnType:foo.bar.MyClass
thisReceiver: VALUE_PARAMETER INSTANCE_RECEIVER kind:DispatchReceiver name:<this> type:foo.bar.MyClass
CONSTRUCTOR GENERATED[org.demiurg906.kotlin.plugin.fir.SimpleClassGenerator.Key] visibility:public returnType:foo.bar.MyClass
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS GENERATED[org.demiurg906.kotlin.plugin.fir.SimpleClassGenerator.Key] CLASS name:MyClass modality:FINAL visibility:public superTypes:[kotlin.Any]' type=foo.bar.MyClass
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN returnType:kotlin.Boolean [fake_override,operator]
VALUE_PARAMETER kind:DispatchReceiver name:<this> index:0 type:kotlin.Any
VALUE_PARAMETER kind:Regular name:other index:1 type:kotlin.Any?
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN returnType:kotlin.Int [fake_override]
VALUE_PARAMETER kind:DispatchReceiver name:<this> index:0 type:kotlin.Any
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN returnType:kotlin.String [fake_override]
VALUE_PARAMETER kind:DispatchReceiver name:<this> index:0 type:kotlin.Any
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN GENERATED[org.demiurg906.kotlin.plugin.fir.SimpleClassGenerator.Key] name:foo visibility:public modality:FINAL <> ($this:foo.bar.MyClass) returnType:kotlin.String
$this: VALUE_PARAMETER name:<this> type:foo.bar.MyClass
FUN GENERATED[org.demiurg906.kotlin.plugin.fir.SimpleClassGenerator.Key] name:foo visibility:public modality:FINAL returnType:kotlin.String
VALUE_PARAMETER kind:DispatchReceiver name:<this> index:0 type:foo.bar.MyClass
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in foo.bar.MyClass'
CONST String type=kotlin.String value="Hello world"
30 changes: 15 additions & 15 deletions compiler-plugin/testData/box/simple.fir.ir.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
FILE fqName:foo.bar fileName:/simple.kt
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
FUN name:box visibility:public modality:FINAL returnType:kotlin.String
BLOCK_BODY
VAR name:result type:kotlin.String [val]
CALL 'public final fun foo (): kotlin.String declared in foo.bar.MyClass' type=kotlin.String origin=null
$this: CONSTRUCTOR_CALL 'public constructor <init> () declared in foo.bar.MyClass' type=foo.bar.MyClass origin=null
ARG <this>: CONSTRUCTOR_CALL 'public constructor <init> () declared in foo.bar.MyClass' type=foo.bar.MyClass origin=null
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in foo.bar'
WHEN type=kotlin.String 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: GET_VAR 'val result: kotlin.String declared in foo.bar.box' type=kotlin.String origin=null
arg1: CONST String type=kotlin.String value="Hello world"
ARG arg0: GET_VAR 'val result: kotlin.String declared in foo.bar.box' type=kotlin.String origin=null
ARG arg1: CONST String type=kotlin.String value="Hello world"
then: BLOCK type=kotlin.String origin=null
CONST String type=kotlin.String value="OK"
BRANCH
Expand All @@ -20,26 +20,26 @@ FILE fqName:foo.bar fileName:/simple.kt
GET_VAR 'val result: kotlin.String declared in foo.bar.box' type=kotlin.String origin=null
FILE fqName:foo.bar fileName:__GENERATED DECLARATIONS__.kt
CLASS GENERATED[org.demiurg906.kotlin.plugin.fir.SimpleClassGenerator.Key] CLASS name:MyClass modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:foo.bar.MyClass
CONSTRUCTOR GENERATED[org.demiurg906.kotlin.plugin.fir.SimpleClassGenerator.Key] visibility:public <> () returnType:foo.bar.MyClass
thisReceiver: VALUE_PARAMETER INSTANCE_RECEIVER kind:DispatchReceiver name:<this> type:foo.bar.MyClass
CONSTRUCTOR GENERATED[org.demiurg906.kotlin.plugin.fir.SimpleClassGenerator.Key] visibility:public returnType:foo.bar.MyClass
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS GENERATED[org.demiurg906.kotlin.plugin.fir.SimpleClassGenerator.Key] CLASS name:MyClass modality:FINAL visibility:public superTypes:[kotlin.Any]' type=foo.bar.MyClass
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN returnType:kotlin.Boolean [fake_override,operator]
VALUE_PARAMETER kind:DispatchReceiver name:<this> index:0 type:kotlin.Any
VALUE_PARAMETER kind:Regular name:other index:1 type:kotlin.Any?
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN returnType:kotlin.Int [fake_override]
VALUE_PARAMETER kind:DispatchReceiver name:<this> index:0 type:kotlin.Any
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN returnType:kotlin.String [fake_override]
VALUE_PARAMETER kind:DispatchReceiver name:<this> index:0 type:kotlin.Any
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN GENERATED[org.demiurg906.kotlin.plugin.fir.SimpleClassGenerator.Key] name:foo visibility:public modality:FINAL <> ($this:foo.bar.MyClass) returnType:kotlin.String
$this: VALUE_PARAMETER name:<this> type:foo.bar.MyClass
FUN GENERATED[org.demiurg906.kotlin.plugin.fir.SimpleClassGenerator.Key] name:foo visibility:public modality:FINAL returnType:kotlin.String
VALUE_PARAMETER kind:DispatchReceiver name:<this> index:0 type:foo.bar.MyClass
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in foo.bar.MyClass'
CONST String type=kotlin.String value="Hello world"
5 changes: 0 additions & 5 deletions kotlin-js-store/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -456,11 +456,6 @@ to-regex-range@^5.0.1:
dependencies:
is-number "^7.0.0"

[email protected]:
version "5.5.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.4.tgz#d9852d6c82bad2d2eda4fd74a5762a8f5909e9ba"
integrity sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==

workerpool@^6.5.1:
version "6.5.1"
resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.5.1.tgz#060f73b39d0caf97c6db64da004cd01b4c099544"
Expand Down