eygraber
02/27/2024, 4:18 AMactual
? Happens in 1.9.22 and 2.0 Beta 4.
// common source set
public expect interface FooProvider
public interface FooApp : FooProvider
// Shared source set (jvm, js, wasmJs)
public actual interface FooProvider {
public val foo: Foo
}
class Foo
// separate module targeting wasmJs only (same happens with jvm and js)
public fun <FA : FooApp> fooApp(fooAppFactory: () -> FA) {
fooAppFactory().foo // Unresolved reference: foo only in IDE (runs fine)
(fooAppFactory() as FooApp).foo // no error
}
eygraber
02/27/2024, 10:08 PMprotected property exposes its internal type BarImpl
even though FooImpl
isn't open. Since bar
is protected, only subclasses of FooImpl
could access it, but that isn't possible because FooImpl
is final. So why is there an issue with making FooImpl
public?
abstract class Foo<B : Bar> {
protected abstract val bar: B
}
class FooImpl : Foo<BarImpl> {
override val bar: BarImpl
}
internal class BarImpl : Bar
Norbi
02/28/2024, 9:42 PMhfhbd
02/29/2024, 6:26 AMFirDeclarationGenerationExtension
? This extension contains generateConstructors
.afezeria
02/29/2024, 7:18 AMTóth István Zoltán
03/01/2024, 7:14 AMFirDeclarationGenerationExtension.getCallableNamesForClass
how are these names mixed with the ones from the original source code and the ones generated by other plugins? For example, if the original code have the function already, should I return with the name still?voohbar
03/02/2024, 3:43 AM[WARNING] Lombok Kotlin compiler plugin is an experimental feature. See: <https://kotlinlang.org/docs/components-stability.html>.
I am okay with Lombok being experimental. I need to use it.
However I also want to use
-Werror
Unfortunately, that warning above always trips it up and fails the build. Is there a way to somehow tell the Kotlin compiler that it can ignore this warning? That I am opting int?anlex N
03/02/2024, 1:41 PManlex N
03/03/2024, 3:12 PMhfhbd
03/04/2024, 7:55 AMjessewilson
03/04/2024, 4:26 PMkotlinx.datetime.Instant
in a unit test and my code compiled just fine. What’s happening?
Here’s the file that incorrectly compiles, and a screenshot showing that IntelliJ doesn’t mind that I forgot the import.Tóth István Zoltán
03/05/2024, 11:28 AMLazar Prijović
03/05/2024, 12:41 PMkotlin { wasmWasi { ... }}
configuration), and I don't want to run kotlin-js
directly from the bash.
Sorry if it was asked here before, I couldn't find it in READMEs or by Slack search.Manuel Wrage
03/07/2024, 9:53 AMjava.lang.NoClassDefFoundError: kotlinx/serialization/json/JsonKt
Compilation works fine for jvm and js targets.
Any idea how I can fix this?
Basically it seems that none of my compiler plugin dependencies are on the classpath for native compilation.anlex N
03/09/2024, 8:55 AMJRE
is bigger and bigger, I don't like. what do you think so?Zac Sweers
03/11/2024, 1:30 AMIrClass.superTypes
list all supertypes or just the directly declared supertypes list? I assume it’s the former but wanted to confirmOla Adolfsson
03/12/2024, 1:39 PM@file:JsExport
import kotlin.js.JsExport
import kotlin.js.JsName
@JsExport
interface ActionCandidate {
@jsName "blargh"
fun blargh()
}
reactormonk
03/13/2024, 3:53 PMString
stuff.ansman
03/14/2024, 8:06 PMclass Super<T1, T2>
data class Child<T : Super<String, Child<T>>>(val foo: String)
fun foo(child: Child<*>) {
child.foo
}
This fails to compile with an error on child.foo
saying:
Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public final val foo: String defined in com.example
natario1
03/14/2024, 8:39 PMIrPluginContext.referenceClass(ClassId)
returns null. The class is a public class provided by a dependency. Any hint on how to fix this?Kev
03/20/2024, 2:49 AMclass A
class B
interface Foo {
context(A)
fun getSomething(): Unit
}
class FooImpl : Foo {
context(A, B)
override fun getSomething() {
println("Hello, world!")
}
}
fun main() {
with(A()) {
with(B()) {
FooImpl().getSomething()
}
}
}
anlex N
03/22/2024, 3:12 PManlex N
03/23/2024, 3:33 PManlex N
03/23/2024, 4:24 PMhfhbd
03/24/2024, 3:34 PMAlexander Ioffe
03/27/2024, 2:12 AMIrLocalDelegatedProperty
? I'm trying to write a visitor that converts something like this:
val x = stuff
To something like this:
val x by MyDelegateValue { stuff }
Alexander Ioffe
03/27/2024, 2:12 AMMyDelegateValue
is something like: class MyDelegateValue<T>(private val inner: suspend () -> T) { operator fun getValue(t: T?, property: KProperty<*>): T = ... }
)Alexander Ioffe
03/27/2024, 2:13 AMirFactory.createLocalDelegatedProperty
but I don't understand how to create the `IrLocalDelegatedPropertySymbol`instanceArtyom Gornostayev
03/27/2024, 10:26 AMProduct
with a log of attributes (nullable and non-nullable).
Compiler generates byte code where it creates constructor similar to this:
Product.decompiled.java
...
// $FF: synthetic method
public Product(String var1, ..., int var40, int var41, DefaultConstructorMarker var42) {
if ((var40 & 1073741824) != 0) {
var31 = null;
}
if ((var40 & Integer.MIN_VALUE) != 0) {
var32 = null;
}
if ((var41 & 1) != 0) {
var33 = null;
}
if ((var41 & 2) != 0) {
var34 = null;
}
...
this(var1, ... var39);
}
There are two attributes var40
and var41
which (as I understood) rules nullability...
What is a logic behind this? Why compiler splits nullable fields into two groups?
Thanks a lot.Tóth István Zoltán
03/27/2024, 11:55 AMFirDeclarationGenerationExtension.getTopLevelClassIds
to return with the ids to generate. The question is how should I find the functions declared in the current module?