JetTypeConstraint#getStubTypeParameterName() and isClassObjectConstraint() by stub

This commit is contained in:
Pavel V. Talanov
2014-04-07 19:37:56 +04:00
parent cbbcb861bb
commit 31bebf924a
@@ -41,13 +41,17 @@ public class JetTypeConstraint extends JetElementImplStub<PsiJetTypeConstraintSt
}
public boolean isClassObjectConstraint() {
PsiJetTypeConstraintStub stub = getStub();
if (stub != null) {
return stub.isClassObjectConstraint();
}
return findChildByType(JetTokens.CLASS_KEYWORD) != null &&
findChildByType(JetTokens.OBJECT_KEYWORD) != null;
}
@Nullable @IfNotParsed
public JetSimpleNameExpression getSubjectTypeParameterName() {
return (JetSimpleNameExpression) findChildByType(JetNodeTypes.REFERENCE_EXPRESSION);
return getStubOrPsiChild(JetStubElementTypes.REFERENCE_EXPRESSION);
}
@Nullable @IfNotParsed