PsiElement for receiver declaration in a function type
This fixes the following assertion:
EA-37795 - assert: DescriptorResolver.checkBounds
java.lang.AssertionError: (
public val categoryName: String,
public val defaultReoccurrenceRate: DateReoccurrence,
datesCollection: Collection<Date>) {
at org.jetbrains.jet.lang.resolve.DescriptorResolver.checkBounds(DescriptorResolver.java:1137)
at org.jetbrains.jet.lang.resolve.TypeHierarchyResolver.checkTypesInClassHeaders(TypeHierarchyResolver.java:447)
at org.jetbrains.jet.lang.resolve.TypeHierarchyResolver.process(TypeHierarchyResolver.java:154)
at org.jetbrains.jet.lang.resolve.TopDownAnalyzer.doProcess(TopDownAnalyzer.java:125)
Caused by misbehavior of the JetFunctionType class
This commit is contained in:
@@ -75,6 +75,7 @@ public interface JetNodeTypes {
|
|||||||
@Deprecated // Tuples are to be removed in Kotlin M4
|
@Deprecated // Tuples are to be removed in Kotlin M4
|
||||||
JetNodeType TUPLE_TYPE = new JetNodeType("TUPLE_TYPE", JetTupleType.class);
|
JetNodeType TUPLE_TYPE = new JetNodeType("TUPLE_TYPE", JetTupleType.class);
|
||||||
JetNodeType FUNCTION_TYPE = new JetNodeType("FUNCTION_TYPE", JetFunctionType.class);
|
JetNodeType FUNCTION_TYPE = new JetNodeType("FUNCTION_TYPE", JetFunctionType.class);
|
||||||
|
JetNodeType FUNCTION_TYPE_RECEIVER = new JetNodeType("FUNCTION_TYPE_RECEIVER", JetFunctionTypeReceiver.class);
|
||||||
JetNodeType SELF_TYPE = new JetNodeType("SELF_TYPE", JetSelfType.class);
|
JetNodeType SELF_TYPE = new JetNodeType("SELF_TYPE", JetSelfType.class);
|
||||||
JetNodeType NULLABLE_TYPE = new JetNodeType("NULLABLE_TYPE", JetNullableType.class);
|
JetNodeType NULLABLE_TYPE = new JetNodeType("NULLABLE_TYPE", JetNullableType.class);
|
||||||
JetNodeType TYPE_PROJECTION = new JetNodeType("TYPE_PROJECTION", JetTypeProjection.class);
|
JetNodeType TYPE_PROJECTION = new JetNodeType("TYPE_PROJECTION", JetTypeProjection.class);
|
||||||
|
|||||||
@@ -1428,8 +1428,10 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
// A.(B) -> C
|
// A.(B) -> C
|
||||||
// ^
|
// ^
|
||||||
|
|
||||||
PsiBuilder.Marker precede = typeRefMarker.precede();
|
PsiBuilder.Marker functionType = typeRefMarker.precede();
|
||||||
|
PsiBuilder.Marker receiverType = typeRefMarker.precede();
|
||||||
typeRefMarker.done(TYPE_REFERENCE);
|
typeRefMarker.done(TYPE_REFERENCE);
|
||||||
|
receiverType.done(FUNCTION_TYPE_RECEIVER);
|
||||||
|
|
||||||
advance(); // DOT
|
advance(); // DOT
|
||||||
|
|
||||||
@@ -1439,9 +1441,9 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
else {
|
else {
|
||||||
error("Expecting function type");
|
error("Expecting function type");
|
||||||
}
|
}
|
||||||
typeRefMarker = precede.precede();
|
typeRefMarker = functionType.precede();
|
||||||
|
|
||||||
precede.done(FUNCTION_TYPE);
|
functionType.done(FUNCTION_TYPE);
|
||||||
}
|
}
|
||||||
// myBuilder.restoreJoiningComplexTokensState();
|
// myBuilder.restoreJoiningComplexTokensState();
|
||||||
return typeRefMarker;
|
return typeRefMarker;
|
||||||
@@ -1607,7 +1609,7 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* functionType
|
* functionType
|
||||||
* : (type ".")? "(" (parameter | modifiers type){","}? ")" "->" type?
|
* : "(" (parameter | modifiers type){","}? ")" "->" type?
|
||||||
* ;
|
* ;
|
||||||
*/
|
*/
|
||||||
private void parseFunctionType() {
|
private void parseFunctionType() {
|
||||||
|
|||||||
@@ -18,8 +18,6 @@ package org.jetbrains.jet.lang.psi;
|
|||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.intellij.lang.ASTNode;
|
import com.intellij.lang.ASTNode;
|
||||||
import com.intellij.psi.PsiElement;
|
|
||||||
import com.intellij.psi.tree.IElementType;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.jetbrains.jet.JetNodeTypes;
|
import org.jetbrains.jet.JetNodeTypes;
|
||||||
@@ -82,34 +80,15 @@ public class JetFunctionType extends JetTypeElement {
|
|||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public JetTypeReference getReceiverTypeRef() {
|
public JetTypeReference getReceiverTypeRef() {
|
||||||
PsiElement child = getFirstChild();
|
JetFunctionTypeReceiver receiverDeclaration = (JetFunctionTypeReceiver) findChildByType(JetNodeTypes.FUNCTION_TYPE_RECEIVER);
|
||||||
while (child != null) {
|
if (receiverDeclaration == null) {
|
||||||
IElementType tt = child.getNode().getElementType();
|
return null;
|
||||||
if (tt == JetTokens.LPAR || tt == RETURN_TYPE_SEPARATOR) break;
|
|
||||||
if (child instanceof JetTypeReference) {
|
|
||||||
return (JetTypeReference) child;
|
|
||||||
}
|
|
||||||
child = child.getNextSibling();
|
|
||||||
}
|
}
|
||||||
|
return receiverDeclaration.getTypeReference();
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public JetTypeReference getReturnTypeRef() {
|
public JetTypeReference getReturnTypeRef() {
|
||||||
boolean colonPassed = false;
|
return (JetTypeReference) findChildByType(JetNodeTypes.TYPE_REFERENCE);
|
||||||
PsiElement child = getFirstChild();
|
|
||||||
while (child != null) {
|
|
||||||
IElementType tt = child.getNode().getElementType();
|
|
||||||
if (tt == RETURN_TYPE_SEPARATOR) {
|
|
||||||
colonPassed = true;
|
|
||||||
}
|
|
||||||
if (colonPassed && child instanceof JetTypeReference) {
|
|
||||||
return (JetTypeReference) child;
|
|
||||||
}
|
|
||||||
child = child.getNextSibling();
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2012 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.jet.lang.psi;
|
||||||
|
|
||||||
|
import com.intellij.lang.ASTNode;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.jet.JetNodeTypes;
|
||||||
|
|
||||||
|
public class JetFunctionTypeReceiver extends JetElementImpl {
|
||||||
|
public JetFunctionTypeReceiver(@NotNull ASTNode node) {
|
||||||
|
super(node);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public JetTypeReference getTypeReference() {
|
||||||
|
return (JetTypeReference) findChildByType(JetNodeTypes.TYPE_REFERENCE);
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
class <!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>A<!> : (categoryName: <!SYNTAX!><!>) <!SYNTAX!>{<!SYNTAX!><!><!>
|
||||||
@@ -459,42 +459,11 @@ JetFile: FunctionTypes.jet
|
|||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
TYPE_REFERENCE
|
TYPE_REFERENCE
|
||||||
FUNCTION_TYPE
|
FUNCTION_TYPE
|
||||||
TYPE_REFERENCE
|
FUNCTION_TYPE_RECEIVER
|
||||||
USER_TYPE
|
TYPE_REFERENCE
|
||||||
REFERENCE_EXPRESSION
|
|
||||||
PsiElement(IDENTIFIER)('T')
|
|
||||||
PsiElement(DOT)('.')
|
|
||||||
VALUE_PARAMETER_LIST
|
|
||||||
PsiElement(LPAR)('(')
|
|
||||||
PsiElement(RPAR)(')')
|
|
||||||
PsiWhiteSpace(' ')
|
|
||||||
PsiElement(ARROW)('->')
|
|
||||||
PsiWhiteSpace(' ')
|
|
||||||
TYPE_REFERENCE
|
|
||||||
TUPLE_TYPE
|
|
||||||
PsiElement(HASH)('#')
|
|
||||||
PsiElement(LPAR)('(')
|
|
||||||
PsiElement(RPAR)(')')
|
|
||||||
PsiWhiteSpace('\n')
|
|
||||||
TYPEDEF
|
|
||||||
PsiElement(type)('type')
|
|
||||||
PsiWhiteSpace(' ')
|
|
||||||
PsiElement(IDENTIFIER)('f')
|
|
||||||
PsiWhiteSpace(' ')
|
|
||||||
TYPE_PARAMETER_LIST
|
|
||||||
<empty list>
|
|
||||||
PsiElement(EQ)('=')
|
|
||||||
PsiWhiteSpace(' ')
|
|
||||||
TYPE_REFERENCE
|
|
||||||
FUNCTION_TYPE
|
|
||||||
TYPE_REFERENCE
|
|
||||||
USER_TYPE
|
|
||||||
USER_TYPE
|
USER_TYPE
|
||||||
REFERENCE_EXPRESSION
|
REFERENCE_EXPRESSION
|
||||||
PsiElement(IDENTIFIER)('T')
|
PsiElement(IDENTIFIER)('T')
|
||||||
PsiElement(DOT)('.')
|
|
||||||
REFERENCE_EXPRESSION
|
|
||||||
PsiElement(IDENTIFIER)('T')
|
|
||||||
PsiElement(DOT)('.')
|
PsiElement(DOT)('.')
|
||||||
VALUE_PARAMETER_LIST
|
VALUE_PARAMETER_LIST
|
||||||
PsiElement(LPAR)('(')
|
PsiElement(LPAR)('(')
|
||||||
@@ -519,9 +488,61 @@ JetFile: FunctionTypes.jet
|
|||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
TYPE_REFERENCE
|
TYPE_REFERENCE
|
||||||
FUNCTION_TYPE
|
FUNCTION_TYPE
|
||||||
TYPE_REFERENCE
|
FUNCTION_TYPE_RECEIVER
|
||||||
USER_TYPE
|
TYPE_REFERENCE
|
||||||
USER_TYPE
|
USER_TYPE
|
||||||
|
USER_TYPE
|
||||||
|
REFERENCE_EXPRESSION
|
||||||
|
PsiElement(IDENTIFIER)('T')
|
||||||
|
PsiElement(DOT)('.')
|
||||||
|
REFERENCE_EXPRESSION
|
||||||
|
PsiElement(IDENTIFIER)('T')
|
||||||
|
PsiElement(DOT)('.')
|
||||||
|
VALUE_PARAMETER_LIST
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(ARROW)('->')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
TYPE_REFERENCE
|
||||||
|
TUPLE_TYPE
|
||||||
|
PsiElement(HASH)('#')
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
PsiWhiteSpace('\n')
|
||||||
|
TYPEDEF
|
||||||
|
PsiElement(type)('type')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(IDENTIFIER)('f')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
TYPE_PARAMETER_LIST
|
||||||
|
<empty list>
|
||||||
|
PsiElement(EQ)('=')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
TYPE_REFERENCE
|
||||||
|
FUNCTION_TYPE
|
||||||
|
FUNCTION_TYPE_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
|
REFERENCE_EXPRESSION
|
||||||
PsiElement(IDENTIFIER)('T')
|
PsiElement(IDENTIFIER)('T')
|
||||||
TYPE_ARGUMENT_LIST
|
TYPE_ARGUMENT_LIST
|
||||||
@@ -530,26 +551,8 @@ JetFile: FunctionTypes.jet
|
|||||||
TYPE_REFERENCE
|
TYPE_REFERENCE
|
||||||
USER_TYPE
|
USER_TYPE
|
||||||
REFERENCE_EXPRESSION
|
REFERENCE_EXPRESSION
|
||||||
PsiElement(IDENTIFIER)('A')
|
PsiElement(IDENTIFIER)('x')
|
||||||
PsiElement(COMMA)(',')
|
|
||||||
PsiWhiteSpace(' ')
|
|
||||||
TYPE_PROJECTION
|
|
||||||
TYPE_REFERENCE
|
|
||||||
USER_TYPE
|
|
||||||
REFERENCE_EXPRESSION
|
|
||||||
PsiElement(IDENTIFIER)('B')
|
|
||||||
PsiElement(GT)('>')
|
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(DOT)('.')
|
PsiElement(DOT)('.')
|
||||||
VALUE_PARAMETER_LIST
|
VALUE_PARAMETER_LIST
|
||||||
PsiElement(LPAR)('(')
|
PsiElement(LPAR)('(')
|
||||||
@@ -574,62 +577,21 @@ JetFile: FunctionTypes.jet
|
|||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
TYPE_REFERENCE
|
TYPE_REFERENCE
|
||||||
FUNCTION_TYPE
|
FUNCTION_TYPE
|
||||||
TYPE_REFERENCE
|
FUNCTION_TYPE_RECEIVER
|
||||||
ANNOTATION
|
TYPE_REFERENCE
|
||||||
PsiElement(LBRACKET)('[')
|
ANNOTATION
|
||||||
ANNOTATION_ENTRY
|
PsiElement(LBRACKET)('[')
|
||||||
CONSTRUCTOR_CALLEE
|
ANNOTATION_ENTRY
|
||||||
TYPE_REFERENCE
|
CONSTRUCTOR_CALLEE
|
||||||
USER_TYPE
|
TYPE_REFERENCE
|
||||||
REFERENCE_EXPRESSION
|
USER_TYPE
|
||||||
PsiElement(IDENTIFIER)('a')
|
REFERENCE_EXPRESSION
|
||||||
PsiElement(RBRACKET)(']')
|
PsiElement(IDENTIFIER)('a')
|
||||||
PsiWhiteSpace(' ')
|
PsiElement(RBRACKET)(']')
|
||||||
USER_TYPE
|
PsiWhiteSpace(' ')
|
||||||
REFERENCE_EXPRESSION
|
|
||||||
PsiElement(IDENTIFIER)('T')
|
|
||||||
PsiElement(DOT)('.')
|
|
||||||
VALUE_PARAMETER_LIST
|
|
||||||
PsiElement(LPAR)('(')
|
|
||||||
PsiElement(RPAR)(')')
|
|
||||||
PsiWhiteSpace(' ')
|
|
||||||
PsiElement(ARROW)('->')
|
|
||||||
PsiWhiteSpace(' ')
|
|
||||||
TYPE_REFERENCE
|
|
||||||
TUPLE_TYPE
|
|
||||||
PsiElement(HASH)('#')
|
|
||||||
PsiElement(LPAR)('(')
|
|
||||||
PsiElement(RPAR)(')')
|
|
||||||
PsiWhiteSpace('\n')
|
|
||||||
TYPEDEF
|
|
||||||
PsiElement(type)('type')
|
|
||||||
PsiWhiteSpace(' ')
|
|
||||||
PsiElement(IDENTIFIER)('f')
|
|
||||||
PsiWhiteSpace(' ')
|
|
||||||
TYPE_PARAMETER_LIST
|
|
||||||
<empty list>
|
|
||||||
PsiElement(EQ)('=')
|
|
||||||
PsiWhiteSpace(' ')
|
|
||||||
TYPE_REFERENCE
|
|
||||||
FUNCTION_TYPE
|
|
||||||
TYPE_REFERENCE
|
|
||||||
ANNOTATION
|
|
||||||
PsiElement(LBRACKET)('[')
|
|
||||||
ANNOTATION_ENTRY
|
|
||||||
CONSTRUCTOR_CALLEE
|
|
||||||
TYPE_REFERENCE
|
|
||||||
USER_TYPE
|
|
||||||
REFERENCE_EXPRESSION
|
|
||||||
PsiElement(IDENTIFIER)('a')
|
|
||||||
PsiElement(RBRACKET)(']')
|
|
||||||
PsiWhiteSpace(' ')
|
|
||||||
USER_TYPE
|
|
||||||
USER_TYPE
|
USER_TYPE
|
||||||
REFERENCE_EXPRESSION
|
REFERENCE_EXPRESSION
|
||||||
PsiElement(IDENTIFIER)('T')
|
PsiElement(IDENTIFIER)('T')
|
||||||
PsiElement(DOT)('.')
|
|
||||||
REFERENCE_EXPRESSION
|
|
||||||
PsiElement(IDENTIFIER)('T')
|
|
||||||
PsiElement(DOT)('.')
|
PsiElement(DOT)('.')
|
||||||
VALUE_PARAMETER_LIST
|
VALUE_PARAMETER_LIST
|
||||||
PsiElement(LPAR)('(')
|
PsiElement(LPAR)('(')
|
||||||
@@ -654,19 +616,81 @@ JetFile: FunctionTypes.jet
|
|||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
TYPE_REFERENCE
|
TYPE_REFERENCE
|
||||||
FUNCTION_TYPE
|
FUNCTION_TYPE
|
||||||
TYPE_REFERENCE
|
FUNCTION_TYPE_RECEIVER
|
||||||
ANNOTATION
|
TYPE_REFERENCE
|
||||||
PsiElement(LBRACKET)('[')
|
ANNOTATION
|
||||||
ANNOTATION_ENTRY
|
PsiElement(LBRACKET)('[')
|
||||||
CONSTRUCTOR_CALLEE
|
ANNOTATION_ENTRY
|
||||||
TYPE_REFERENCE
|
CONSTRUCTOR_CALLEE
|
||||||
USER_TYPE
|
TYPE_REFERENCE
|
||||||
REFERENCE_EXPRESSION
|
USER_TYPE
|
||||||
PsiElement(IDENTIFIER)('a')
|
REFERENCE_EXPRESSION
|
||||||
PsiElement(RBRACKET)(']')
|
PsiElement(IDENTIFIER)('a')
|
||||||
PsiWhiteSpace(' ')
|
PsiElement(RBRACKET)(']')
|
||||||
USER_TYPE
|
PsiWhiteSpace(' ')
|
||||||
USER_TYPE
|
USER_TYPE
|
||||||
|
USER_TYPE
|
||||||
|
REFERENCE_EXPRESSION
|
||||||
|
PsiElement(IDENTIFIER)('T')
|
||||||
|
PsiElement(DOT)('.')
|
||||||
|
REFERENCE_EXPRESSION
|
||||||
|
PsiElement(IDENTIFIER)('T')
|
||||||
|
PsiElement(DOT)('.')
|
||||||
|
VALUE_PARAMETER_LIST
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(ARROW)('->')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
TYPE_REFERENCE
|
||||||
|
TUPLE_TYPE
|
||||||
|
PsiElement(HASH)('#')
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
PsiWhiteSpace('\n')
|
||||||
|
TYPEDEF
|
||||||
|
PsiElement(type)('type')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(IDENTIFIER)('f')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
TYPE_PARAMETER_LIST
|
||||||
|
<empty list>
|
||||||
|
PsiElement(EQ)('=')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
TYPE_REFERENCE
|
||||||
|
FUNCTION_TYPE
|
||||||
|
FUNCTION_TYPE_RECEIVER
|
||||||
|
TYPE_REFERENCE
|
||||||
|
ANNOTATION
|
||||||
|
PsiElement(LBRACKET)('[')
|
||||||
|
ANNOTATION_ENTRY
|
||||||
|
CONSTRUCTOR_CALLEE
|
||||||
|
TYPE_REFERENCE
|
||||||
|
USER_TYPE
|
||||||
|
REFERENCE_EXPRESSION
|
||||||
|
PsiElement(IDENTIFIER)('a')
|
||||||
|
PsiElement(RBRACKET)(']')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
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
|
REFERENCE_EXPRESSION
|
||||||
PsiElement(IDENTIFIER)('T')
|
PsiElement(IDENTIFIER)('T')
|
||||||
TYPE_ARGUMENT_LIST
|
TYPE_ARGUMENT_LIST
|
||||||
@@ -675,26 +699,8 @@ JetFile: FunctionTypes.jet
|
|||||||
TYPE_REFERENCE
|
TYPE_REFERENCE
|
||||||
USER_TYPE
|
USER_TYPE
|
||||||
REFERENCE_EXPRESSION
|
REFERENCE_EXPRESSION
|
||||||
PsiElement(IDENTIFIER)('A')
|
PsiElement(IDENTIFIER)('x')
|
||||||
PsiElement(COMMA)(',')
|
|
||||||
PsiWhiteSpace(' ')
|
|
||||||
TYPE_PROJECTION
|
|
||||||
TYPE_REFERENCE
|
|
||||||
USER_TYPE
|
|
||||||
REFERENCE_EXPRESSION
|
|
||||||
PsiElement(IDENTIFIER)('B')
|
|
||||||
PsiElement(GT)('>')
|
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(DOT)('.')
|
PsiElement(DOT)('.')
|
||||||
VALUE_PARAMETER_LIST
|
VALUE_PARAMETER_LIST
|
||||||
PsiElement(LPAR)('(')
|
PsiElement(LPAR)('(')
|
||||||
|
|||||||
@@ -111,10 +111,11 @@ JetFile: LocalDeclarations.jet
|
|||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
TYPE_REFERENCE
|
TYPE_REFERENCE
|
||||||
FUNCTION_TYPE
|
FUNCTION_TYPE
|
||||||
TYPE_REFERENCE
|
FUNCTION_TYPE_RECEIVER
|
||||||
USER_TYPE
|
TYPE_REFERENCE
|
||||||
REFERENCE_EXPRESSION
|
USER_TYPE
|
||||||
PsiElement(IDENTIFIER)('T')
|
REFERENCE_EXPRESSION
|
||||||
|
PsiElement(IDENTIFIER)('T')
|
||||||
PsiElement(DOT)('.')
|
PsiElement(DOT)('.')
|
||||||
VALUE_PARAMETER_LIST
|
VALUE_PARAMETER_LIST
|
||||||
PsiElement(LPAR)('(')
|
PsiElement(LPAR)('(')
|
||||||
|
|||||||
@@ -400,10 +400,11 @@ JetFile: Builder.jet
|
|||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
TYPE_REFERENCE
|
TYPE_REFERENCE
|
||||||
FUNCTION_TYPE
|
FUNCTION_TYPE
|
||||||
TYPE_REFERENCE
|
FUNCTION_TYPE_RECEIVER
|
||||||
USER_TYPE
|
TYPE_REFERENCE
|
||||||
REFERENCE_EXPRESSION
|
USER_TYPE
|
||||||
PsiElement(IDENTIFIER)('Library')
|
REFERENCE_EXPRESSION
|
||||||
|
PsiElement(IDENTIFIER)('Library')
|
||||||
PsiElement(DOT)('.')
|
PsiElement(DOT)('.')
|
||||||
VALUE_PARAMETER_LIST
|
VALUE_PARAMETER_LIST
|
||||||
PsiElement(LPAR)('(')
|
PsiElement(LPAR)('(')
|
||||||
|
|||||||
@@ -41,10 +41,11 @@ JetFile: With.jet
|
|||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
TYPE_REFERENCE
|
TYPE_REFERENCE
|
||||||
FUNCTION_TYPE
|
FUNCTION_TYPE
|
||||||
TYPE_REFERENCE
|
FUNCTION_TYPE_RECEIVER
|
||||||
USER_TYPE
|
TYPE_REFERENCE
|
||||||
REFERENCE_EXPRESSION
|
USER_TYPE
|
||||||
PsiElement(IDENTIFIER)('T')
|
REFERENCE_EXPRESSION
|
||||||
|
PsiElement(IDENTIFIER)('T')
|
||||||
PsiElement(DOT)('.')
|
PsiElement(DOT)('.')
|
||||||
VALUE_PARAMETER_LIST
|
VALUE_PARAMETER_LIST
|
||||||
PsiElement(LPAR)('(')
|
PsiElement(LPAR)('(')
|
||||||
|
|||||||
@@ -360,10 +360,11 @@ JetFile: functionTypes.jet
|
|||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
TYPE_REFERENCE
|
TYPE_REFERENCE
|
||||||
FUNCTION_TYPE
|
FUNCTION_TYPE
|
||||||
TYPE_REFERENCE
|
FUNCTION_TYPE_RECEIVER
|
||||||
USER_TYPE
|
TYPE_REFERENCE
|
||||||
REFERENCE_EXPRESSION
|
USER_TYPE
|
||||||
PsiElement(IDENTIFIER)('Int')
|
REFERENCE_EXPRESSION
|
||||||
|
PsiElement(IDENTIFIER)('Int')
|
||||||
PsiElement(DOT)('.')
|
PsiElement(DOT)('.')
|
||||||
VALUE_PARAMETER_LIST
|
VALUE_PARAMETER_LIST
|
||||||
PsiElement(LPAR)('(')
|
PsiElement(LPAR)('(')
|
||||||
@@ -393,14 +394,15 @@ JetFile: functionTypes.jet
|
|||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
TYPE_REFERENCE
|
TYPE_REFERENCE
|
||||||
FUNCTION_TYPE
|
FUNCTION_TYPE
|
||||||
TYPE_REFERENCE
|
FUNCTION_TYPE_RECEIVER
|
||||||
USER_TYPE
|
TYPE_REFERENCE
|
||||||
USER_TYPE
|
USER_TYPE
|
||||||
|
USER_TYPE
|
||||||
|
REFERENCE_EXPRESSION
|
||||||
|
PsiElement(IDENTIFIER)('n')
|
||||||
|
PsiElement(DOT)('.')
|
||||||
REFERENCE_EXPRESSION
|
REFERENCE_EXPRESSION
|
||||||
PsiElement(IDENTIFIER)('n')
|
PsiElement(IDENTIFIER)('B')
|
||||||
PsiElement(DOT)('.')
|
|
||||||
REFERENCE_EXPRESSION
|
|
||||||
PsiElement(IDENTIFIER)('B')
|
|
||||||
PsiElement(DOT)('.')
|
PsiElement(DOT)('.')
|
||||||
VALUE_PARAMETER_LIST
|
VALUE_PARAMETER_LIST
|
||||||
PsiElement(LPAR)('(')
|
PsiElement(LPAR)('(')
|
||||||
@@ -430,12 +432,13 @@ JetFile: functionTypes.jet
|
|||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
TYPE_REFERENCE
|
TYPE_REFERENCE
|
||||||
FUNCTION_TYPE
|
FUNCTION_TYPE
|
||||||
TYPE_REFERENCE
|
FUNCTION_TYPE_RECEIVER
|
||||||
NULLABLE_TYPE
|
TYPE_REFERENCE
|
||||||
USER_TYPE
|
NULLABLE_TYPE
|
||||||
REFERENCE_EXPRESSION
|
USER_TYPE
|
||||||
PsiElement(IDENTIFIER)('Int')
|
REFERENCE_EXPRESSION
|
||||||
PsiElement(QUEST)('?')
|
PsiElement(IDENTIFIER)('Int')
|
||||||
|
PsiElement(QUEST)('?')
|
||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
PsiElement(DOT)('.')
|
PsiElement(DOT)('.')
|
||||||
VALUE_PARAMETER_LIST
|
VALUE_PARAMETER_LIST
|
||||||
@@ -466,14 +469,15 @@ JetFile: functionTypes.jet
|
|||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
TYPE_REFERENCE
|
TYPE_REFERENCE
|
||||||
FUNCTION_TYPE
|
FUNCTION_TYPE
|
||||||
TYPE_REFERENCE
|
FUNCTION_TYPE_RECEIVER
|
||||||
PsiElement(LPAR)('(')
|
TYPE_REFERENCE
|
||||||
NULLABLE_TYPE
|
PsiElement(LPAR)('(')
|
||||||
USER_TYPE
|
NULLABLE_TYPE
|
||||||
REFERENCE_EXPRESSION
|
USER_TYPE
|
||||||
PsiElement(IDENTIFIER)('Int')
|
REFERENCE_EXPRESSION
|
||||||
PsiElement(QUEST)('?')
|
PsiElement(IDENTIFIER)('Int')
|
||||||
PsiElement(RPAR)(')')
|
PsiElement(QUEST)('?')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
PsiElement(DOT)('.')
|
PsiElement(DOT)('.')
|
||||||
VALUE_PARAMETER_LIST
|
VALUE_PARAMETER_LIST
|
||||||
PsiElement(LPAR)('(')
|
PsiElement(LPAR)('(')
|
||||||
@@ -568,25 +572,26 @@ JetFile: functionTypes.jet
|
|||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
TYPE_REFERENCE
|
TYPE_REFERENCE
|
||||||
FUNCTION_TYPE
|
FUNCTION_TYPE
|
||||||
TYPE_REFERENCE
|
FUNCTION_TYPE_RECEIVER
|
||||||
PsiElement(LPAR)('(')
|
TYPE_REFERENCE
|
||||||
FUNCTION_TYPE
|
PsiElement(LPAR)('(')
|
||||||
VALUE_PARAMETER_LIST
|
FUNCTION_TYPE
|
||||||
PsiElement(LPAR)('(')
|
VALUE_PARAMETER_LIST
|
||||||
VALUE_PARAMETER
|
PsiElement(LPAR)('(')
|
||||||
TYPE_REFERENCE
|
VALUE_PARAMETER
|
||||||
USER_TYPE
|
TYPE_REFERENCE
|
||||||
REFERENCE_EXPRESSION
|
USER_TYPE
|
||||||
PsiElement(IDENTIFIER)('Int')
|
REFERENCE_EXPRESSION
|
||||||
PsiElement(RPAR)(')')
|
PsiElement(IDENTIFIER)('Int')
|
||||||
PsiWhiteSpace(' ')
|
PsiElement(RPAR)(')')
|
||||||
PsiElement(ARROW)('->')
|
PsiWhiteSpace(' ')
|
||||||
PsiWhiteSpace(' ')
|
PsiElement(ARROW)('->')
|
||||||
TYPE_REFERENCE
|
PsiWhiteSpace(' ')
|
||||||
USER_TYPE
|
TYPE_REFERENCE
|
||||||
REFERENCE_EXPRESSION
|
USER_TYPE
|
||||||
PsiElement(IDENTIFIER)('Int')
|
REFERENCE_EXPRESSION
|
||||||
PsiElement(RPAR)(')')
|
PsiElement(IDENTIFIER)('Int')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
PsiElement(DOT)('.')
|
PsiElement(DOT)('.')
|
||||||
VALUE_PARAMETER_LIST
|
VALUE_PARAMETER_LIST
|
||||||
PsiElement(LPAR)('(')
|
PsiElement(LPAR)('(')
|
||||||
@@ -887,10 +892,11 @@ JetFile: functionTypes.jet
|
|||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
TYPE_REFERENCE
|
TYPE_REFERENCE
|
||||||
FUNCTION_TYPE
|
FUNCTION_TYPE
|
||||||
TYPE_REFERENCE
|
FUNCTION_TYPE_RECEIVER
|
||||||
USER_TYPE
|
TYPE_REFERENCE
|
||||||
REFERENCE_EXPRESSION
|
USER_TYPE
|
||||||
PsiElement(IDENTIFIER)('Int')
|
REFERENCE_EXPRESSION
|
||||||
|
PsiElement(IDENTIFIER)('Int')
|
||||||
PsiElement(DOT)('.')
|
PsiElement(DOT)('.')
|
||||||
VALUE_PARAMETER_LIST
|
VALUE_PARAMETER_LIST
|
||||||
PsiElement(LPAR)('(')
|
PsiElement(LPAR)('(')
|
||||||
@@ -924,14 +930,15 @@ JetFile: functionTypes.jet
|
|||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
TYPE_REFERENCE
|
TYPE_REFERENCE
|
||||||
FUNCTION_TYPE
|
FUNCTION_TYPE
|
||||||
TYPE_REFERENCE
|
FUNCTION_TYPE_RECEIVER
|
||||||
USER_TYPE
|
TYPE_REFERENCE
|
||||||
USER_TYPE
|
USER_TYPE
|
||||||
|
USER_TYPE
|
||||||
|
REFERENCE_EXPRESSION
|
||||||
|
PsiElement(IDENTIFIER)('n')
|
||||||
|
PsiElement(DOT)('.')
|
||||||
REFERENCE_EXPRESSION
|
REFERENCE_EXPRESSION
|
||||||
PsiElement(IDENTIFIER)('n')
|
PsiElement(IDENTIFIER)('B')
|
||||||
PsiElement(DOT)('.')
|
|
||||||
REFERENCE_EXPRESSION
|
|
||||||
PsiElement(IDENTIFIER)('B')
|
|
||||||
PsiElement(DOT)('.')
|
PsiElement(DOT)('.')
|
||||||
VALUE_PARAMETER_LIST
|
VALUE_PARAMETER_LIST
|
||||||
PsiElement(LPAR)('(')
|
PsiElement(LPAR)('(')
|
||||||
@@ -965,12 +972,13 @@ JetFile: functionTypes.jet
|
|||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
TYPE_REFERENCE
|
TYPE_REFERENCE
|
||||||
FUNCTION_TYPE
|
FUNCTION_TYPE
|
||||||
TYPE_REFERENCE
|
FUNCTION_TYPE_RECEIVER
|
||||||
NULLABLE_TYPE
|
TYPE_REFERENCE
|
||||||
USER_TYPE
|
NULLABLE_TYPE
|
||||||
REFERENCE_EXPRESSION
|
USER_TYPE
|
||||||
PsiElement(IDENTIFIER)('Int')
|
REFERENCE_EXPRESSION
|
||||||
PsiElement(QUEST)('?')
|
PsiElement(IDENTIFIER)('Int')
|
||||||
|
PsiElement(QUEST)('?')
|
||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
PsiElement(DOT)('.')
|
PsiElement(DOT)('.')
|
||||||
VALUE_PARAMETER_LIST
|
VALUE_PARAMETER_LIST
|
||||||
@@ -1005,14 +1013,15 @@ JetFile: functionTypes.jet
|
|||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
TYPE_REFERENCE
|
TYPE_REFERENCE
|
||||||
FUNCTION_TYPE
|
FUNCTION_TYPE
|
||||||
TYPE_REFERENCE
|
FUNCTION_TYPE_RECEIVER
|
||||||
PsiElement(LPAR)('(')
|
TYPE_REFERENCE
|
||||||
NULLABLE_TYPE
|
PsiElement(LPAR)('(')
|
||||||
USER_TYPE
|
NULLABLE_TYPE
|
||||||
REFERENCE_EXPRESSION
|
USER_TYPE
|
||||||
PsiElement(IDENTIFIER)('Int')
|
REFERENCE_EXPRESSION
|
||||||
PsiElement(QUEST)('?')
|
PsiElement(IDENTIFIER)('Int')
|
||||||
PsiElement(RPAR)(')')
|
PsiElement(QUEST)('?')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
PsiElement(DOT)('.')
|
PsiElement(DOT)('.')
|
||||||
VALUE_PARAMETER_LIST
|
VALUE_PARAMETER_LIST
|
||||||
PsiElement(LPAR)('(')
|
PsiElement(LPAR)('(')
|
||||||
@@ -1123,29 +1132,30 @@ JetFile: functionTypes.jet
|
|||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
TYPE_REFERENCE
|
TYPE_REFERENCE
|
||||||
FUNCTION_TYPE
|
FUNCTION_TYPE
|
||||||
TYPE_REFERENCE
|
FUNCTION_TYPE_RECEIVER
|
||||||
PsiElement(LPAR)('(')
|
TYPE_REFERENCE
|
||||||
FUNCTION_TYPE
|
PsiElement(LPAR)('(')
|
||||||
VALUE_PARAMETER_LIST
|
FUNCTION_TYPE
|
||||||
PsiElement(LPAR)('(')
|
VALUE_PARAMETER_LIST
|
||||||
VALUE_PARAMETER
|
PsiElement(LPAR)('(')
|
||||||
PsiElement(IDENTIFIER)('a')
|
VALUE_PARAMETER
|
||||||
PsiWhiteSpace(' ')
|
PsiElement(IDENTIFIER)('a')
|
||||||
PsiElement(COLON)(':')
|
PsiWhiteSpace(' ')
|
||||||
PsiWhiteSpace(' ')
|
PsiElement(COLON)(':')
|
||||||
TYPE_REFERENCE
|
PsiWhiteSpace(' ')
|
||||||
USER_TYPE
|
TYPE_REFERENCE
|
||||||
REFERENCE_EXPRESSION
|
USER_TYPE
|
||||||
PsiElement(IDENTIFIER)('Int')
|
REFERENCE_EXPRESSION
|
||||||
PsiElement(RPAR)(')')
|
PsiElement(IDENTIFIER)('Int')
|
||||||
PsiWhiteSpace(' ')
|
PsiElement(RPAR)(')')
|
||||||
PsiElement(ARROW)('->')
|
PsiWhiteSpace(' ')
|
||||||
PsiWhiteSpace(' ')
|
PsiElement(ARROW)('->')
|
||||||
TYPE_REFERENCE
|
PsiWhiteSpace(' ')
|
||||||
USER_TYPE
|
TYPE_REFERENCE
|
||||||
REFERENCE_EXPRESSION
|
USER_TYPE
|
||||||
PsiElement(IDENTIFIER)('Int')
|
REFERENCE_EXPRESSION
|
||||||
PsiElement(RPAR)(')')
|
PsiElement(IDENTIFIER)('Int')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
PsiElement(DOT)('.')
|
PsiElement(DOT)('.')
|
||||||
VALUE_PARAMETER_LIST
|
VALUE_PARAMETER_LIST
|
||||||
PsiElement(LPAR)('(')
|
PsiElement(LPAR)('(')
|
||||||
|
|||||||
@@ -1656,6 +1656,11 @@ public class JetDiagnosticsTestGenerated extends AbstractDiagnosticsTestWithEage
|
|||||||
doTest("compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/funKeyword.kt");
|
doTest("compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/funKeyword.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("funcitonTypes.kt")
|
||||||
|
public void testFuncitonTypes() throws Exception {
|
||||||
|
doTest("compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/funcitonTypes.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("incompleteVal.kt")
|
@TestMetadata("incompleteVal.kt")
|
||||||
public void testIncompleteVal() throws Exception {
|
public void testIncompleteVal() throws Exception {
|
||||||
doTest("compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/incompleteVal.kt");
|
doTest("compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/incompleteVal.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user