Skip to content

Commit 3bb85e5

Browse files
committed
Fix position breakage in Parser
1 parent c81fc6b commit 3bb85e5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3286,6 +3286,7 @@ object Parsers {
32863286
makeConstructor(Nil, vparamss, rhs).withMods(mods).setComment(in.getDocComment(start))
32873287
}
32883288
else {
3289+
val mods1 = addFlag(mods, Method)
32893290
val ident = termIdent()
32903291
var name = ident.name.asTermName
32913292
val tparams = typeParamClauseOpt(ParamOwner.Def)
@@ -3317,7 +3318,7 @@ object Parsers {
33173318

33183319
val ddef = DefDef(name, tparams, vparamss, tpt, rhs)
33193320
if (isBackquoted(ident)) ddef.pushAttachment(Backquoted, ())
3320-
finalizeDef(ddef, addFlag(mods, Method), start)
3321+
finalizeDef(ddef, mods1, start)
33213322
}
33223323
}
33233324

0 commit comments

Comments
 (0)