Parse type arguments after callable reference as error

Is likely to be supported in the future
This commit is contained in:
Alexander Udalov
2015-10-15 12:15:27 +03:00
parent 32a9bddbf9
commit 66417ed329
4 changed files with 104 additions and 2 deletions
@@ -370,7 +370,7 @@ public class JetExpressionParsing extends AbstractJetParsing {
/*
* callableReference
* : (userType "?"*)? "::" SimpleName
* : (userType "?"*)? "::" SimpleName typeArguments?
* ;
*/
private boolean parseDoubleColonExpression() {
@@ -396,6 +396,17 @@ public class JetExpressionParsing extends AbstractJetParsing {
}
else {
parseSimpleNameExpression();
if (at(LT)) {
PsiBuilder.Marker typeArgumentList = mark();
if (myJetParsing.tryParseTypeArgumentList(TYPE_ARGUMENT_LIST_STOPPERS)) {
typeArgumentList.error("Type arguments are not allowed");
}
else {
typeArgumentList.rollbackTo();
}
}
expression.done(CALLABLE_REFERENCE_EXPRESSION);
}