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:
@@ -1691,10 +1691,17 @@ public class KotlinExpressionParsing extends AbstractKotlinParsing {
|
|||||||
* IDENTIFIER "@"
|
* IDENTIFIER "@"
|
||||||
*/
|
*/
|
||||||
void parseLabelDefinition() {
|
void parseLabelDefinition() {
|
||||||
|
assert isAtLabelDefinitionOrMissingIdentifier() : "Callers must check that current token is IDENTIFIER followed with '@'";
|
||||||
|
|
||||||
PsiBuilder.Marker labelWrap = mark();
|
PsiBuilder.Marker labelWrap = mark();
|
||||||
PsiBuilder.Marker mark = 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(); // IDENTIFIER
|
||||||
advance(); // AT
|
advance(); // AT
|
||||||
|
|||||||
Reference in New Issue
Block a user