@@ -310,9 +310,6 @@ ArgumentPatterns ::= ‘(’ [Patterns] ‘)’
310
310
ClsTypeParamClause::= ‘[’ ClsTypeParam {‘,’ ClsTypeParam} ‘]’
311
311
ClsTypeParam ::= {Annotation} [‘+’ | ‘-’] id [HkTypeParamClause] TypeParamBounds
312
312
313
- DefTypeParamClause::= ‘[’ DefTypeParam {‘,’ DefTypeParam} ‘]’
314
- DefTypeParam ::= {Annotation} id [HkTypeParamClause] TypeParamBounds
315
-
316
313
TypTypeParamClause::= ‘[’ TypTypeParam {‘,’ TypTypeParam} ‘]’
317
314
TypTypeParam ::= {Annotation} id [HkTypeParamClause] TypeBounds
318
315
@@ -324,13 +321,24 @@ ClsParamClause ::= [nl] ‘(’ ClsParams ‘)’
324
321
| [nl] ‘(’ ‘using’ (ClsParams | FunArgTypes) ‘)’
325
322
ClsParams ::= ClsParam {‘,’ ClsParam}
326
323
ClsParam ::= {Annotation} [{Modifier} (‘val’ | ‘var’) | ‘inline’] Param
327
- Param ::= id ‘:’ ParamType [‘=’ Expr]
328
324
329
- DefParamClauses ::= {DefParamClause} [[nl] ‘(’ [‘implicit’] DefParams ‘)’]
330
- DefParamClause ::= [nl] ‘(’ DefParams ‘)’ | UsingParamClause
331
- UsingParamClause ::= [nl] ‘(’ ‘using’ (DefParams | FunArgTypes) ‘)’
332
- DefParams ::= DefParam {‘,’ DefParam}
333
- DefParam ::= {Annotation} [‘inline’] Param
325
+ DefParamClauses ::= DefParamClause { DefParamClause }
326
+ DefParamClause ::= DefTypeParamClause
327
+ | DefTermParamClause
328
+ | UsingParamClause
329
+ TypelessClauses ::= TypelessClause {TypelessClause}
330
+ TypelessClause ::= DefTermParamClause
331
+ | UsingParamClause
332
+
333
+ DefTypeParamClause::= [nl] ‘[’ DefTypeParam {‘,’ DefTypeParam} ‘]’
334
+ DefTypeParam ::= {Annotation} id [HkTypeParamClause] TypeParamBounds
335
+ DefTermParamClause::= [nl] ‘(’ [DefTermParams] ‘)’
336
+ UsingParamClause ::= [nl] ‘(’ ‘using’ (DefTermParams | FunArgTypes) ‘)’
337
+ DefImplicitClause ::= [nl] ‘(’ ‘implicit’ DefTermParams ‘)’
338
+
339
+ DefTermParams ::= DefTermParam {‘,’ DefTermParam}
340
+ DefTermParam ::= {Annotation} [‘inline’] Param
341
+ Param ::= id ‘:’ ParamType [‘=’ Expr]
334
342
```
335
343
336
344
### Bindings and Imports
@@ -381,8 +389,8 @@ Dcl ::= RefineDcl
381
389
ValDcl ::= ids ‘:’ Type
382
390
VarDcl ::= ids ‘:’ Type
383
391
DefDcl ::= DefSig ‘:’ Type
384
- DefSig ::= id [DefTypeParamClause] DefParamClauses
385
- TypeDcl ::= id [TypeParamClause] {FunParamClause} TypeBounds [‘=’ Type]
392
+ DefSig ::= id [DefParamClauses] [DefImplicitClause]
393
+ TypeDcl ::= id [TypeParamClause] {FunParamClause} TypeBounds
386
394
387
395
Def ::= ‘val’ PatDef
388
396
| ‘var’ PatDef
@@ -392,7 +400,7 @@ Def ::= ‘val’ PatDef
392
400
PatDef ::= ids [‘:’ Type] ‘=’ Expr
393
401
| Pattern2 [‘:’ Type] ‘=’ Expr
394
402
DefDef ::= DefSig [‘:’ Type] ‘=’ Expr
395
- | ‘this’ DefParamClause DefParamClauses ‘=’ ConstrExpr
403
+ | ‘this’ TypelessClauses [DefImplicitClause] ‘=’ ConstrExpr
396
404
397
405
TmplDef ::= ([‘case’] ‘class’ | ‘trait’) ClassDef
398
406
| [‘case’] ‘object’ ObjectDef
@@ -404,10 +412,10 @@ ConstrMods ::= {Annotation} [AccessModifier]
404
412
ObjectDef ::= id [Template]
405
413
EnumDef ::= id ClassConstr InheritClauses EnumBody
406
414
GivenDef ::= [GivenSig] (AnnotType [‘=’ Expr] | StructuralInstance)
407
- GivenSig ::= [id] [DefTypeParamClause] {UsingParamClause} ‘:’ -- one of `id`, `DefParamClause `, `UsingParamClause` must be present
415
+ GivenSig ::= [id] [DefTypeParamClause] {UsingParamClause} ‘:’ -- one of `id`, `DefTypeParamClause `, `UsingParamClause` must be present
408
416
StructuralInstance ::= ConstrApp {‘with’ ConstrApp} [‘with’ TemplateBody]
409
417
Extension ::= ‘extension’ [DefTypeParamClause] {UsingParamClause}
410
- ‘(’ DefParam ‘)’ {UsingParamClause} ExtMethods
418
+ ‘(’ DefTermParam ‘)’ {UsingParamClause} ExtMethods
411
419
ExtMethods ::= ExtMethod | [nl] <<< ExtMethod {semi ExtMethod} >>>
412
420
ExtMethod ::= {Annotation [nl]} {Modifier} ‘def’ DefDef
413
421
Template ::= InheritClauses [TemplateBody]
0 commit comments