Skip to content

Commit 09ac6c2

Browse files
committed
bugfix: Make sure symbol exists before calling owner
1 parent 04f5a0b commit 09ac6c2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ class ExtractSemanticDB extends Phase:
190190
registerUseGuarded(None, privateWithin, spanOfSymbol(privateWithin, tree.span, tree.source), tree.source)
191191
else if !excludeSymbol(tree.symbol) then
192192
registerSymbol(tree.symbol, symbolKinds(tree))
193-
case tree: Template if tree.symbol.owner.is(Invisible) =>
193+
case tree: Template if tree.symbol != NoSymbol && tree.symbol.owner.is(Invisible) =>
194194
// do nothing
195195
// exclude the symbols and synthetics generated by @main annotation
196196
// (main class generated by @main has `Invisible` flag, see `MainProxies.scala`).
@@ -201,7 +201,7 @@ class ExtractSemanticDB extends Phase:
201201
val selfSpan = tree.self.span
202202
if selfSpan.exists && selfSpan.hasLength then
203203
traverse(tree.self)
204-
if tree.symbol.owner.isEnumClass then
204+
if tree.symbol != NoSymbol && tree.symbol.owner.isEnumClass then
205205
tree.body.foreachUntilImport(traverse).foreach(traverse) // the first import statement
206206
else
207207
tree.body.foreach(traverse)

0 commit comments

Comments
 (0)