[KAPT] Some optimizations for stubs generation

* Add index to resolve compiled class by name
* Disable full property resolution
This commit is contained in:
Andrey Zinovyev
2021-03-03 12:05:49 +03:00
committed by GitHub
parent 08446e2371
commit b128577508
10 changed files with 99 additions and 10 deletions
@@ -85,7 +85,12 @@ open class PartialAnalysisHandlerExtension : AnalysisHandlerExtension {
if (declaration is KtProperty) {
/* TODO Now we analyse body with anonymous object initializers. Check if we can't avoid it
* val a: Runnable = object : Runnable { ... } */
bodyResolver.resolveProperty(topDownAnalysisContext, declaration, descriptor)
//resolve property in case it has delegate expression or explicit accessor, otherwise just infer type
if (declaration.delegateExpression != null || declaration.accessors.isNotEmpty()) {
bodyResolver.resolveProperty(topDownAnalysisContext, declaration, descriptor)
} else {
BodyResolver.computeDeferredType(descriptor.returnType)
}
}
}
is FunctionDescriptor -> {
@@ -138,4 +143,4 @@ open class PartialAnalysisHandlerExtension : AnalysisHandlerExtension {
}
}
}
}