Skip to content

Commit a1b5446

Browse files
authored
bugfix: Check if symbol exists before calling methods on it (#23376)
Fixes #23374
1 parent 61d9887 commit a1b5446

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
@@ -320,7 +320,7 @@ object ExtractSemanticDB:
320320
registerDefinition(tree.symbol, selectSpan(tree), Set.empty, tree.source)
321321
case tree => registerDefinition(tree.symbol, tree.span, Set.empty, tree.source)
322322
case tree: NamedDefTree =>
323-
if !tree.symbol.isAllOf(ModuleValCreationFlags) then
323+
if tree.symbol.exists && !tree.symbol.isAllOf(ModuleValCreationFlags) then
324324
tree match {
325325
case tree: ValDef if tree.symbol.isAllOf(EnumValue) =>
326326
tree.rhs match
@@ -379,7 +379,7 @@ object ExtractSemanticDB:
379379
traverseAnnotsOfDefinition(ctorSym)
380380
ctorParams(tree.constr.termParamss, tree.constr.leadingTypeParams, tree.body)
381381
registerDefinition(ctorSym, tree.constr.nameSpan.startPos, Set.empty, tree.source)
382-
case tree: Apply =>
382+
case tree: Apply if tree.fun.symbol.exists =>
383383
@tu lazy val genParamSymbol: Name => String = tree.fun.symbol.funParamSymbol
384384
traverse(tree.fun)
385385
synth.tryFindSynthetic(tree).foreach(synthetics.addOne)

0 commit comments

Comments
 (0)