@@ -141,7 +141,7 @@ type val var while with yield
141141### Soft keywords
142142
143143```
144- as derives end erased extension infix inline opaque open throws tracked transparent using | * + -
144+ as derives end erased extension infix inline mut opaque open throws tracked transparent using | * + -
145145```
146146
147147See the [ separate section on soft keywords] ( ../reference/soft-modifier.md ) for additional
@@ -182,15 +182,19 @@ Type ::= FunType
182182 | MatchType
183183 | InfixType
184184FunType ::= FunTypeArgs (‘=>’ | ‘?=>’) Type Function(ts, t) | FunctionWithMods(ts, t, mods, erasedParams)
185- | TypTypeParamClause '=>' Type PolyFunction(ps, t)
185+ | FunTypeArgs (‘->’ | ‘?->’) [CaptureSet] Type -- under pureFunctions and captureChecking
186+ | TypTypeParamClause ‘=>’ Type PolyFunction(ps, t)
187+ | TypTypeParamClause ‘->’ [CaptureSet] Type -- under pureFunctions and captureChecking
186188FunTypeArgs ::= InfixType
187189 | ‘(’ [ FunArgTypes ] ‘)’
188190 | FunParamClause
189191FunParamClause ::= ‘(’ TypedFunParam {‘,’ TypedFunParam } ‘)’
190192TypedFunParam ::= [`erased`] id ‘:’ Type
191193MatchType ::= InfixType `match` <<< TypeCaseClauses >>>
192194InfixType ::= RefinedType {id [nl] RefinedType} InfixOp(t1, op, t2)
195+ | RefinedType ‘^’ -- under captureChecking
193196RefinedType ::= AnnotType {[nl] Refinement} RefinedTypeTree(t, ds)
197+ | AnnotType {[nl] Refinement} ‘^’ CaptureSet -- under captureChecking
194198AnnotType ::= SimpleType {Annotation} Annotated(t, annot)
195199AnnotType1 ::= SimpleType1 {Annotation} Annotated(t, annot)
196200
@@ -210,26 +214,35 @@ Singleton ::= SimpleRef
210214 | Singleton ‘.’ id
211215FunArgType ::= Type
212216 | ‘=>’ Type PrefixOp(=>, t)
217+ | ‘->’ [CaptureSet] Type -- under captureChecking
213218FunArgTypes ::= FunArgType { ‘,’ FunArgType }
214219ParamType ::= [‘=>’] ParamValueType
220+ | ‘->’ [CaptureSet] ParamValueType -- under captureChecking
215221ParamValueType ::= Type [‘*’] PostfixOp(t, "*")
216222 | IntoType
217223 | ‘(’ IntoType ‘)’ ‘*’ PostfixOp(t, "*")
218224IntoType ::= [‘into’] IntoTargetType Into(t)
219225 | ‘(’ IntoType ‘)’
220226IntoTargetType ::= Type
221227 | FunTypeArgs (‘=>’ | ‘?=>’) IntoType
222- TypeArgs ::= ‘[’ Types ‘]’ ts
228+ TypeArgs ::= ‘[’ TypeArg {‘,’ TypeArg} ‘]’ ts
223229Refinement ::= :<<< [RefineDcl] {semi [RefineDcl]} >>> ds
224- TypeBounds ::= [‘>:’ Type ] [‘<:’ Type] TypeBoundsTree(lo, hi)
230+ TypeBounds ::= [‘>:’ TypeBound ] [‘<:’ TypeBound] TypeBoundsTree(lo, hi)
225231TypeAndCtxBounds ::= TypeBounds [‘:’ ContextBounds] ContextBounds(typeBounds, tps)
226232ContextBounds ::= ContextBound
227233 | ContextBound `:` ContextBounds -- to be deprecated
228234 | '{' ContextBound {',' ContextBound} '}'
229235ContextBound ::= Type ['as' id]
230236Types ::= Type {‘,’ Type}
237+ TypeArg ::= Type
238+ | CaptureSet -- under captureChecking
239+ TypeBound ::= Type
240+ | CaptureSet -- under captureChecking
231241NamesAndTypes ::= NameAndType {‘,’ NameAndType}
232242NameAndType ::= id ':' Type
243+ CaptureSet ::= ‘{’ CaptureRef {‘,’ CaptureRef} ‘}’ -- under captureChecking
244+ CaptureRef ::= { SimpleRef ‘.’ } SimpleRef [‘*’] [‘.’ ‘rd’] -- under captureChecking
245+ | [ { SimpleRef ‘.’ } SimpleRef ‘.’ ] id -- under captureChecking
233246```
234247
235248### Expressions
@@ -365,16 +378,20 @@ ArgumentPatterns ::= ‘(’ [Patterns] ‘)’
365378ClsTypeParamClause::= ‘[’ ClsTypeParam {‘,’ ClsTypeParam} ‘]’
366379ClsTypeParam ::= {Annotation} [‘+’ | ‘-’] TypeDef(Modifiers, name, tparams, bounds)
367380 id [HkTypeParamClause] TypeAndCtxBounds Bound(below, above, context)
381+ | {Annotation} id [`^`] TypeAndCtxBounds -- under captureChecking
368382
369383DefTypeParamClause::= [nl] ‘[’ DefTypeParam {‘,’ DefTypeParam} ‘]’
370384DefTypeParam ::= {Annotation} id [HkTypeParamClause] TypeAndCtxBounds
385+ | {Annotation} id [`^`] TypeAndCtxBounds -- under captureChecking
371386
372387TypTypeParamClause::= ‘[’ TypTypeParam {‘,’ TypTypeParam} ‘]’
373- TypTypeParam ::= {Annotation} (id | ‘_’) [HkTypeParamClause] TypeBounds
388+ TypTypeParam ::= {Annotation} (id | ‘_’) [HkTypeParamClause] TypeAndCtxBounds
389+ | {Annotation} id [`^`] TypeAndCtxBounds -- under captureChecking
374390
375391HkTypeParamClause ::= ‘[’ HkTypeParam {‘,’ HkTypeParam} ‘]’
376392HkTypeParam ::= {Annotation} [‘+’ | ‘-’] (id | ‘_’) [HkTypeParamClause]
377393 TypeBounds
394+ | {Annotation} id [`^`] TypeBounds -- under captureChecking
378395
379396ClsParamClauses ::= {ClsParamClause} [[nl] ‘(’ [‘implicit’] ClsParams ‘)’]
380397ClsParamClause ::= [nl] ‘(’ ClsParams ‘)’
@@ -419,6 +436,7 @@ LocalModifier ::= ‘abstract’
419436 | ‘infix’
420437 | ‘erased’
421438 | ‘tracked’
439+ | ‘mut’ -- under captureChecking
422440
423441AccessModifier ::= (‘private’ | ‘protected’) [AccessQualifier]
424442AccessQualifier ::= ‘[’ id ‘]’
@@ -462,7 +480,10 @@ DefDef ::= DefSig [‘:’ Type] [‘=’ Expr]
462480 | ‘this’ ConstrParamClauses [DefImplicitClause] ‘=’ ConstrExpr DefDef(_, <init>, vparamss, EmptyTree, expr | Block)
463481DefSig ::= id [DefParamClauses] [DefImplicitClause]
464482TypeDef ::= id [HkTypeParamClause] {FunParamClause} TypeAndCtxBounds TypeDefTree(_, name, tparams, bound
465- [‘=’ Type]
483+ [‘=’ TypeDefRHS]
484+ | id [`^`] TypeAndCtxBounds [‘=’ TypeDefRHS] -- under captureChecking
485+ TypeDefRHS ::= Type
486+ | CaptureSet -- under captureChecking
466487
467488TmplDef ::= ([‘case’] ‘class’ | ‘trait’) ClassDef
468489 | [‘case’] ‘object’ ObjectDef
0 commit comments