The Analysis phase determines if the parsed AST type checks and resolves properly.
As part of this phase, we have access to events happening before and after resolution.
Before resolution, we are given the chance to modify the compiler trees in the form of
the Quote Template System.
|additionalSources||additionalSources is a function that is invoked before resolution and allows us to provide an additional set of KtFile files. These files will be considered part of the compilation unit alongside the user sources.
|analysis||The analysis function allows us to intercept analysis before and after it happens, altering the analysis inputs and outputs. Altering the inputs on @doAnalysis allows us to modify the compiler trees in the AST before they are considered for resolution. This allows us to build the Quote in this phase, which is Arrow Meta’s higher level API. Altering the output with analysisCompleted allows us to modify the binding trace and all elements resulting from analysis.
|extraImports||The extraImports function allows the user to provide an additional set of org.jetbrains.kotlin.psi.KtImportInfo imports for each individual KtFile considered as sources. This additional set of imports are taken into account when resolving symbols in the resolution phase of a KtFile.
|suppressDiagnostic||The suppressDiagnostic function allows selectively determining whether a diagnostic emitted by the compiler affects compilation. As the compiler performs resolution, it will generate diagnostic of type Diagnostic with different Severity levels: Severity.INFO, Severity.ERROR, and Severity.WARNING. When the suppressDiagnostic returns true, the emitted diagnostic is suppressed and removed from the BindingTrace. This will cause the Diagnostic to not be considered in further compilation phases.
Do you like Arrow?✖