Skip to content

Commit 4f58ba4

Browse files
committed
Fixes after rebase
1 parent 23a5d0f commit 4f58ba4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2416,14 +2416,14 @@ object Parsers {
24162416
def objectDefRest(start: Offset, mods: Modifiers, name: TermName): ModuleDef = {
24172417
val template = templateOpt(emptyConstructor)
24182418

2419-
def flagPos(flag: FlagSet) = mods.mods.find(_.flags == flag).get.pos
2419+
def flagSpan(flag: FlagSet) = mods.mods.find(_.flags == flag).get.span
24202420
if (mods is Abstract)
2421-
syntaxError(hl"""${Abstract} modifier cannot be used for objects""", flagPos(Abstract))
2421+
syntaxError(hl"""${Abstract} modifier cannot be used for objects""", flagSpan(Abstract))
24222422
if (mods is Sealed)
2423-
syntaxError(hl"""${Sealed} modifier is redundant for objects""", flagPos(Sealed))
2423+
syntaxError(hl"""${Sealed} modifier is redundant for objects""", flagSpan(Sealed))
24242424
// Maybe this should be an error; see https://github.com/scala/bug/issues/11094.
24252425
if (mods is Final)
2426-
warning(hl"""${Final} modifier is redundant for objects""", source atPos flagPos(Final))
2426+
warning(hl"""${Final} modifier is redundant for objects""", source atSpan flagSpan(Final))
24272427

24282428
finalizeDef(ModuleDef(name, template), mods, start)
24292429
}

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2488,7 +2488,7 @@ class Typer extends Namer
24882488
if (!defn.isFunctionType(pt))
24892489
pt match {
24902490
case SAMType(_) if !pt.classSymbol.hasAnnotation(defn.FunctionalInterfaceAnnot) =>
2491-
ctx.warning(ex"${tree.symbol} is eta-expanded even though $pt does not have the @FunctionalInterface annotation.", tree.pos)
2491+
ctx.warning(ex"${tree.symbol} is eta-expanded even though $pt does not have the @FunctionalInterface annotation.", tree.sourcePos)
24922492
case _ =>
24932493
}
24942494
simplify(typed(etaExpand(tree, wtp, arity), pt), pt, locked)

0 commit comments

Comments
 (0)