Manuel Dossinger
07/08/2022, 10:17 AMMichael Paus
07/10/2022, 7:18 AMjava.lang.IllegalStateException: IrBasedSimpleFunctionDescriptor: FUN name:DataTooltipArea visibility:public modality:FINAL <> (dataString:kotlin.String, modifier:androidx.compose.ui.Modifier, content:kotlin.Function2<androidx.compose.runtime.Composer, kotlin.Int, kotlin.Unit>) returnType:kotlin.Unit [expect]
The project builds and runs perfectly on JVM and even on Web (Canvas). Can anybody tell me what this error message actually means?fwcd
07/11/2022, 2:26 AMintellij-core
, i.e. outside of an IDE context? Creating `LightVirtualFile`s and passing them to PsiManager.findFile
yields an initial parse, but is there a way to e.g. update a certain text range in the virtual file and also trigger an update to the PSI? My attempts to modify the virtual file e.g. by setBinaryContent
or setContent
either caused the PSI file to not get updated at all or throw an exception that it's out-of-sync with the virtual fileJohann Beleites
07/13/2022, 6:52 AMjava.util.Properties
, javax.crypto.Cipher
). I've been debugging a little already and found that the new version behaves differently during resolution of imports and 1.7.0 doesn't seem to successfully resolve these types anymore. I haven't been able to pinpoint the exact place where this is caused yet. Can anyone tell me if there is something to watch out for in 1.7.0? Am I missing something?Michael Paus
07/16/2022, 8:10 AMpublic static final long SIGN_BIT_MASK = 0x8000000000000000L;
a perfectly legal statement and its Kotlin counterpart
const val SIGN_BIT_MASK: Long = 0x8000000000000000L
results in an error? (Value out of range.)
Such inconsistencies make it very difficult to port any Math libraries from Java to Kotlin.Tóth István Zoltán
07/16/2022, 8:12 AMnatario1
07/16/2022, 7:51 PMKotlinCompilerPluginSupportPlugin.applyToCompilation
is invoked, so kotlin is preparing the args to be passed to the plugin. There I have a command line processor and an IrGenerationExtension. I’m adding all kinds of logs - println(), error(“Hello world”), send stuff to createDiagnosticReporter(). But I get nothing, compilation succeeds. Not sure what to do, maybe there is some compiler flag that can give me more information?martmists
07/17/2022, 1:30 AMmartmists
07/17/2022, 10:11 AMMikhail
07/19/2022, 4:52 PMJohann Beleites
07/20/2022, 1:38 PMabstract class Base {
open fun foo() = "Base"
}
class A: Base()
class B: Base() {
override fun foo() = "B"
}
fun main(vararg args: String) {
val foo: Base = B()
if (foo is B) println(foo.foo())
}
The call to foo.foo()
in the main method results in B
to be printed, as expected. However, when I try to resolve foo.foo()
using the compiler, it resolves it to the implementation in Base
. This can be observed as well when pasting the code into IntelliJ and Ctrl + clicking
on foo.foo()
call.
If I change the line to println((foo as B).foo())
the static resolution works as expected and resolves to the implementation in B
. I don't know how exactly smart casts work internally, however, shouldn't the compiler resolve to B#foo
in both cases?PHondogo
07/20/2022, 3:15 PMabstract class SomeClass<T> {
abstract fun execute(): T
}
class SomeImplementation : SomeClass<String>() {
override fun execute(): String = "Test"
}
open class Test<S: SomeClass<T>, T>
class Test1 : Test<SomeImplementation, _>() // compiler complains about Unresolved reference: _
Chachako
07/21/2022, 4:49 AMMikhail
07/21/2022, 7:53 PMStumpos
07/22/2022, 8:28 PMlouiscad
07/23/2022, 3:17 PMCould not perform incremental compilation: Could not connect to Kotlin compile daemon
Could not connect to kotlin daemon. Using fallback strategy.What could cause this?
Mikhail
07/25/2022, 3:19 AM@NotBlank
appear within the type declaration on the field but not in the constructor parameter?Tóth István Zoltán
07/26/2022, 3:54 AMdump
, I see that the compiler generates fake overrides for everything defined in the superclass. Is this necessary for the backend? I mean it is not a trouble to generate them but it makes the generated IR quite big. What do these fake overrides actually do?Youssef Shoaib [MOD]
07/26/2022, 12:14 PMT::class == Desired::class
doesn't seem to be evaluated at compile time. I can also do valueOfTypeDesired is T && !(valueOfSupertypeOfDesired is T)
but again this isn't evaluated at compile time. I'm interested not only because of performance but for a value-class optimization use case (can give more details if interested).jessewilson
07/26/2022, 1:53 PMComponentRegistrar
now uses <http://org.jetbrains.kotlin.com|org.jetbrains.kotlin.com>.intellij.mock.MockProject
on all platforms. (We had been using com.intellij.mock.MockProject
for Kotlin/Native).
Is this expected? It’s awesomeYoussef Shoaib [MOD]
07/29/2022, 12:39 AMcontext(Unit, Boolean)
fun bothContexts() {
// Refers to String.toInt() for some reason
toInt()
}
Looks pretty bad to me. Has this been reported already? It doesn't reproduce in FIR btw.Sam
07/29/2022, 7:58 AM(A) -> B
, it’d be cool to be able to just pass ::foo
instead of A::foo
. Is there a name for what I want? Even better, is there an existing ticket/proposal for it?
Example:
data class A(val name: String)
fun <B> A.getProp(prop: (A) -> B) = prop(this)
fun A.getName() = getProp(::name) // I want this
fun A.getName2() = getProp(A::name) // But I have to do this instead
PHondogo
07/29/2022, 10:55 AMopen class Test {
open fun SomeClass.test(){}
}
class Test2 : Test() {
override fun SomeClass.test() {
super.test() // is compilation error
}
}
natario1
07/29/2022, 4:40 PM@CName
functions and have them exported in the final K/N binary. But looking at the file with nm
, I can see that the generated symbol is not exported. Is it even possible to achieve this?
Maybe the export pipeline runs before IrGeneration
and so my symbol is useless? Or I’m doing something wrong. I’m generating my function and then calling irFile.declarations.add(function)
, something I’m a bit unsure of.natario1
07/31/2022, 3:02 PMfun hello(who: String) = "Hello, $who!"
as a IrSimpleFunction
.
I need to pass this to a fun process(function: (String) -> String)
, but I’m confused as to how to pass my function as a value argument to another.
To be clear, in source code I’d do process(::hello) or process { hello(it) }.Mendess
08/01/2022, 11:07 AM@MustUse
class Foo
and every function that returns a Foo will issue a warning at call site the returned value is not used in some wayJavier
08/03/2022, 11:09 PMfunction.contextReceivers
where function
is KtNamedFunction
with Kotlin 1.7.10. Is there any way to get the list of context receivers?natario1
08/04/2022, 9:04 AMIllegalStateException: No file for io.company.product.sample/functionName|8889119292615326163[0] in moduleI’m trying to change value params and return type of a top level function. I’m using<io.company.product:sample>
irFile.transformChildrenVoid
and then function.deepCopySavingMetadata
and then doing my changes. Compilation works, but I get the error above when linking the native binary.Alexander Maryanovsky
08/04/2022, 3:40 PMreactormonk
08/04/2022, 3:49 PMCurrentState
and DesiredState
. When doing val x = when (CurrentState to DesiredState) { ... }
, the exhaustiveness checker doesn't seem to like the non-existence of an else
, even if I covered all branches. Any way to help it out a bit?