Tuple types
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
class F(
|
||||
a : (),
|
||||
x : (X),
|
||||
b : (A, B),
|
||||
c : (x : Int, y : Int),
|
||||
a : [x] (),
|
||||
x : [x]([x] X),
|
||||
b : [x] ([x] A, [x]B),
|
||||
c : [x] (x : [x] Int, y : [x] Int)
|
||||
)
|
||||
@@ -0,0 +1,227 @@
|
||||
JetFile: TupleTypes.jet
|
||||
NAMESPACE
|
||||
CLASS
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('F')
|
||||
TYPE_PARAMETER_LIST
|
||||
<empty list>
|
||||
PRIMARY_CONSTRUCTOR_PARAMETERS_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiWhiteSpace('\n ')
|
||||
PRIMARY_CONSTRUCTOR_PARAMETER
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
TUPLE_TYPE
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
PRIMARY_CONSTRUCTOR_PARAMETER
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
TUPLE_TYPE
|
||||
PsiElement(LPAR)('(')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('X')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
PRIMARY_CONSTRUCTOR_PARAMETER
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
TUPLE_TYPE
|
||||
PsiElement(LPAR)('(')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('A')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('B')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
PRIMARY_CONSTRUCTOR_PARAMETER
|
||||
PsiElement(IDENTIFIER)('c')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
TUPLE_TYPE
|
||||
PsiElement(LPAR)('(')
|
||||
LABELED_TUPLE_ENTRY
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('Int')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
LABELED_TUPLE_ENTRY
|
||||
PsiElement(IDENTIFIER)('y')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('Int')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
PRIMARY_CONSTRUCTOR_PARAMETER
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
ATTRIBUTE_ANNOTATION
|
||||
PsiElement(LBRACKET)('[')
|
||||
ATTRIBUTE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiElement(RBRACKET)(']')
|
||||
PsiWhiteSpace(' ')
|
||||
TUPLE_TYPE
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
PRIMARY_CONSTRUCTOR_PARAMETER
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
ATTRIBUTE_ANNOTATION
|
||||
PsiElement(LBRACKET)('[')
|
||||
ATTRIBUTE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiElement(RBRACKET)(']')
|
||||
TUPLE_TYPE
|
||||
PsiElement(LPAR)('(')
|
||||
TYPE_REFERENCE
|
||||
ATTRIBUTE_ANNOTATION
|
||||
PsiElement(LBRACKET)('[')
|
||||
ATTRIBUTE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiElement(RBRACKET)(']')
|
||||
PsiWhiteSpace(' ')
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('X')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
PRIMARY_CONSTRUCTOR_PARAMETER
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
ATTRIBUTE_ANNOTATION
|
||||
PsiElement(LBRACKET)('[')
|
||||
ATTRIBUTE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiElement(RBRACKET)(']')
|
||||
PsiWhiteSpace(' ')
|
||||
TUPLE_TYPE
|
||||
PsiElement(LPAR)('(')
|
||||
TYPE_REFERENCE
|
||||
ATTRIBUTE_ANNOTATION
|
||||
PsiElement(LBRACKET)('[')
|
||||
ATTRIBUTE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiElement(RBRACKET)(']')
|
||||
PsiWhiteSpace(' ')
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('A')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
ATTRIBUTE_ANNOTATION
|
||||
PsiElement(LBRACKET)('[')
|
||||
ATTRIBUTE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiElement(RBRACKET)(']')
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('B')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
PRIMARY_CONSTRUCTOR_PARAMETER
|
||||
PsiElement(IDENTIFIER)('c')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
ATTRIBUTE_ANNOTATION
|
||||
PsiElement(LBRACKET)('[')
|
||||
ATTRIBUTE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiElement(RBRACKET)(']')
|
||||
PsiWhiteSpace(' ')
|
||||
TUPLE_TYPE
|
||||
PsiElement(LPAR)('(')
|
||||
LABELED_TUPLE_ENTRY
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
ATTRIBUTE_ANNOTATION
|
||||
PsiElement(LBRACKET)('[')
|
||||
ATTRIBUTE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiElement(RBRACKET)(']')
|
||||
PsiWhiteSpace(' ')
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('Int')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
LABELED_TUPLE_ENTRY
|
||||
PsiElement(IDENTIFIER)('y')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
ATTRIBUTE_ANNOTATION
|
||||
PsiElement(LBRACKET)('[')
|
||||
ATTRIBUTE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiElement(RBRACKET)(']')
|
||||
PsiWhiteSpace(' ')
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('Int')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(RPAR)(')')
|
||||
@@ -0,0 +1,10 @@
|
||||
class F(
|
||||
a : (),
|
||||
x : (X),
|
||||
b : (A, ),
|
||||
c : (x : , : Int),
|
||||
a : [x] (),
|
||||
x : [x]([x X),
|
||||
b : [x] ([x] A, [x]B),
|
||||
c : [x] (x : [x] Int, y : [x] Int)
|
||||
)
|
||||
@@ -0,0 +1,225 @@
|
||||
JetFile: TupleTypes_ERR.jet
|
||||
NAMESPACE
|
||||
CLASS
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('F')
|
||||
TYPE_PARAMETER_LIST
|
||||
<empty list>
|
||||
PRIMARY_CONSTRUCTOR_PARAMETERS_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiWhiteSpace('\n ')
|
||||
PRIMARY_CONSTRUCTOR_PARAMETER
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
TUPLE_TYPE
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
PRIMARY_CONSTRUCTOR_PARAMETER
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
TUPLE_TYPE
|
||||
PsiElement(LPAR)('(')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('X')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
PRIMARY_CONSTRUCTOR_PARAMETER
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
TUPLE_TYPE
|
||||
PsiElement(LPAR)('(')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('A')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiErrorElement:Type expected
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
PRIMARY_CONSTRUCTOR_PARAMETER
|
||||
PsiElement(IDENTIFIER)('c')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
TUPLE_TYPE
|
||||
PsiElement(LPAR)('(')
|
||||
LABELED_TUPLE_ENTRY
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
PsiErrorElement:Type expected
|
||||
<empty list>
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Expecting a name for tuple entry
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('Int')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
PRIMARY_CONSTRUCTOR_PARAMETER
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
ATTRIBUTE_ANNOTATION
|
||||
PsiElement(LBRACKET)('[')
|
||||
ATTRIBUTE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiElement(RBRACKET)(']')
|
||||
PsiWhiteSpace(' ')
|
||||
TUPLE_TYPE
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
PRIMARY_CONSTRUCTOR_PARAMETER
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
ATTRIBUTE_ANNOTATION
|
||||
PsiElement(LBRACKET)('[')
|
||||
ATTRIBUTE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiElement(RBRACKET)(']')
|
||||
TUPLE_TYPE
|
||||
PsiElement(LPAR)('(')
|
||||
TYPE_REFERENCE
|
||||
ATTRIBUTE_ANNOTATION
|
||||
PsiElement(LBRACKET)('[')
|
||||
ATTRIBUTE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiErrorElement:Expecting ']' to close an attribute annotation
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('X')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
PRIMARY_CONSTRUCTOR_PARAMETER
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
ATTRIBUTE_ANNOTATION
|
||||
PsiElement(LBRACKET)('[')
|
||||
ATTRIBUTE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiElement(RBRACKET)(']')
|
||||
PsiWhiteSpace(' ')
|
||||
TUPLE_TYPE
|
||||
PsiElement(LPAR)('(')
|
||||
TYPE_REFERENCE
|
||||
ATTRIBUTE_ANNOTATION
|
||||
PsiElement(LBRACKET)('[')
|
||||
ATTRIBUTE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiElement(RBRACKET)(']')
|
||||
PsiWhiteSpace(' ')
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('A')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
ATTRIBUTE_ANNOTATION
|
||||
PsiElement(LBRACKET)('[')
|
||||
ATTRIBUTE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiElement(RBRACKET)(']')
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('B')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
PRIMARY_CONSTRUCTOR_PARAMETER
|
||||
PsiElement(IDENTIFIER)('c')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
ATTRIBUTE_ANNOTATION
|
||||
PsiElement(LBRACKET)('[')
|
||||
ATTRIBUTE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiElement(RBRACKET)(']')
|
||||
PsiWhiteSpace(' ')
|
||||
TUPLE_TYPE
|
||||
PsiElement(LPAR)('(')
|
||||
LABELED_TUPLE_ENTRY
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
ATTRIBUTE_ANNOTATION
|
||||
PsiElement(LBRACKET)('[')
|
||||
ATTRIBUTE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiElement(RBRACKET)(']')
|
||||
PsiWhiteSpace(' ')
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('Int')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
LABELED_TUPLE_ENTRY
|
||||
PsiElement(IDENTIFIER)('y')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
ATTRIBUTE_ANNOTATION
|
||||
PsiElement(LBRACKET)('[')
|
||||
ATTRIBUTE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiElement(RBRACKET)(']')
|
||||
PsiWhiteSpace(' ')
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('Int')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(RPAR)(')')
|
||||
Reference in New Issue
Block a user