Youssef Shoaib [MOD]
03/25/2021, 8:41 PMlet
from the stdlib, I want to get the descriptor for that call). I do realise that I can get the bindingContext
and use that to call ktExpression.getResolvedCall
but obviously I don't have access to that inside of a CollectAdditionalSourcesExtension
so what can I do here? I'm thinking maybe I can run analysis twice or something as in run it once inside of a CollectAdditionalSourcresExtension
and generate the files and then let the compiler do its own analysis normally but is that the right approach?gammax
03/26/2021, 10:58 AMKotlinType.getJetTypeFqName
function (here). We use this function quite a lot inside detekt when resolving types.
This function is inside the JS package of the compiler: org.jetbrains.kotlin.js.descriptorUtils
but it’s implementation is platform agnostic. Why is this the case? Could this be moved inside org.jetbrains.kotlin.descriptors
?Youssef Shoaib [MOD]
03/26/2021, 9:29 PM.class
file? kotlinx-metadata-jvm
seems to give no information whatsoever about how to do this and assumes that either you're going to get it "reflectively" or "through other means". Is there an easy way to get the metadata out quickly, or would I have to go into ASM?pablisco
03/30/2021, 4:46 PMpajatopmr
03/30/2021, 9:17 PMif
and when
.rnett
04/02/2021, 10:28 PMJustin Tullgren
04/06/2021, 2:14 PMYoussef Shoaib [MOD]
04/06/2021, 6:44 PMbuild/generated/source
directory I guess but in a way that also works if kotlinc
was called from the command-line with my plugin. I'm seriously hoping that there is a way to do this. It seems as though what kapt
does for example is to just have a hard-coded value based on the gradle project.buildDir, but I'm trying to make this work in the case that gradle is for some reason not there.Justin Tullgren
04/07/2021, 7:49 PMorg.jetbrains.kotlin.name.FqName
in it? I am getting it from kotlin-compiler-embeddable
in version 1.4.30
but not in 1.4.31
This is to use the IrPluginContext
builder methods.Justin Tullgren
04/08/2021, 5:17 PMIrPluginContext#referenceFunctions(FqName)
but the list keeps coming back emptyAbel
04/08/2021, 5:24 PMJustin Tullgren
04/08/2021, 8:26 PMHyugga
04/10/2021, 10:30 PMStrum355
04/11/2021, 10:35 PMcom.sun.tools.javac.code.Symbol
from the javac compiler API. In another project Im working on, we're able to keep a mapping of Symbol to a String and be able to lookup a symbol, be it from a return type declaration, variable type etc and retrieve its String association. What would be the best option in the kotlin compiler API? Im walking the trees of KtFiles via KtTreeVisitorVoid
invoked in analysisCompleted
from an AnalysisHandlerExtension
subclass 🙂vineethraj49
04/12/2021, 3:38 AMpublic T method() throws IllegalArgumentExpression
; the throws part of it is a "reference list" which seems to be in rt.jar of the JDK; how is that resolved?Hyugga
04/12/2021, 4:33 AMlouiscad
04/12/2021, 9:37 PMJan Skrasek
04/15/2021, 2:47 PMClass<*>
to Class<Enum<*>>
and use if in Java function requiring public static <T extends Enum<T>> EnumJsonAdapter<T> create(Class<T> enumType) {
Should I do it somehow differently, or is it a bug?aleksey.tomin
04/16/2021, 4:11 PMplugins {
id("com.android.application")
id("kotlin-android")
id("kotlin-android-extensions")
id("com.google.firebase.crashlytics")
kotlin("kapt")
}
When I build it
./gradlew --info assembleDebug
I have an error (was attached in thread).
How can I fix it? I haven’t found the bug in youtrackAhmed Mourad
04/18/2021, 3:26 AMfun KtClassOrObject.findSuperType(
bindingContext: BindingContext,
fqName: FqName
): KtSuperTypeListEntry? {
return this.superTypeListEntries.firstOrNull { entry ->
bindingContext.get(
BindingContext.TYPE,
entry.typeReference
)?.constructor?.declarationDescriptor?.fqNameSafe == fqName
}
}
It's called inside an AnalysisHandler's analysisCompleted
.
The problem is that bindingContext#get
always returns null, despite entry.typeReference
not being null, but why?Strum355
04/18/2021, 10:26 PMfreeCompilerArgs
but when manually calling kotlinc
with the args, it works fine and the value is properly set?mikehearn
04/20/2021, 11:03 AMJustin Tullgren
04/26/2021, 6:23 PMIrFunctionAccessExpression
value parameter for use in another expression? I keep being told I am creating the const or getter twice when i am modifying a function bodybasher
04/27/2021, 2:16 AMLuoqiaoyou
04/28/2021, 12:57 PM./gradlew runIde
to check my changes, but I don’t know how to debug the breakpoint directly, could anyone please help me solve itandi
04/28/2021, 1:43 PMandi
04/30/2021, 2:07 PMtoString()
calls for the different expression.arguments
(here). The "pre IR" translator had a similar mechanism. However I'm unsure why the pre IR code also added toString
for the other types (Any, Comparable, Number)? At least if I look at the kotlin.js , I can only see Long
and BoxedChar
implementing valueOf
.turansky
05/06/2021, 2:56 PMMiquel Àngel Román
05/06/2021, 9:55 PMJan Skrasek
05/07/2021, 1:34 PMinternal interface I {}
public class Exported {
protected val: I? = null
}
Why I cannot have protected property with internal type in FINAL class?
'protected (in Exported)' property exposes its 'internal' type I
The usecase is a public Fragment/Activity with internal ViewModel. We have this viewmodel property abstract in the fragment's parent -> therefore protected.Jan Skrasek
05/07/2021, 1:34 PMinternal interface I {}
public class Exported {
protected val: I? = null
}
Why I cannot have protected property with internal type in FINAL class?
'protected (in Exported)' property exposes its 'internal' type I
The usecase is a public Fragment/Activity with internal ViewModel. We have this viewmodel property abstract in the fragment's parent -> therefore protected.Endre Deak
05/07/2021, 4:31 PMJan Skrasek
05/07/2021, 5:06 PMEndre Deak
05/07/2021, 5:08 PMinterface I
is internal. But if Exported
is public (and not final), it means that anyone could inherit, which - as the message suggests - leads to expose something internal to the public.Jan Skrasek
05/07/2021, 5:50 PMRoukanken
05/07/2021, 7:12 PMJan Skrasek
05/10/2021, 10:56 AMpublic interface ViewModel {
public fun doSomething()
}
public abstract class BaseActivity {
protected abstract val viewModel: ViewModel
}
internal class FinalViewModel : ViewModel {
override fun doSomething() {}
fun doSomethingElse() {}
}
public class FinalActivity : BaseActivity() {
protected override val viewModel: FinalViewModel = FinalViewModel()
}