Skip to content

Commit 889a59c

Browse files
committed
self symbol is a local symbol
1 parent a7d8068 commit 889a59c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

compiler/src/dotty/tools/dotc/semanticdb/ExtractSemanticDB.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class ExtractSemanticDB extends Phase {
7373
/** Is symbol global? Non-global symbols get localX names */
7474
def isGlobal(sym: Symbol): Boolean =
7575
sym.is(Package)
76-
|| (sym.is(Param) || sym.owner.isClass) && isGlobal(sym.owner)
76+
|| !sym.isSelfSym && (sym.is(Param) || sym.owner.isClass) && isGlobal(sym.owner)
7777

7878
def addOwner(owner: Symbol): Unit =
7979
if !owner.isRoot && !owner.isEmptyPackage then addSymName(b, owner)

tests/semanticdb/Annotations.expect.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ import scala.annotation.meta._
55
import scala.language/*=>>scalaShadowing.language.*/.experimental/*=>>scalaShadowing.language.experimental.*/.macros/*=>>scalaShadowing.language.experimental.macros.*/
66

77
@ClassAnnotation
8-
class /*=>>java.lang.Object#`<init>`().*/Annotations/*<<=annot.Annotations#*/[@Type/*<<=annot.Annotations#`<init>`().*/ParameterAnnotation T/*<<=annot.Annotations#`<init>`().(T)*//*<<=annot.Annotations#(T)*/](@ParameterAnnotation x/*<<=annot.Annotations#`<init>`().(x)*//*<<=annot.Annotations#(x)*/: T/*=>>annot.Annotations#`<init>`().(T)*/) { self/*<<=annot.Annotations#self.*/: AnyRef/*=>>scala.AnyRef#*/ =>
8+
class /*=>>java.lang.Object#`<init>`().*/Annotations/*<<=annot.Annotations#*/[@Type/*<<=annot.Annotations#`<init>`().*/ParameterAnnotation T/*<<=annot.Annotations#`<init>`().(T)*//*<<=annot.Annotations#(T)*/](@ParameterAnnotation x/*<<=annot.Annotations#`<init>`().(x)*//*<<=annot.Annotations#(x)*/: T/*=>>annot.Annotations#`<init>`().(T)*/) { self/*<<=local0*/: AnyRef/*=>>scala.AnyRef#*/ =>
99
@FieldAnnotation
1010
val field/*<<=annot.Annotations#field.*/ = 42
1111

1212
@MethodAnnotation
1313
def method/*<<=annot.Annotations#method().*/ = {
1414
@LocalAnnotation
15-
val local/*<<=local0*/ = 42
16-
local/*=>>local0*/
15+
val local/*<<=local1*/ = 42
16+
local/*=>>local1*/
1717
}
1818
@TypeAnnotation
1919
type S/*<<=annot.Annotations#S#*/

0 commit comments

Comments
 (0)