Jeremie D
06/25/2025, 11:38 AMDavid Coronel
06/25/2025, 5:06 PM.kt
file using Kotlin Poet during the FIR stage - for example, inside a FirFunctionCallChecker- and include it in the build source sets?DutchPotSauce
06/26/2025, 7:04 PMeygraber
06/29/2025, 8:18 PMorg.jetbrains.kotlin:kotlin-annotation-processing-compiler
?Eugen Martynov
06/30/2025, 3:58 PMThe root cause java.lang.RuntimeException was thrown at: org.jetbrains.kotlin.backend.jvm.codegen.FunctionCodegen.generate(FunctionCodegen.kt:48)
at org.jetbrains.kotlin.backend.common.CodegenUtil.reportBackendException(CodegenUtil.kt:107)
at org.jetbrains.kotlin.backend.common.CodegenUtil.reportBackendException$default(CodegenUtil.kt:90)
at org.jetbrains.kotlin.backend.common.phaser.PerformByIrFilePhase.invokeSequential(performByIrFile.kt:54)
at org.jetbrains.kotlin.backend.common.phaser.PerformByIrFilePhase.invoke(performByIrFile.kt:41)
at org.jetbrains.kotlin.backend.common.phaser.PerformByIrFilePhase.invoke(performByIrFile.kt:27)
at org.jetbrains.kotlin.config.phaser.CompilerPhaseKt.invokeToplevel(CompilerPhase.kt:62)
at org.jetbrains.kotlin.backend.jvm.JvmIrCodegenFactory.invokeCodegen(JvmIrCodegenFactory.kt:371)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.runCodegen$cli(KotlinToJVMBytecodeCompiler.kt:413)
With kotlin serialisation?Youssef Shoaib [MOD]
06/30/2025, 9:12 PMThere are plans to implement some more extensions which allow to
• declare new kinds of contractsAny info about what that means exactly? Does that mean adding syntax to the
contract
block, and providing a way to store that in the binary?Youssef Shoaib [MOD]
06/30/2025, 9:23 PMFirTypeAttributeExtension
?
I'm trying to implement Scala's Capture Checking as a FIR plugin. FirTypeAttributeExtension
doesn't seem enough on its own though, and likely I have to add some checkers as well, no? Does FirTypeAttributeExtension
affect call resolution as well? I don't actually want that, so I'm hoping it doesn't.rnett
06/30/2025, 11:36 PMOlaf Gottschalk
07/02/2025, 12:49 PM_:
because my "top level" functions do not directly care about the parameter name, they do not call anything from those context values. All they do is call lower-level functions, usually bridge functions I'd say, that specifically need the parameter and give it an explicit name.
Now, seeing that my most used character in modern Kotlin will be the _
, I wonder whether from a language design perspective it would be more beneficial to allow all context parameters where the name is irrelevant to be simply stated just like context receivers where before: without any name spec in front of the type. Just like even now a type alias works. Type aliases, interestingly did not change at all coming from context receivers!
I think it might be done like this because right now coming from context receivers it is not a good idea to allow the same syntax to mean different things, but on the long run:
would it not be possible to omit this unnecessary, cumbersome piece of _:
everywhere?Michael Friend
07/02/2025, 4:06 PMRaise<E>
receiver, then within that lambda i call a function that takes a context(Raise<E>) ()->T
, calling raise(...)
within the inner lambda block has ambiguity on whether it should refer to Raise<E>.raise()
on the outer receiver or context(_: Raise<E>) raise()
on the inner context and the compiler seems to always choose the outer receiver over the inner context.
I would expect it to work like having nested lambda with receiver blocks where it makes the call on the nearest/innermost matching receiver and just include available context params in that searchrnett
07/03/2025, 1:55 AMsmallshen
07/03/2025, 7:44 AM@Repr
value class DateT {
}
to
@JvmInline
value class DateT(val repr: REPR) {
}
I've successfully implement the add @JvmInline annotation, and adding a value parameter in constructor, but I'm having trouble declaring the val repr.
Should I do it in fir generation? or fir transform? I got VALUE_CLASS_CONSTRUCTOR_NOT_FINAL_READ_ONLY_PARAMETER, did I miss something, how do I properly create a property in Fir so it is a correct inline value class?toadzky
07/04/2025, 2:45 PMException during IR lowering
with a stacktrace that starts out
[ERROR] The root cause java.lang.IndexOutOfBoundsException was thrown at: java.base/java.util.AbstractList.subListRangeCheck(AbstractList.java:509)
[ERROR] at org.jetbrains.kotlin.backend.common.BackendException$Companion.report(BackendException.kt:31)
[ERROR] at org.jetbrains.kotlin.backend.common.BackendException$Companion.report$default(BackendException.kt:15)
[ERROR] at org.jetbrains.kotlin.backend.common.phaser.PerformByIrFilePhase.invoke(PerformByIrFilePhase.kt:37)
[ERROR] at org.jetbrains.kotlin.backend.common.phaser.PerformByIrFilePhase.invoke(PerformByIrFilePhase.kt:15)
[ERROR] at org.jetbrains.kotlin.backend.common.phaser.PhaseEngine.runPhase(PhaseEngine.kt:64)
[ERROR] at org.jetbrains.kotlin.backend.common.phaser.PhaseEngine.runPhase$default(PhaseEngine.kt:56)
[ERROR] at org.jetbrains.kotlin.backend.jvm.JvmIrCodegenFactory.invokeLowerings(JvmIrCodegenFactory.kt:359)
[ERROR] at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.runLowerings$cli(KotlinToJVMBytecodeCompiler.kt:415)
[ERROR] at org.jetbrains.kotlin.cli.pipeline.jvm.JvmBackendPipelinePhase.executePhase(JvmBackendPipelinePhase.kt:85)
...
[ERROR] Caused by: java.lang.IndexOutOfBoundsException: toIndex = 1
[ERROR] at java.base/java.util.AbstractList.subListRangeCheck(AbstractList.java:509)
[ERROR] at java.base/java.util.ArrayList.subList(ArrayList.java:1190)
[ERROR] at org.jetbrains.kotlin.backend.jvm.lower.SuspendLambdaLowering.generateContinuationClassForLambda(SuspendLambdaLowering.kt:162)
[ERROR] at org.jetbrains.kotlin.backend.jvm.lower.SuspendLambdaLowering.generateAnonymousObjectForLambda(SuspendLambdaLowering.kt:133)
[ERROR] at org.jetbrains.kotlin.backend.jvm.lower.SuspendLambdaLowering.access$generateAnonymousObjectForLambda(SuspendLambdaLowering.kt:113)
[ERROR] at org.jetbrains.kotlin.backend.jvm.lower.SuspendLambdaLowering$lower$1.visitBlock(SuspendLambdaLowering.kt:123)
i'm sure the problem is in my plugin, but the error doesn't give me any information about what code actually caused the problem. any suggestions on chasing down where the actual problem is?toadzky
07/04/2025, 4:47 PMFrançois
07/05/2025, 9:25 AMsmallshen
07/05/2025, 1:41 PMFILE: LibC.kt
public final typealias pid_t = R|kotlin/Long|
public abstract interface LibC : R|kotlin/Any| {
public abstract fun getpid(): R|{pid_t=} kotlin/Long|
public final companion object Companion : R|kotlin/Any| {
public final fun create(): R|kotlin/Unit|
private constructor(): R|LibC.Companion| {
super<R|kotlin/Any|>()
}
}
public final companion object Companion : R|kotlin/Any| {
public final val getpid: R|java/lang/foreign/MemorySegment|
public get(): R|java/lang/foreign/MemorySegment|
public final class Companion : R|kotlin/Any| {
public final val getpid: R|java/lang/foreign/FunctionDescriptor|
public get(): R|java/lang/foreign/FunctionDescriptor|
}
}
}
But when I tried to use statement LibC.Proc.getpid
it errors NO_COMPANION_OBJECT
what caused this error? (Proc is generated)
It seems like FirStandaloneQualifierChecker
runs before nested FirDeclarationGenerationExtension
, how could I fix it?smallshen
07/05/2025, 2:57 PMownerGenerator
is internal so I can not modify if I use buildRegularClassCopy to insert the companion objectsmallshen
07/05/2025, 3:05 PMtoadzky
07/08/2025, 2:05 PM! java.lang.NullPointerException: null
! at kotlin.coroutines.jvm.internal.ContinuationImpl.getContext(ContinuationImpl.kt:105)
! at kotlin.coroutines.jvm.internal.ContinuationImpl.intercepted(ContinuationImpl.kt:112)
! at kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt.intercepted(IntrinsicsJvm.kt:182)
! at kotlinx.coroutines.DelayKt.delay(Delay.kt:172)
but if i run mvn compile
first, it works fine.Sebastian Lehrbaum
07/09/2025, 12:48 PMExecution failed for task ':compileKotlin'.
> Error while evaluating property 'disableMultiModuleIC' of task ':compileKotlin'.
> Invocation of 'Task.project' by task ':compileKotlin' at execution time is unsupported with the configuration cache.
David Bieregger
07/09/2025, 7:20 PMarm64
versions of the binaries such as Node, WASM, and so on. But now I'm a bit stuck with the usage of kotlin-native-prebuilt
which currently doesn't have arm64
versions for neither Linux or Windows
Sooooo I was just wondering if someone of you could just add those two build targets to the build pipeline? I suppose this is not that big of a Hussle, because now we even have arm64
windows Docker images. I would be really grateful for that 🙂
(I know, I can just build it myself and I will probably do that know, but in long term it would really make my life a whole lot easier and eventually)rnett
07/09/2025, 9:44 PMgetNestedClassifiersNames
, and running into problems because FirClassDeclaredMemberScopeImpl
attempts to list the nested classifiers on creation, resulting a stack overflow. This is used by FirClassSymbol.constructors
and FirSession.declaredMemberScope
. Presumably this is to allow inclusion of static/companion object members, which I don't care about here. I've found several options to work around it:
1. Look at the declarations in classSymbol.fir.declarations
or classSymbol.declarationSymbols
directly - this has all sorts of warning annotations and seems like a bad idea
2. Use session.declaredMemberScopeWithLazyNestedScope(classSymbol.fir, emptyList())
- this uses the FIR scopes, but requires manually accessing .fir
. Doesn't seem to result in the generated name showing up unless it's also in the existingNames
argument, which defeats the point.
What's the best option here? Is there an option I'm missing?David Coronel
07/10/2025, 12:00 AMcom.names.inspector.Dog
is defined with a name ending in a specific suffix.
The attached images illustrate its behavior.
The plugin works correctly on JVM but fails with iOS targets.
When running the task compileKotlinIosArm64
, it fails with an error java.lang.NoClassDefFoundError: com/names/inspector/Dog
indicating that a class defined in a commonMain
sourceSet is not recognized properly, even though it is exported correctly for each iOS target.
Could you please help me understand why this plugin fails for iOS targets?Eugen Martynov
07/10/2025, 4:10 PMDavid Brunow
07/10/2025, 6:24 PMrnett
07/11/2025, 1:26 AMcreateMemberFunction
. The javadocs of valueParameter
say that if hasDefaultValue
is true the value must be generated in IR. That's fine. But when I set it, I don't even get that far - Fir2IrVisitor
throws because the expression for the default value is STUB
. Is there a way around this? I can build the default value in FIR but it's rather awkward and IIUC we shouldn't be building bodies in FIR in pluginsrnett
07/12/2025, 5:38 AMAlex Styl
07/13/2025, 5:50 AMval property = "value"
Current code:
val environment = KotlinCoreEnvironment.createForProduction(
projectDisposable = Disposer.newDisposable(),
configuration = CompilerConfiguration(),
configFiles = EnvironmentConfigFiles.JS_CONFIG_FILES
)
val fileWithProperty = PsiManager.getInstance(environment.project)
.findFile(LightVirtualFile("FileWithProperty.kt", INSTANCE, "val property = \"value\"")) as KtFile
val myVal = fileWithProperty.declarations.first() as KtProperty
when i inspect myVal
there is nothing that hints towards the type (string) of the property.
Reading this channel I think I need a binding context, but I don't understand how to create one. For context, I am building a CLI app (not a plugin)PHondogo
07/14/2025, 6:58 AMEugen Martynov
07/14/2025, 1:45 PM