sdeleuze
11/13/2017, 9:40 AMeginez
11/15/2017, 8:44 PMadeln
12/18/2017, 1:59 PMkotlin.compiler.execution.strategy=in-process
?yan
01/18/2018, 9:24 PM--debug
is definitely a bit noisy. I think you can run with the --info
option instead, it should also print all options passed to kotlinc.
As about incremental compilation, I think @alexey.tsvetkov can help you much better than me.thalescm
01/18/2018, 9:34 PMthalescm
01/18/2018, 10:08 PMkotlinc
the first time (to generate stubs) it already fail cause it’s looking for expected generated classes that are used the sources, so, what should I pass as sources when generating stubs and running apt?pixelbumper
01/22/2018, 7:22 PMpatapon
03/05/2018, 9:53 AMcharlesmuchene
03/13/2018, 8:32 AMvoid awesomeMethod(Class<? extends Parent> klasss)
but the compiler (in Android Studio) doesn’t accept an instance Kotlin class class Child : Parent
as a valid parameter value.Dave Leeds
06/08/2018, 1:55 AMatomicExpression
includes a number of things that can be evaluated, like literalConstant
and functionLiteral
. Even the different jump
structures (like throw
and return
) appear to technically evaluate to Nothing
.
But the list also includes loop
, which doesn't appear to be an expression. In fact, if you try to assign a for
loop to a variable, the compiler says that "For is not an expression, and only expressions are allowed here."
So, I was wondering, why does loop
show up as part of atomicExpression
in the grammar? Is there some context in which loops can be evaluated?anidotnet
08/01/2018, 8:05 PMError:Kotlin: [Internal Error] java.lang.IllegalStateException: The provided plugin org.jetbrains.kotlin.kapt3.Kapt3ComponentRegistrar is not compatible with this version of compiler
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:198)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:117)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.createForProduction(KotlinCoreEnvironment.kt:446)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.createCoreEnvironment(K2JVMCompiler.kt:295)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:147)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:51)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:94)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:50)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:88)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$$inlined$ifAlive$lambda$1.invoke(CompileServiceImpl.kt:402)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$$inlined$ifAlive$lambda$1.invoke(CompileServiceImpl.kt:101)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:929)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:101)
at org.jetbrains.kotlin.daemon.common.DummyProfiler.withMeasure(PerfUtils.kt:137)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.checkedCompile(CompileServiceImpl.kt:969)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.doCompile(CompileServiceImpl.kt:928)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:400)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.lang.AbstractMethodError
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:190)
... 33 more
tschuchort
10/10/2018, 10:26 AMElements.Origin.MANDATED
or EXPLICIT
like the generated synthetic methods with $annotations
suffix? That would make it possible to process annotations on top-level properties and type aliases in files with @JvmMultifileClass
annotation.
In order to process annotations on properties or type aliases you need to get ahold of the propertyName$annotations()V
method but for multifile class parts this element is in the synthetic FacadeNameKt__FileNameKt
class. Since the class is synthetic it is never loaded by the annotation processor and can not be accessed, even if you know the name from parsing the facade class' @Metadata
annotationStrum355
11/23/2018, 2:22 PMMarc Knaup
01/10/2019, 11:16 AMinternal
?
Like in Swift where when everything is internal and thus never used from other modules it can be optimized and inlined quite a lot.Paulius Ruminas
01/15/2019, 9:00 AMDeferred
return type methods for suspend
functions e.g.
suspend fun foo(): String = "Hello world!"
would generate an additional method
fun foo(scope: CoroutineScope): Deferred<String> = scope.async { "Hello world!" }
As i try to hook into ir codegen i’m getting this exception:
exception: java.lang.IllegalStateException: The provided plugin com.nfq.NativeSuspendRegistrar is not compatible with this version of compiler
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:203)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:121)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.createForProduction(KotlinCoreEnvironment.kt:513)
at org.jetbrains.kotlin.cli.bc.K2Native.doExecute(K2Native.kt:57)
at org.jetbrains.kotlin.cli.bc.K2Native.doExecute(K2Native.kt:35)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:96)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:52)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:93)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:71)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:39)
at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMainNoExit(CLITool.kt:202)
at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMain(CLITool.kt:194)
at org.jetbrains.kotlin.cli.bc.K2Native$Companion$main$1.invoke(K2Native.kt:214)
at org.jetbrains.kotlin.cli.bc.K2Native$Companion$main$1.invoke(K2Native.kt:205)
at org.jetbrains.kotlin.konan.util.UtilKt.profileIf(Util.kt:37)
at org.jetbrains.kotlin.konan.util.UtilKt.profile(Util.kt:31)
at org.jetbrains.kotlin.cli.bc.K2Native$Companion.main(K2Native.kt:207)
at org.jetbrains.kotlin.cli.bc.K2NativeKt.main(K2Native.kt:259)
at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:16)
Caused by: java.lang.AbstractMethodError
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:195)
... 18 more
My build.gradle looks like this:
apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'kotlin-kapt'
repositories {
jcenter()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
implementation "org.jetbrains.kotlin:kotlin-compiler-embeddable:$kotlinVersion"
compileOnly 'com.google.auto.service:auto-service:1.0-rc4'
kapt 'com.google.auto.service:auto-service:1.0-rc4'
}
And my ComponenRegistrar looks like this:
@AutoService(ComponentRegistrar::class)
class NativeSuspendRegistrar : ComponentRegistrar {
override fun registerProjectComponents(project: MockProject, configuration: CompilerConfiguration) {
IrGenerationExtension.registerExtension(project, NativeSuspendIrGenerationExtension())
}
}
I use Kotlin 1.3.11jw
01/17/2019, 4:06 AMmiha-x64
01/22/2019, 4:00 PM@JvmStatic
really makes a method static inside an object declaration, if possible. So, I can imagine a corner case:
1. Module A contains an interface A {}
2. Module B implements it:
object B : A {
@JvmStatic fun doSomething()
}
3. Module A adds a method in next version: interface A { fun doSomething() }
Expected: B.doSomething()
and (B as A).doSomething()
is the same method.
But I think AbstractMethodError will occur instead.tschuchort
02/01/2019, 12:41 PM@kotlin.Metadata
annotation?Marc Knaup
02/01/2019, 9:27 PMMetadata
note which primary constructor parameters are also properties?Marc Knaup
02/01/2019, 9:41 PM/**
* Signifies that the corresponding property has a getter.
*/
@JvmField
val HAS_GETTER = Flag(F.HAS_GETTER)
And can there be properties without a getter? 🤔
Even with @JvmField
the flag HAS_GETTER
is set.Marc Knaup
02/03/2019, 3:51 PMproperty$annotations
method.
The method is still there at runtime even if all properties have SOURCE
retention and thus no annotations are left in the binary or at runtime.
Maybe the synthetic method can be deleted safely at some point?codyoss
02/04/2019, 6:53 PMjava.lang.VerifyError: Bad local variable type
does that mean I found a compiler bug? I have a private suspend inline fun
and when I remove the inline
part it seems happy…Marc Knaup
02/06/2019, 9:42 PM/**
* Signifies that the corresponding property has a getter.
*/
@JvmField
val HAS_GETTER = Flag(F.HAS_GETTER)
Can there ever be a property without a getter in the Kotlin metadata?Marc Knaup
02/07/2019, 10:20 PM@Metadata
?Marc Knaup
02/07/2019, 10:32 PMMarc Knaup
02/08/2019, 3:29 AM@Metadata
with properties:
var test = ""
get
private set
Both, getter and setter, are reported as Flag.IS_NOT_DEFAULT
in this case but clearly have default and no custom implementation.
Bug? 🤔Marc Knaup
02/08/2019, 1:53 PM// at file-level
var x = 2
property has flag HAS_SETTER
set
property doesn't contain a setter parameter 🤔charleskorn
02/12/2019, 6:28 AMtschuchort
02/18/2019, 3:11 PMenum class Enum
@JvmOverloads
constructor(a: O = O(), b: P = P()) {
}
Is this a known problem?Antanas A.
02/21/2019, 9:25 AMAntanas A.
02/21/2019, 9:25 AMIlmir Usmanov [JB]
02/21/2019, 2:25 PM