Inspection & fix for redundant supertype qualification

This commit is contained in:
Valentin Kipyatkov
2015-08-26 15:05:10 +03:00
parent d62eeb1c25
commit 4717b17418
30 changed files with 531 additions and 2 deletions
@@ -23,8 +23,10 @@ import org.jetbrains.kotlin.name.Name
open public class JetExpressionWithLabel(node: ASTNode) : JetExpressionImpl(node) {
public fun getTargetLabel(): JetSimpleNameExpression? =
findChildByType<JetContainerNode>(JetNodeTypes.LABEL_QUALIFIER)?.
findChildByType(JetNodeTypes.LABEL) as? JetSimpleNameExpression
labelQualifier?.findChildByType(JetNodeTypes.LABEL) as? JetSimpleNameExpression
public val labelQualifier: JetContainerNode?
get() = findChildByType(JetNodeTypes.LABEL_QUALIFIER)
public fun getLabelName(): String? = getTargetLabel()?.getReferencedName()
public fun getLabelNameAsName(): Name? = getTargetLabel()?.getReferencedNameAsName()
@@ -494,6 +494,10 @@ public class JetPsiUtil {
return JetExpressionParsing.Precedence.ASSIGNMENT.ordinal();
}
if (expression instanceof JetSuperExpression) {
return maxPriority;
}
if (expression instanceof JetDeclaration || expression instanceof JetStatementExpression) {
return 0;
}