(Resolve) lightweight resolve annotations

relates to #KT-38653
This commit is contained in:
Vladimir Ilmov
2020-06-03 14:09:24 +02:00
parent 46ab338ea6
commit 4f1b7b38b2
3 changed files with 10 additions and 5 deletions
@@ -94,7 +94,7 @@ fun KtFile.resolveImportReference(fqName: FqName): Collection<DeclarationDescrip
}
fun KtAnnotationEntry.resolveToDescriptorIfAny(
bodyResolveMode: BodyResolveMode = BodyResolveMode.PARTIAL
bodyResolveMode: BodyResolveMode = BodyResolveMode.PARTIAL_NO_ADDITIONAL
): AnnotationDescriptor? =
resolveToDescriptorIfAny(getResolutionFacade(), bodyResolveMode)
@@ -7,7 +7,7 @@ package org.jetbrains.kotlin.resolve.lazy
import org.jetbrains.kotlin.resolve.BindingTraceFilter
enum class BodyResolveMode(val bindingTraceFilter: BindingTraceFilter, val doControlFlowAnalysis: Boolean) {
enum class BodyResolveMode(val bindingTraceFilter: BindingTraceFilter, val doControlFlowAnalysis: Boolean, val resolveAdditionals: Boolean = true) {
// All body statements are analyzed, diagnostics included
FULL(BindingTraceFilter.ACCEPT_ALL, doControlFlowAnalysis = true),
@@ -21,8 +21,10 @@ enum class BodyResolveMode(val bindingTraceFilter: BindingTraceFilter, val doCon
PARTIAL_WITH_CFA(BindingTraceFilter.NO_DIAGNOSTICS, doControlFlowAnalysis = true),
// Analyzes only dependent statements, including only used declaration statements, does not perform control flow analysis
PARTIAL(BindingTraceFilter.NO_DIAGNOSTICS, doControlFlowAnalysis = false)
PARTIAL(BindingTraceFilter.NO_DIAGNOSTICS, doControlFlowAnalysis = false),
// Resolve mode to resolve only the element itself without the additional elements (annotation resolve would not lead to function resolve or default parameters)
PARTIAL_NO_ADDITIONAL(BindingTraceFilter.NO_DIAGNOSTICS, doControlFlowAnalysis = false, resolveAdditionals = false)
;
fun doesNotLessThan(other: BodyResolveMode): Boolean {