Skip to content

Commit 7045ea8

Browse files
committed
Fix variable references
1 parent 10b9247 commit 7045ea8

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,11 @@ class ExtractSemanticDB extends Phase {
3434
// Check not needed since it does not transform trees
3535
override def isCheckable: Boolean = false
3636

37-
override def run(implicit ctx: Context): Unit = {
37+
override def run(implicit ctx: Context): Unit =
3838
val unit = ctx.compilationUnit
3939
val extract = Extractor()
4040
extract.traverse(unit.tpdTree)
4141
ExtractSemanticDB.write(unit.source, extract.occurrences.toList)
42-
}
4342

4443
/** Extractor of symbol occurrences from trees */
4544
class Extractor extends TreeTraverser {
@@ -97,7 +96,7 @@ class ExtractSemanticDB extends Phase {
9796
addName(sym.name)
9897
if sym.is(Package) then b.append('/')
9998
else if sym.isType then b.append('#')
100-
else if sym.isRealMethod then
99+
else if sym.is(Method) && (!sym.is(Accessor) || sym.is(Mutable)) then
101100
b.append('('); addOverloadIdx(sym); b.append(").")
102101
else b.append('.')
103102

@@ -116,14 +115,15 @@ class ExtractSemanticDB extends Phase {
116115
idx
117116
locals.getOrElseUpdate(sym, computeLocalIdx())
118117

119-
if sym.isRoot then
120-
b.append("_root_")
121-
else if sym.isEmptyPackage then
122-
b.append("_empty_")
123-
else if isGlobal(sym) then
124-
addOwner(sym.owner); addDescriptor(sym)
125-
else
126-
b.append("local").append(localIdx(sym))
118+
if sym.exists then
119+
if sym.isRoot then
120+
b.append("_root_")
121+
else if sym.isEmptyPackage then
122+
b.append("_empty_")
123+
else if isGlobal(sym) then
124+
addOwner(sym.owner); addDescriptor(sym)
125+
else
126+
b.append("local").append(localIdx(sym))
127127
end addSymName
128128

129129
/** The semanticdb name of the given symbol */

0 commit comments

Comments
 (0)