Fix AST/PSI structure for context receivers in function types
Having CONTEXT_RECEIVER_LIST inside FUNCTION_TYPE_RECEIVER looks a bit hacky
This commit is contained in:
@@ -364,7 +364,7 @@ class TypeResolver(
|
||||
|
||||
override fun visitFunctionType(type: KtFunctionType) {
|
||||
val receiverTypeRef = type.receiverTypeReference
|
||||
val receiverType = if (receiverTypeRef?.typeElement == null) null else resolveType(c.noBareTypes(), receiverTypeRef)
|
||||
val receiverType = if (receiverTypeRef == null) null else resolveType(c.noBareTypes(), receiverTypeRef)
|
||||
|
||||
val contextReceiverList = type.contextReceiverList
|
||||
val contextReceiversTypes = if (contextReceiverList != null) {
|
||||
|
||||
@@ -2167,17 +2167,21 @@ public class KotlinParsing extends AbstractKotlinParsing {
|
||||
|
||||
parseTypeModifierList();
|
||||
|
||||
PsiBuilder.Marker typeElementMarker = mark();
|
||||
|
||||
IElementType lookahead = lookahead(1);
|
||||
IElementType lookahead2 = lookahead(2);
|
||||
boolean typeBeforeDot = true;
|
||||
boolean withContextReceiver = at(CONTEXT_KEYWORD) && lookahead == LPAR;
|
||||
boolean wasFunctionTypeParsed = false;
|
||||
|
||||
PsiBuilder.Marker contextReceiversStart = mark();
|
||||
|
||||
if (withContextReceiver) {
|
||||
parseContextReceiverList();
|
||||
}
|
||||
|
||||
PsiBuilder.Marker typeElementMarker = mark();
|
||||
|
||||
if (at(IDENTIFIER) && !(lookahead == DOT && lookahead2 == IDENTIFIER) && lookahead != LT && at(DYNAMIC_KEYWORD)) {
|
||||
PsiBuilder.Marker dynamicType = mark();
|
||||
advance(); // DYNAMIC_KEYWORD
|
||||
@@ -2186,26 +2190,18 @@ public class KotlinParsing extends AbstractKotlinParsing {
|
||||
else if (at(IDENTIFIER) || at(PACKAGE_KEYWORD) || atParenthesizedMutableForPlatformTypes(0)) {
|
||||
parseUserType(allowSimpleIntersectionTypes);
|
||||
}
|
||||
else if (at(LPAR) && !withContextReceiver) {
|
||||
else if (at(LPAR)) {
|
||||
PsiBuilder.Marker functionOrParenthesizedType = mark();
|
||||
|
||||
// This may be a function parameter list or just a parenthesized type
|
||||
advance(); // LPAR
|
||||
parseTypeRefContents(TokenSet.EMPTY, /* allowSimpleIntersectionTypes */ true).drop(); // parenthesized types, no reference element around it is needed
|
||||
|
||||
if (at(RPAR)) {
|
||||
advance(); // RPAR
|
||||
if (at(ARROW)) {
|
||||
// It's a function type with one parameter specified
|
||||
// (A) -> B
|
||||
functionOrParenthesizedType.rollbackTo();
|
||||
parseFunctionType();
|
||||
}
|
||||
else {
|
||||
// It's a parenthesized type
|
||||
// (A)
|
||||
functionOrParenthesizedType.drop();
|
||||
}
|
||||
if (at(RPAR) && lookahead(1) != ARROW) {
|
||||
// It's a parenthesized type
|
||||
// (A)
|
||||
advance();
|
||||
functionOrParenthesizedType.drop();
|
||||
}
|
||||
else {
|
||||
// This must be a function type
|
||||
@@ -2213,11 +2209,11 @@ public class KotlinParsing extends AbstractKotlinParsing {
|
||||
// or
|
||||
// (a : A) -> C
|
||||
functionOrParenthesizedType.rollbackTo();
|
||||
parseFunctionType();
|
||||
parseFunctionType(contextReceiversStart.precede());
|
||||
wasFunctionTypeParsed = true;
|
||||
}
|
||||
|
||||
}
|
||||
else if (!withContextReceiver) {
|
||||
else {
|
||||
errorWithRecovery("Type expected",
|
||||
TokenSet.orSet(TOP_LEVEL_DECLARATION_FIRST,
|
||||
TokenSet.create(EQ, COMMA, GT, RBRACKET, DOT, RPAR, RBRACE, LBRACE, SEMICOLON),
|
||||
@@ -2246,36 +2242,40 @@ public class KotlinParsing extends AbstractKotlinParsing {
|
||||
intersectionType.done(INTERSECTION_TYPE);
|
||||
wasIntersection = true;
|
||||
}
|
||||
boolean withExtensionReceiver = typeBeforeDot && at(DOT);
|
||||
|
||||
|
||||
if (withExtensionReceiver && !wasIntersection || withContextReceiver) {
|
||||
if (typeBeforeDot && at(DOT) && !wasIntersection) {
|
||||
// This is a receiver for a function type
|
||||
// A.(B) -> C
|
||||
// ^
|
||||
|
||||
PsiBuilder.Marker functionType = typeElementMarker.precede();
|
||||
PsiBuilder.Marker functionType = contextReceiversStart.precede();
|
||||
|
||||
PsiBuilder.Marker receiverTypeRef = typeElementMarker.precede();
|
||||
PsiBuilder.Marker receiverType = receiverTypeRef.precede();
|
||||
receiverTypeRef.done(TYPE_REFERENCE);
|
||||
receiverType.done(FUNCTION_TYPE_RECEIVER);
|
||||
|
||||
if (withExtensionReceiver) {
|
||||
advance(); // DOT
|
||||
}
|
||||
advance(); // DOT
|
||||
|
||||
if (at(LPAR)) {
|
||||
parseFunctionTypeContents().drop();
|
||||
parseFunctionType(functionType);
|
||||
}
|
||||
else {
|
||||
error("Expecting function type");
|
||||
}
|
||||
|
||||
functionType.done(FUNCTION_TYPE);
|
||||
wasFunctionTypeParsed = true;
|
||||
}
|
||||
|
||||
if (withContextReceiver && !wasFunctionTypeParsed) {
|
||||
errorWithRecovery("Function type expected expected",
|
||||
TokenSet.orSet(TOP_LEVEL_DECLARATION_FIRST,
|
||||
TokenSet.create(EQ, COMMA, GT, RBRACKET, DOT, RPAR, RBRACE, LBRACE, SEMICOLON),
|
||||
extraRecoverySet));
|
||||
}
|
||||
|
||||
typeElementMarker.drop();
|
||||
contextReceiversStart.drop();
|
||||
return typeRefMarker;
|
||||
}
|
||||
|
||||
@@ -2448,13 +2448,12 @@ public class KotlinParsing extends AbstractKotlinParsing {
|
||||
* : (type ".")? "(" parameter{","}? ")" "->" type?
|
||||
* ;
|
||||
*/
|
||||
private void parseFunctionType() {
|
||||
parseFunctionTypeContents().done(FUNCTION_TYPE);
|
||||
private void parseFunctionType(PsiBuilder.Marker functionType) {
|
||||
parseFunctionTypeContents(functionType).done(FUNCTION_TYPE);
|
||||
}
|
||||
|
||||
private PsiBuilder.Marker parseFunctionTypeContents() {
|
||||
private PsiBuilder.Marker parseFunctionTypeContents(PsiBuilder.Marker functionType) {
|
||||
assert _at(LPAR) : tt();
|
||||
PsiBuilder.Marker functionType = mark();
|
||||
|
||||
parseValueParameterList(true, /* typeRequired = */ true, TokenSet.EMPTY);
|
||||
|
||||
|
||||
@@ -95,12 +95,7 @@ public class KtFunctionType extends KtElementImplStub<KotlinPlaceHolderStub<KtFu
|
||||
|
||||
@Nullable
|
||||
public KtContextReceiverList getContextReceiverList() {
|
||||
KtFunctionTypeReceiver receiverDeclaration = getReceiver();
|
||||
if (receiverDeclaration == null) {
|
||||
return null;
|
||||
}
|
||||
KtTypeReference receiverTypeRef = receiverDeclaration.getTypeReference();
|
||||
return receiverTypeRef.getStubOrPsiChild(KtStubElementTypes.CONTEXT_RECEIVER_LIST);
|
||||
return getStubOrPsiChild(KtStubElementTypes.CONTEXT_RECEIVER_LIST);
|
||||
}
|
||||
|
||||
public List<KtTypeReference> getContextReceiversTypeReferences() {
|
||||
|
||||
+253
-261
@@ -236,24 +236,22 @@ KtFile: FunctionTypes.kt
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
FUNCTION_TYPE
|
||||
FUNCTION_TYPE_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
CONTEXT_RECEIVER_LIST
|
||||
PsiElement(context)('context')
|
||||
PsiElement(LPAR)('(')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('X')
|
||||
PsiElement(RPAR)(')')
|
||||
CONTEXT_RECEIVER_LIST
|
||||
PsiElement(context)('context')
|
||||
PsiElement(LPAR)('(')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('X')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
@@ -296,24 +294,22 @@ KtFile: FunctionTypes.kt
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
FUNCTION_TYPE
|
||||
FUNCTION_TYPE_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
CONTEXT_RECEIVER_LIST
|
||||
PsiElement(context)('context')
|
||||
PsiElement(LPAR)('(')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('X')
|
||||
PsiElement(RPAR)(')')
|
||||
CONTEXT_RECEIVER_LIST
|
||||
PsiElement(context)('context')
|
||||
PsiElement(LPAR)('(')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('X')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
@@ -344,24 +340,22 @@ KtFile: FunctionTypes.kt
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
FUNCTION_TYPE
|
||||
FUNCTION_TYPE_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
CONTEXT_RECEIVER_LIST
|
||||
PsiElement(context)('context')
|
||||
PsiElement(LPAR)('(')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('X')
|
||||
PsiElement(RPAR)(')')
|
||||
CONTEXT_RECEIVER_LIST
|
||||
PsiElement(context)('context')
|
||||
PsiElement(LPAR)('(')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('X')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
@@ -383,24 +377,22 @@ KtFile: FunctionTypes.kt
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
FUNCTION_TYPE
|
||||
FUNCTION_TYPE_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
CONTEXT_RECEIVER_LIST
|
||||
PsiElement(context)('context')
|
||||
PsiElement(LPAR)('(')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('X')
|
||||
PsiElement(RPAR)(')')
|
||||
CONTEXT_RECEIVER_LIST
|
||||
PsiElement(context)('context')
|
||||
PsiElement(LPAR)('(')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('X')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
@@ -732,18 +724,18 @@ KtFile: FunctionTypes.kt
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
FUNCTION_TYPE
|
||||
CONTEXT_RECEIVER_LIST
|
||||
PsiElement(context)('context')
|
||||
PsiElement(LPAR)('(')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
FUNCTION_TYPE_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
CONTEXT_RECEIVER_LIST
|
||||
PsiElement(context)('context')
|
||||
PsiElement(LPAR)('(')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
@@ -768,33 +760,33 @@ KtFile: FunctionTypes.kt
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
FUNCTION_TYPE
|
||||
CONTEXT_RECEIVER_LIST
|
||||
PsiElement(context)('context')
|
||||
PsiElement(LPAR)('(')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
FUNCTION_TYPE_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
CONTEXT_RECEIVER_LIST
|
||||
PsiElement(context)('context')
|
||||
PsiElement(LPAR)('(')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
@@ -823,67 +815,67 @@ KtFile: FunctionTypes.kt
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
FUNCTION_TYPE
|
||||
CONTEXT_RECEIVER_LIST
|
||||
PsiElement(context)('context')
|
||||
PsiElement(LPAR)('(')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('A')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('B')
|
||||
PsiElement(GT)('>')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('A')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('B')
|
||||
PsiElement(GT)('>')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiElement(GT)('>')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
FUNCTION_TYPE_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
CONTEXT_RECEIVER_LIST
|
||||
PsiElement(context)('context')
|
||||
PsiElement(LPAR)('(')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('A')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('B')
|
||||
PsiElement(GT)('>')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('A')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('B')
|
||||
PsiElement(GT)('>')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiElement(GT)('>')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
@@ -947,18 +939,18 @@ KtFile: FunctionTypes.kt
|
||||
PsiElement(RBRACKET)(']')
|
||||
PsiWhiteSpace(' ')
|
||||
FUNCTION_TYPE
|
||||
CONTEXT_RECEIVER_LIST
|
||||
PsiElement(context)('context')
|
||||
PsiElement(LPAR)('(')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
FUNCTION_TYPE_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
CONTEXT_RECEIVER_LIST
|
||||
PsiElement(context)('context')
|
||||
PsiElement(LPAR)('(')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
@@ -995,33 +987,33 @@ KtFile: FunctionTypes.kt
|
||||
PsiElement(RBRACKET)(']')
|
||||
PsiWhiteSpace(' ')
|
||||
FUNCTION_TYPE
|
||||
CONTEXT_RECEIVER_LIST
|
||||
PsiElement(context)('context')
|
||||
PsiElement(LPAR)('(')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
FUNCTION_TYPE_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
CONTEXT_RECEIVER_LIST
|
||||
PsiElement(context)('context')
|
||||
PsiElement(LPAR)('(')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
@@ -1062,67 +1054,67 @@ KtFile: FunctionTypes.kt
|
||||
PsiElement(RBRACKET)(']')
|
||||
PsiWhiteSpace(' ')
|
||||
FUNCTION_TYPE
|
||||
CONTEXT_RECEIVER_LIST
|
||||
PsiElement(context)('context')
|
||||
PsiElement(LPAR)('(')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('A')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('B')
|
||||
PsiElement(GT)('>')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('A')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('B')
|
||||
PsiElement(GT)('>')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiElement(GT)('>')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
FUNCTION_TYPE_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
CONTEXT_RECEIVER_LIST
|
||||
PsiElement(context)('context')
|
||||
PsiElement(LPAR)('(')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('A')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('B')
|
||||
PsiElement(GT)('>')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
CONTEXT_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('A')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('B')
|
||||
PsiElement(GT)('>')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiElement(GT)('>')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
@@ -1190,4 +1182,4 @@ KtFile: FunctionTypes.kt
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
|
||||
Reference in New Issue
Block a user