Skip to content

Commit

Permalink
bugfix: Make sure symbol exists before calling owner (#16860)
Browse files Browse the repository at this point in the history
  • Loading branch information
bishabosha authored Feb 8, 2023
2 parents 2fe4081 + 09ac6c2 commit 1fce02e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class ExtractSemanticDB extends Phase:
registerUseGuarded(None, privateWithin, spanOfSymbol(privateWithin, tree.span, tree.source), tree.source)
else if !excludeSymbol(tree.symbol) then
registerSymbol(tree.symbol, symbolKinds(tree))
case tree: Template if tree.symbol.owner.is(Invisible) =>
case tree: Template if tree.symbol != NoSymbol && tree.symbol.owner.is(Invisible) =>
// do nothing
// exclude the symbols and synthetics generated by @main annotation
// (main class generated by @main has `Invisible` flag, see `MainProxies.scala`).
Expand All @@ -201,7 +201,7 @@ class ExtractSemanticDB extends Phase:
val selfSpan = tree.self.span
if selfSpan.exists && selfSpan.hasLength then
traverse(tree.self)
if tree.symbol.owner.isEnumClass then
if tree.symbol != NoSymbol && tree.symbol.owner.isEnumClass then
tree.body.foreachUntilImport(traverse).foreach(traverse) // the first import statement
else
tree.body.foreach(traverse)
Expand Down

0 comments on commit 1fce02e

Please sign in to comment.