Closed
Description
The following code is valid in Scala 3.3.1
trait A:
extension (x: Int) def foo: Int
But it seems to be not covered by the ebnf grammar:
Extension ::= ‘extension’ [DefTypeParamClause] {UsingParamClause}
‘(’ DefTermParam ‘)’ {UsingParamClause} ExtMethods
ExtMethods ::= ExtMethod | [nl] <<< ExtMethod {semi ExtMethod} >>>
ExtMethod ::= {Annotation [nl]} {Modifier} ‘def’ DefDef
| Export
DefDef ::= DefSig [‘:’ Type] ‘=’ Expr
| ‘this’ TypelessClauses [DefImplicitClause] ‘=’ ConstrExpr
DefDef
requires a function body to be defined (unlike DefDcl
)