[NI] Fix trace manipulations for builder inference and ::-expressions

For a class literal Type::class we are resolving Type as a constructor,
 getting all diagnostics (about missing arguments, for example) and then
 just not committing this trace with errors

 #KT-37626 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2020-03-24 02:44:00 +03:00
parent 6213680604
commit 38a719cb22
13 changed files with 181 additions and 4 deletions
@@ -38,13 +38,16 @@ abstract class KtDoubleColonExpression(node: ASTNode) : KtExpressionImpl(node) {
val doubleColonTokenReference: PsiElement
get() = findChildByType(KtTokens.COLONCOLON)!!
val lhs: PsiElement?
get() = doubleColonTokenReference.prevSibling
fun setReceiverExpression(newReceiverExpression: KtExpression) {
val oldReceiverExpression = this.receiverExpression
oldReceiverExpression?.replace(newReceiverExpression) ?: addBefore(newReceiverExpression, doubleColonTokenReference)
}
val isEmptyLHS: Boolean
get() = doubleColonTokenReference.prevSibling == null
get() = lhs == null
override fun <R, D> accept(visitor: KtVisitor<R, D>, data: D): R {
return visitor.visitDoubleColonExpression(this, data)