kralli
06/19/2019, 6:52 AMModuleDescriptor::findClassAcrossModuleDependencies(ClassId)
when running in IDEA. It works fine in the command line though. I really don't have any basis to perform debugging on when it comes to IDEA. All I could figure out so far is, that it uses the JvmAnalyzerFacade
when running in IDEA, which resolves classes differently than the command line facade. Does anyone know what component or so I am missing in order to resolve dependencies correctly?raulraja
06/19/2019, 9:27 AM.class
.
Idea is able to parse that presumably through the metadata annotations or parsing the class structure somehow.
Why doesn’t this work for synthetically generated code which also ends up in a class file? What is different from that bytecode and the one a user types in by hand and is properly recognised by the IDE.
Now for the human side…
For what is worth I’m grateful for everything JB does but the state of meta programming and compiler plugins in Kotlin which has been frequently brought up at conferences and many times publicly does not seem to have a Roadmap or goals for that matter that are publicly known to the community. Instead companies like Google are forking the Kotlin compiler because that is easier since they have control of Android Studio and they have announced a Jetpack Compose, a framework as the future of Android Development which is based on a compiler fork.
At this moment Jetpack Compose relies on a bunch of compiler extensions that are not public or have been modified to fit their needs, (many) I have read the sources and checked with their devs.
Does that mean that all extensions they rely upon will be accepted upstream in the Kotlin compiler?. I’m not sure forking the compiler is good for anyone but the current state of meta in Kotlin is forcing companies to do just this.
It’s not good for everyone when there are multiple versions of the compiler unless they are for KEEPs or enhancing the upstream compiler we all should rely upon.tschuchort
06/19/2019, 2:48 PMraulraja
06/20/2019, 8:25 AMraulraja
06/20/2019, 12:57 PMid("jps-compatible")
. Does anyone know what that is for? Thanks.lukaville
06/26/2019, 4:04 PMKotlinCompile
task and AndroidJavaCompile
task (from Android Gradle Plugin). Is KotlinCompile
task contain java compilation or not?raulraja
06/26/2019, 4:36 PMtschuchort
06/26/2019, 8:06 PMImran/Malic
06/27/2019, 3:01 PMMarc Knaup
07/10/2019, 4:52 PMinline class Test(private val value: Byte) {
fun toLong() = value.toLong()
}
Would I get any noteworthy performance benefit from making toLong()
inline
?
In general I'm not sure how functions of inline classes are actually invoked. As static functions with the inline value as parameter?redrield
07/15/2019, 5:39 AMshikasd
07/15/2019, 10:21 PMPHondogo
07/20/2019, 6:36 AMSlackbot
07/23/2019, 3:02 PMAlanna
07/24/2019, 10:58 PMaurimas
07/25/2019, 11:09 PMPHondogo
07/31/2019, 5:55 AMeygraber
08/02/2019, 6:37 PMkotlin.compiler.execution.strategy="in-process
? I can't find any documentation that discusses it.thana
08/08/2019, 2:04 PMAdam Spofford
08/08/2019, 5:47 PMraulraja
08/10/2019, 9:27 PMfir
. Does anyone know what they are for? thanks.Adam Spofford
08/14/2019, 10:09 PMOptional<T>
as T?
?Robert Menke
08/20/2019, 8:40 PMinline
?Matej Drobnič
08/21/2019, 10:45 AMNon-incremental compilation will be performed: inputs' changes are unknown (first or clean build)
message with Kotlin compiler (with gradle builds)?
It seems like when starting to build, kotlin will occasionaly decide to do full build instead of incremental. Enabling build report produces above message.bloder
08/24/2019, 2:17 AMDerek Berner
08/26/2019, 4:07 PMMap<KClass<T>, (T) -> Unit>
where the value type (T) -> Unit
is covariant (?) with T
. e.g. map[Int::class]
has type (Int) -> Unit
. There's no way to do this without casting, right?raulraja
08/30/2019, 9:24 PMval messageCollector: MessageCollector = configuration.get(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, MessageCollector.NONE)
This does not work on the IDEA side because CLIConfigurationKeys is not there.
What is the proper way to obtain the MessageCollector in the IDEA plugin that does not use CLIConfigurationKeys
? thanks!Foso
09/01/2019, 4:55 PMtschuchort
09/03/2019, 12:20 PMraulraja
09/03/2019, 6:20 PMKtTypeReference
for kotlin.Unit
and it could be any other fqName for a type and I wish to resolve the type for.
This is happening inside a function declared inside a class where I’m using the class member declaration scope to resolve the types.
Currently I’m using:
val returnType = typeResolver.resolveType(containingDeclaration.scopeForMemberDeclarationResolution, function.typeReference!!, trace, true)
but this returns:
[ERROR : kotlin.Unit]
Is there a better way to go from KtTypeReference -> KotlinType
than using the type resolver? Is there a different type of scope I should be constructing to resolve the type?
Any help is appreciated, thanks.raulraja
09/03/2019, 6:20 PMKtTypeReference
for kotlin.Unit
and it could be any other fqName for a type and I wish to resolve the type for.
This is happening inside a function declared inside a class where I’m using the class member declaration scope to resolve the types.
Currently I’m using:
val returnType = typeResolver.resolveType(containingDeclaration.scopeForMemberDeclarationResolution, function.typeReference!!, trace, true)
but this returns:
[ERROR : kotlin.Unit]
Is there a better way to go from KtTypeReference -> KotlinType
than using the type resolver? Is there a different type of scope I should be constructing to resolve the type?
Any help is appreciated, thanks.shikasd
09/03/2019, 10:30 PMBindingContext
for TYPE
, but it probably not populated before resolution.
I am usually resolving the whole function using ResolveSession.resolveDescriptor
and using it returnType
. Not sure about efficiency of this, but it works most of the time 🙂raulraja
09/03/2019, 10:33 PMBindingContext.TYPE
is not populated yet so I need to resolve it, but I will try with the resolve session and report backResolveSession
I get:
org.jetbrains.kotlin.resolve.lazy.NoDescriptorForDeclarationException: Descriptor wasn't found for declaration CLASS
at org.jetbrains.kotlin.idea.project.IdeaAbsentDescriptorHandler.diagnoseDescriptorNotFound(IdeaLocalDescriptorResolver.kt:44)
at org.jetbrains.kotlin.resolve.lazy.LazyDeclarationResolver.findClassDescriptor(LazyDeclarationResolver.kt:88)
at org.jetbrains.kotlin.resolve.lazy.LazyDeclarationResolver.getClassDescriptor(LazyDeclarationResolver.kt:62)
at org.jetbrains.kotlin.resolve.lazy.LazyDeclarationResolver.getMemberScopeDeclaredIn$frontend(LazyDeclarationResolver.kt:227)
at org.jetbrains.kotlin.resolve.lazy.LazyDeclarationResolver$resolveToDescriptor$1.visitNamedFunction(LazyDeclarationResolver.kt:124)
at org.jetbrains.kotlin.resolve.lazy.LazyDeclarationResolver$resolveToDescriptor$1.visitNamedFunction(LazyDeclarationResolver.kt:94)
at org.jetbrains.kotlin.psi.KtNamedFunction.accept(KtNamedFunction.java:50)
at org.jetbrains.kotlin.resolve.lazy.LazyDeclarationResolver.resolveToDescriptor(LazyDeclarationResolver.kt:94)
at org.jetbrains.kotlin.resolve.lazy.LazyDeclarationResolver.resolveToDescriptor(LazyDeclarationResolver.kt:91)
at org.jetbrains.kotlin.resolve.lazy.ResolveSession.resolveToDescriptor(ResolveSession.java:324)
at arrow.meta.qq.QuoteKt$classOrObject$$inlined$quote$2$1.invoke(Quote.kt:221)
at arrow.meta.qq.QuoteKt$classOrObject$$inlined$quote$2$1.invoke(Quote.kt)
at arrow.meta.extensions.MetaComponentRegistrar$syntheticResolver$1.generateSyntheticMethods(MetaComponentRegistrar.kt:407)
at arrow.meta.extensions.MetaComponentRegistrar$registerSyntheticResolver$1.generateSyntheticMethods(MetaComponentRegistrar.kt:596)
at org.jetbrains.kotlin.resolve.extensions.SyntheticResolveExtension$Companion$getInstance$1.generateSyntheticMethods(SyntheticResolveExtension.kt:86)
SyntheticResolverExtension.generateSyntheticMethods
shikasd
09/04/2019, 1:01 AMkralli
09/04/2019, 6:03 AMthisDescriptor.module.findClassAcrossModuleDependencies(ClassId.topLevel(fqName))
thisDescriptor.module.builtIns.unitType
SyntheticResolveExtension.generateSyntheticMethods
)raulraja
09/04/2019, 7:03 AM