JET-126 Put 'where'-clause after the declaration
This commit is contained in:
@@ -21,6 +21,7 @@ class
|
||||
typeParameters?
|
||||
("wraps" valueParameters? | modifiers valueParameters?)?
|
||||
(":" annotations delegationSpecifier{","})?
|
||||
typeConstraints
|
||||
(classBody? | enumClassBody)
|
||||
;
|
||||
|
||||
@@ -40,7 +41,6 @@ explicitDelegation
|
||||
|
||||
typeParameters
|
||||
: "<" typeParameter{","} ">"
|
||||
("where" typeConstraint{","})?
|
||||
;
|
||||
|
||||
typeParameter
|
||||
@@ -51,6 +51,10 @@ typeParameter
|
||||
bq. See [Generic classes|Generics#Generic classes]
|
||||
*/
|
||||
|
||||
typeConstraints
|
||||
: ("where" typeConstraint{","})?
|
||||
;
|
||||
|
||||
typeConstraint
|
||||
: annotations SimpleName ":" type
|
||||
: annotations "class" "object" SimpleName ":" type
|
||||
|
||||
@@ -83,6 +83,7 @@ function
|
||||
(type "." | annotations/*for receiver type*/)?
|
||||
SimpleName
|
||||
typeParameters? valueParameters (":" type)?
|
||||
typeConstraints
|
||||
functionBody?
|
||||
;
|
||||
|
||||
@@ -95,6 +96,7 @@ property
|
||||
: modifiers ("val" | "var")
|
||||
typeParameters? (type "." | annotations)?
|
||||
SimpleName (":" type)?
|
||||
typeConstraints
|
||||
("=" expression SEMI?)?
|
||||
(getter? setter? | setter? getter?) SEMI?
|
||||
;
|
||||
|
||||
@@ -9,5 +9,5 @@ enumClassBody
|
||||
;
|
||||
|
||||
enumEntry
|
||||
: modifiers SimpleName typeParameters? valueParameters? (":" initializer{","})? classBody?
|
||||
: modifiers SimpleName typeParameters? valueParameters? (":" initializer{","})? typeConstraints classBody?
|
||||
;
|
||||
|
||||
@@ -53,5 +53,5 @@ bq. See [Namespaces]
|
||||
|
||||
[undocumented]
|
||||
typedef
|
||||
: modifiers "type" SimpleName typeParameters? "=" type
|
||||
: modifiers "type" SimpleName (typeParameters typeConstraints)? "=" type
|
||||
;
|
||||
@@ -36,8 +36,8 @@ pattern
|
||||
|
||||
decomposerPattern
|
||||
: type
|
||||
// TODO : typeParameters will be consumed by the expression
|
||||
: elvisExpression typeParameters? "@" tuplePattern
|
||||
// TODO : typeArguments will be consumed by the expression
|
||||
: elvisExpression typeArguments? "@" tuplePattern
|
||||
;
|
||||
|
||||
constantPattern
|
||||
|
||||
Reference in New Issue
Block a user