KT-51714: Parsing fails for context receivers with incomplete label

^KT-51576 In Progress

No test has been added since it would make indexing of Kotlin project failing
Will add it once bootstrap is advanced
This commit is contained in:
Iven Krall
2022-03-25 16:45:40 +01:00
committed by teamcity
parent 292c0c4383
commit 514fce427b
@@ -1691,10 +1691,17 @@ public class KotlinExpressionParsing extends AbstractKotlinParsing {
* IDENTIFIER "@"
*/
void parseLabelDefinition() {
assert isAtLabelDefinitionOrMissingIdentifier() : "Callers must check that current token is IDENTIFIER followed with '@'";
PsiBuilder.Marker labelWrap = mark();
PsiBuilder.Marker mark = mark();
assert _at(IDENTIFIER) && myBuilder.rawLookup(1) == AT : "Callers must check that current token is IDENTIFIER followed with '@'";
if (at(AT)) {
errorAndAdvance("Expecting identifier before '@' in label definition");
labelWrap.drop();
mark.drop();
return;
}
advance(); // IDENTIFIER
advance(); // AT