@@ -3568,26 +3568,26 @@ object Parsers {
3568
3568
*/
3569
3569
def givenDef (start : Offset , mods : Modifiers , givenMod : Mod ) = atSpan(start, nameStart) {
3570
3570
var mods1 = addMod(mods, givenMod)
3571
- val hasGivenSig = followingIsGivenSig()
3572
3571
val nameStart = in.offset
3573
- val name = if isIdent && hasGivenSig then ident() else EmptyTermName
3574
-
3575
- val gdef =
3572
+ val (name, tparams, vparamss, parents) = if followingIsGivenSig() then
3573
+ val name = if isIdent then ident() else EmptyTermName
3576
3574
val tparams = typeParamClauseOpt(ParamOwner .Def )
3577
3575
newLineOpt()
3578
3576
val vparamss =
3579
3577
if in.token == LPAREN && in.lookahead.isIdent(nme.using)
3580
3578
then paramClauses(givenOnly = true )
3581
3579
else Nil
3582
3580
newLinesOpt()
3583
- val noParams = tparams.isEmpty && vparamss.isEmpty
3584
- if ! (name.isEmpty && noParams) then
3585
- accept(nme.as)
3581
+ accept(nme.as)
3586
3582
val parents = constrApps(commaOK = true )
3583
+ (name, tparams, vparamss, parents)
3584
+ else
3585
+ (EmptyTermName , Nil , Nil , constrApps(commaOK = true ))
3586
+ val gdef =
3587
3587
if in.token == EQUALS && parents.length == 1 && parents.head.isType then
3588
3588
accept(EQUALS )
3589
3589
mods1 |= Final
3590
- if noParams && ! mods.is(Inline ) then
3590
+ if tparams.isEmpty && vparamss.isEmpty && ! mods.is(Inline ) then
3591
3591
mods1 |= Lazy
3592
3592
ValDef (name, parents.head, subExpr())
3593
3593
else
0 commit comments