hfhbd
08/26/2021, 8:18 AMjava.lang.IllegalStateException: IrSimpleFunctionSymbolImpl is already bound: FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:<Uninitialized>
at org.jetbrains.kotlin.ir.symbols.impl.IrBindableSymbolBase.bind(IrPrivateSymbolBase.kt:64)
Dave
08/26/2021, 9:48 AMIrGenerationExtension
to modify the IR for the current module.
But is there a way to modify the IR coming from other modules?
I know that seems odd. But the use case is in the context of JS.
When a 'binary' is created, kotlin-IR-JS generates a js file that contains all the depended on modules also,
and I want to adjust the JS that is generated for a depended on module - i.e. via the IR.
thanksjw
08/27/2021, 1:09 AMVojtech Hrdina
08/27/2021, 4:10 PM./gradlew :app:compileDebugUnitTestKotlin --debug
and it always stuck with following message
2021-08-27T16:31:11.764+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2021-08-27T16:31:11.764+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2021-08-27T16:31:11.764+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2021-08-27T16:31:11.764+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2021-08-27T16:31:11.764+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2021-08-27T16:31:11.764+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
I already identified test file which causing this issue but I don’t know what could be wrong and it is stuck forever.
AGP 4.2.0
Kotlin 1.5.0
Gradle wrapper 6.8.3
Java 11
macOS 11.5.2, Ubuntu 16.04
org.gradle.jvmargs=-Xmx4608M -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.parallel=true
org.gradle.caching=true
android.enableD8=true
android.useAndroidX=true
android.enableJetifier=true
kapt.use.worker.api=true
kapt.incremental.apt=true
kapt.include.compile.classpath=false
android.databinding.incremental=true
android.forceJacocoOutOfProcess=true
raulraja
08/31/2021, 10:15 AMursus
09/06/2021, 1:50 AMKtNamedFunction
. Is there a way to check if the type it represents, is a subclass of some another type? Or is that simply too soon to say at that point?Tomasz Krakowiak
09/06/2021, 6:09 AMfun styled(block : RuleSet, @CallerPackage packageName)
and introduce synthetic macro-like function:
fun styled(block : RuleSet) = styled(block, callerPackage())
and wherever styled(block)
is used, plugin would replace calls with styled(block, "actual.callers.package.name")
.
Are there any good examples I could use? Maybe somewhere in compose?ursus
09/07/2021, 12:22 PMprintln
doesn't seem to work, and I have verbose
flag in compile options as well (building via gradle)mcpiroman
09/11/2021, 10:25 AMval symRemapper = DeepCopySymbolRemapper()
val moduleCopy = DeepCopyIrTreeWithSymbols(symRemapper, DeepCopyTypeRemapper(symRemapper)).visitModuleFragment(module)
But it gives me java.lang.IllegalArgumentException: Non-remapped symbol FILE fqName:kotlin.ranges
Gamadril
09/15/2021, 8:11 PMeygraber
09/17/2021, 2:06 AMAnastasia Birillo [JB]
09/17/2021, 2:32 PMCallum Seabrook
09/22/2021, 4:23 PM@JvmName
annotations on a lot of my properties in interfaces. Now, this isn't an issue for the most part, except for the very frustrating and ridiculous inapplicable JVM name error that has to be suppressed in every class, but that's not the point of this. When I implement this interface, I would expect that those @JvmName
named functions would be overridden in the Java code, however this is not the case. What I actually find is that the compiler will generate the property as normal, and then generate normal getters and setters, and make the overridden function a synthetic bridge method that delegates to the getter.
Now, here's an example:
interface Vehicle {
@get:JvmName("wheels")
val wheels: Int
}
data class Car(override val wheels: Int) : Vehicle
And the generated code for this ends up looking something like this:
public interface Vehicle {
@JvmName(
name = "wheels"
)
int wheels();
}
public final class Car {
private final int wheels;
public Car(int wheels) {
this.wheels = wheels;
}
public int getWheels() {
return wheels;
}
// $FF: synthetic method
// $FF: bridge method
public int wheels() {
return getWheels();
}
}
I am unsure if this is intended behaviour or not, but to me it seems counter-intuitive.davidkarlsen
09/26/2021, 10:22 PMWilliam Reed
09/28/2021, 2:02 PMTypeElement
for this information?
if this is correct are there any libraries that wrap both in a kotlin idiomatic library?rahulc29
09/28/2021, 2:19 PMmikehearn
09/29/2021, 2:50 PMZac Sweers
10/04/2021, 3:24 AMkotlinOptions.modulePath
in an android project breaks incremental compilation. I've reproduced it and filed a bug here https://youtrack.jetbrains.com/issue/KT-49066Matej Drobnič
10/04/2021, 7:16 AMNon-incremental compilation will be performed: NO_BUILD_HISTORY
mean in kotlin build report?
Occasionally build will take a long time (obviously non-incremental) and looking at the build report will produce above message. I have not cleaned the build folder or did anything similar (just normal run command while developing). How would I go about debugging what causes build history to get wiped?Daniel Svensson
10/05/2021, 12:25 PM@JvmInline value class Foo(val b: Iface): Iface by b; fun bar(b: Iface) { ... }; val foo = Foo(..); bar(foo) // no boxing
?raulraja
10/08/2021, 12:00 PMRob Elliot
10/08/2021, 2:36 PMtypealias Fact<T : Any> = Pair<FactName, T>
in order to ensure that you can’t put null in it, but no dice.Tomasz Krakowiak
10/09/2021, 8:01 AMjava.lang.IllegalStateException: Not found Idx for public house.boardgames.model.cursor/CursorQuery|null[0]
Obviously a bug in compiler, but as project is not open source I am trying to figure out the issue and create mve. So far unsuccessful, If you have any hint what may be causing it, I would be grateful.
Details in the thread.
Affected version: 1.5.30, 1.5.31
Works in: 1.5.21
(Unable to test 1.6.00-M1)Callum Seabrook
10/09/2021, 11:20 AMJvmName
annotations to getters, or better yet, just rename the getters itself?Tomasz Krakowiak
10/10/2021, 6:42 AMelect
10/10/2021, 7:42 PMdavid.bilik
10/12/2021, 7:43 AMkotlinOptions {
allWarningsAsErrors = true
}
in my gradle android project and it works as expected but unfortunately one library is generating code through kapt which has warnings and then my project does not compile. Is there a way to disable checks for specific warnings or to not check the generated code?jimn
10/12/2021, 6:55 PMval foo:(Int)->Int
in kotlin-jvm to squash boxing?Petter Måhlén
10/15/2021, 11:22 AMclass Container<T>(
val func: (T) -> Unit,
val aT: T
)
sealed class Foo {
object Bar : Foo()
object Baz : Foo()
}
fun main() {
val c = Container(
{ f: Foo -> print("Got $f")},
Foo.Bar
)
c.func(Foo.Baz) // doesn't compile, because c is Container<Foo.Bar>, not Container<Foo>
val c2 = Container(
{ f: Foo -> print("Got $f")},
Foo.Bar as Foo
)
c2.func(Foo.Baz) // compiles
}
so, the compiler infers c
to be of type Container<Foo.Bar>
, where I expected to get a Container<Foo>
. It seems to me that there are two possible choices - either use Foo
for type parameter T
, or use the fact that since f
accepts a Foo
, it can also accept all `Foo.Bar`s. But what I wanted was in fact the former (the real use case is complicated by me trying to implement a typesafe heterogenous map of sorts, so I didn’t even get a compilation error, just a runtime ClassCastException). It seems to me like the current behaviour might be surprising - is there a reason for it, is it somehow more correct?raulraja
10/15/2021, 1:56 PMraulraja
10/15/2021, 1:56 PMFleshgrinder
10/15/2021, 3:15 PMchristophsturm
10/15/2021, 3:26 PMFleshgrinder
10/15/2021, 3:38 PMelect
10/15/2021, 4:20 PMralf
10/15/2021, 4:47 PMshikasd
10/15/2021, 6:07 PMraulraja
10/15/2021, 6:25 PMAlejandro Serrano Mena
10/15/2021, 7:19 PMralf
10/15/2021, 7:20 PMAlejandro Serrano Mena
10/15/2021, 7:21 PMAnastasia Birillo [JB]
10/19/2021, 5:52 PM