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