KT-15677 KT-15775

Update parser & descriptor renderer to handle parenthesized types and function types properly.
Resolve annotations in parenthesized types.

AnnotationsImpl.isEmpty() returned false for targeted annotations only
(e.g., 'fun @receiver:Ann C?.foo()').
Properly keep track of targeted annotations.
This commit is contained in:
Dmitry Petrov
2017-01-13 16:29:40 +03:00
parent a429992e81
commit b9f9894310
45 changed files with 2094 additions and 67 deletions
@@ -23,6 +23,7 @@ import org.jetbrains.kotlin.ir.expressions.*
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
import org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid
import org.jetbrains.kotlin.ir.visitors.acceptChildrenVoid
import org.jetbrains.kotlin.renderer.AnnotationArgumentsRenderingPolicy
import org.jetbrains.kotlin.renderer.DescriptorRenderer
import org.jetbrains.kotlin.utils.Printer
@@ -45,7 +46,7 @@ class DumpIrTreeVisitor(out: Appendable): IrElementVisitor<Unit, String> {
companion object {
val ANNOTATIONS_RENDERER = DescriptorRenderer.withOptions {
verbose = true
includeAnnotationArguments = true
annotationArgumentsRenderingPolicy = AnnotationArgumentsRenderingPolicy.UNLESS_EMPTY
}
}