[Parser] Add parsing of function's contract either before or after type constraints
This commit is contained in:
@@ -1671,10 +1671,14 @@ public class KotlinParsing extends AbstractKotlinParsing {
|
||||
parseTypeRef();
|
||||
}
|
||||
|
||||
parseFunctionContract();
|
||||
boolean functionContractOccurred = parseFunctionContract();
|
||||
|
||||
parseTypeConstraintsGuarded(typeParameterListOccurred);
|
||||
|
||||
if (!functionContractOccurred) {
|
||||
parseFunctionContract();
|
||||
}
|
||||
|
||||
if (at(SEMICOLON)) {
|
||||
advance(); // SEMICOLON
|
||||
}
|
||||
@@ -1995,10 +1999,12 @@ public class KotlinParsing extends AbstractKotlinParsing {
|
||||
constraint.done(TYPE_CONSTRAINT);
|
||||
}
|
||||
|
||||
private void parseFunctionContract() {
|
||||
private boolean parseFunctionContract() {
|
||||
if (at(CONTRACT_KEYWORD)) {
|
||||
myExpressionParsing.parseContractDescriptionBlock();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user