File tree Expand file tree Collapse file tree 2 files changed +15
-14
lines changed
compiler/src/dotty/tools/dotc/parsing Expand file tree Collapse file tree 2 files changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -3425,14 +3425,15 @@ object Parsers {
3425
3425
else mods.withPrivateWithin(ident().toTypeName)
3426
3426
}
3427
3427
if mods1.is(Local ) then
3428
+ val span = Span (startOffset, in.lastOffset)
3428
3429
report.errorOrMigrationWarning(
3429
3430
em """ Ignoring [this] qualifier.
3430
3431
|This syntax will be deprecated in the future; it should be dropped.
3431
3432
|See: https://docs.scala-lang.org/scala3/reference/dropped-features/this-qualifier.html ${rewriteNotice(`3.4-migration`)}""" ,
3432
- in.sourcePos(),
3433
+ in.sourcePos().withSpan(span) ,
3433
3434
MigrationVersion .RemoveThisQualifier )
3434
3435
if MigrationVersion .RemoveThisQualifier .needsPatch then
3435
- patch(source, Span (startOffset, in.lastOffset) , " " )
3436
+ patch(source, span , " " )
3436
3437
mods1
3437
3438
}
3438
3439
else mods
Original file line number Diff line number Diff line change 1
- -- Warning: tests/warn/private-this-3.4.scala:4:16 ---------------------------------------------------------------------
1
+ -- Warning: tests/warn/private-this-3.4.scala:4:9 - ---------------------------------------------------------------------
2
2
4 | private[this] def foo: Int = ??? // warn: migration warning
3
- | ^
4
- | Ignoring [this] qualifier.
5
- | This syntax will be deprecated in the future; it should be dropped.
6
- | See: https://docs.scala-lang.org/scala3/reference/dropped-features/this-qualifier.html
7
- | This construct can be rewritten automatically under -rewrite -source 3.4-migration.
8
- -- Warning: tests/warn/private-this-3.4.scala:5:18 ---------------------------------------------------------------------
3
+ | ^^^^^ ^
4
+ | Ignoring [this] qualifier.
5
+ | This syntax will be deprecated in the future; it should be dropped.
6
+ | See: https://docs.scala-lang.org/scala3/reference/dropped-features/this-qualifier.html
7
+ | This construct can be rewritten automatically under -rewrite -source 3.4-migration.
8
+ -- Warning: tests/warn/private-this-3.4.scala:5:11 ---------------------------------------------------------------------
9
9
5 | protected[this] def bar: Int = ??? // warn: migration warning
10
- | ^
11
- | Ignoring [this] qualifier.
12
- | This syntax will be deprecated in the future; it should be dropped.
13
- | See: https://docs.scala-lang.org/scala3/reference/dropped-features/this-qualifier.html
14
- | This construct can be rewritten automatically under -rewrite -source 3.4-migration.
10
+ | ^^^^^ ^
11
+ | Ignoring [this] qualifier.
12
+ | This syntax will be deprecated in the future; it should be dropped.
13
+ | See: https://docs.scala-lang.org/scala3/reference/dropped-features/this-qualifier.html
14
+ | This construct can be rewritten automatically under -rewrite -source 3.4-migration.
You can’t perform that action at this time.
0 commit comments