majindong
10/22/2022, 7:45 AMRob Elliot
10/22/2022, 10:38 AMtry {
TODO()
} catch (e: Exception) {
if (e.cause is AuthenticationException) {
throw e.cause // does not compile!
}
throw e
}
Gives me compiler error Smart cast to 'AuthenticationException' is impossible, because 'e.cause' is a property that has open or custom getter
.
But all I'm doing with it is throwing it, and the only requirement of throw
is that it's a Throwable
- which it definitely is.natario1
10/24/2022, 12:17 PMequals
for value classes is not allowed. Which kind of makes sense, but what about arrays? I have a value class Ints(val array: IntArray)
which fails on equality checks, because it won’t use contentEquals. Is this going to change in the future?Stefan
10/24/2022, 2:47 PMjava.util.UUID!
, not java.util.UUID
nor java.util.UUID?
? e.g. in register<UUID?>(Arb.uuid())
hfhbd
10/25/2022, 12:08 PMQuantum64
10/28/2022, 10:04 PMAyfri
11/01/2022, 11:29 PMunused
warning specifically for multiple gradle projects using my main build.gradle.kts
or a gradle plugin included in all the plugins to avoid having the warning everywhere.Slackbot
11/02/2022, 10:57 AMYoussef Shoaib [MOD]
11/06/2022, 3:28 PMFirPredicateBasedProvider
seems to only work for the files being compiled. Is there a simple way to loop over all imported library methods and filter them manually? Or would that be too costly? I can see how to find the FQNs for imported packages and methods, but then I'm not sure how to loop over their "visible" methods. I'm doing this for caching reasons, so if I accidentally get methods that aren't visible, that's still fine.
In other words, I'm looking for the FIR equivalent of module.getPackage(fqName).memberScope.getContributedDescriptors()
PHondogo
11/08/2022, 2:28 PMclass A<T>(
val klass: KClass<T> // compilation error if T is not T : Any. But I can't make it T : Any, cause see test function declaration below
) {
fun test(a: T) {
if (a == null) {
println("Value is null")
} else {
// use a::class
}
}
}
How to tell compiler that KClass must use T!! while in function test T's nullable must depends on actual T's nullability?SASANQUA
11/10/2022, 2:33 AMKotlinCoreProjectEnvironment#project
can be used to obtain services (PsiManager
, PsiFileFactory
...). But I am wondering whether the KotlinCoreProjectEnvironment
is a one-time use only so that when any files in a root directory change, the whole environment needs to be recreated. I can obtain a PsiFile
instance through PsiManager
but I cannot call PsiManager#reloadFromDisk
when a file change because that throws Missing extension point: com.intellij.psi.treeChangePreprocessor in container com.intellij.mock.MockProject@4a8355dd
.Am I doing this wrong or are there other ways to do it? It also seems that I can only add a root (as a directory or a jar) through JavaCoreProjectEnvironment#addSourcesToClassPath
or JavaCoreProjectEnvironment#addJarToClassPath
but cannot remove them. I tried looking into intellij-community
and it seems to use a ProjectExImpl
instance but not sure where it registers all its services or how it manages text changes in a file. Any help would be appreciated!eygraber
11/10/2022, 6:08 PMraulraja
11/11/2022, 4:07 PMZac Sweers
11/11/2022, 6:01 PM"-Xuse-fast-jar-file-system"
?
w: Using new faster version of JAR FS: it should make your build faster, but the new implementation is experimental
We’d like to take through its paces in our repo and test it out, but we also can’t afford to disable -Werror
. Can file a report on YouTrack too if that’s easier
edit: went ahead and filed https://youtrack.jetbrains.com/issue/KT-54928server
11/12/2022, 9:53 AMRob Elliot
11/15/2022, 1:09 PMDariusz Kuc
01/13/2022, 1:20 AMSpringBootTest
class) with
Recursion detected in a lazy value under LockBasedStorageManager@3d437e74 (TopDownAnalyzer for JVM)
The root cause java.lang.AssertionError was thrown at: org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassDescriptor.getModality(LazyClassDescriptor.java:538)
when I have both Spring
and kotlinx.serialization
plugins applied (test is starting a SpringBoot app and then using WebClient to pass kotlinx serialized Strings - its an integration test for a lib). Fails with both Kotlin 1.5.31
and 1.6.10
. Removing one of the plugins solves the compilation issue but it means I cannot test the above scenario.
Sounds like this is the issue -> https://youtrack.jetbrains.com/issue/KT-41341
Just wondering if anyone hit similar problem and whether they have any suggestions for some workarounds?
--- edit ---
correction: Exception is not actually thrown from SpringBootTest
but from a generated Serializable
class that is invoked during a test. Serialization using kotlinx.serialization
works fine on the generated class when Spring plugin is omitted.Leon Linhart
11/17/2022, 2:56 PMDiagnosticSuppressor
? I'm currently prototyping a plugin which slightly tweaks the behavior of a few checks by reimplementing them and suppressing the relevant diagnostics reported by the default ones. This seems to be feasible in K1 but I didn't find a way to suppress diagnostics in such a case using FIR yet.Sam Gammon
11/18/2022, 2:07 AMPHondogo
11/18/2022, 3:17 PMTóth István Zoltán
11/21/2022, 6:22 AMJohannes Barop
11/21/2022, 12:32 PMSam Gammon
11/22/2022, 3:09 AMorg.gradle.debug=true
and in-process
mode for the Kotlin compiler, but it still doesn't hit my breakpoints within the plugin.
the plugin is in a composite build, and i am running the compile from the parent build -- my hope is to apply the plugin within the parent build. so far, i'm able to confirm that the following is working correctly:
• the gradle sub-plugin which hosts the compiler plugin is applied (i hit a breakpoint here)
• the gradle sub-plugin correctly states that it isApplicable
• the plugin JAR ends up on the command line at -Xplugin=
• the plugin args end up on the command line at [..., -P, ":plugin:<name>:enabled=true,..."]
despite all of this:
• a test that verifies the plugin's effects fails
• i cannot hit breakpoints within the compiler plugin, but i can within the gradle script
• i do not see log messages reported via <http://CompilerMessageSeverity.INFO|CompilerMessageSeverity.INFO>
• i do not see log messages reported via CompilerMessageSeverity.LOGGING
• but then again maybe the plugin isn't running, or isn't hitting that code?
has anybody seen this before? thank you in advance for any helpSam Gammon
11/22/2022, 4:35 AMorg.jetbrains...ComponentRegistrar
jessewilson
11/22/2022, 10:01 PM18:28:11 e: java.lang.IllegalStateException: Expecting descriptor for app.cash.zipline.internal.bridge/SuspendCallback.Companion.Adapter|null[0]
18:28:11 at org.jetbrains.kotlin.backend.konan.serialization.KonanIrLinker$KonanCachedLibraryModuleDeserializer.tryDeserializeIrSymbol(KonanIrlinker.kt:644)
18:28:11 at org.jetbrains.kotlin.backend.common.serialization.BasicIrModuleDeserializer.deserializeIrSymbol(BasicIrModuleDeserializer.kt:111)
My read of the problem is the .klib descriptor only includes from the PSI model. So if I’m synthesizing new ones with IR, they’re not in the descriptor. Further details on my tracking bug.mzgreen
11/24/2022, 6:32 PMPiotr Krzemiński
11/25/2022, 1:03 PMPiotr Krzemiński
11/25/2022, 4:21 PMpablisco
11/27/2022, 6:58 PMserver
11/27/2022, 8:13 PM