File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
compiler/src/dotty/tools/dotc/semanticdb Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -286,6 +286,14 @@ object ExtractSemanticDB:
286286 || sym.owner == defn.OpsPackageClass
287287 || qualifier.exists(excludeQual)
288288
289+ /** This block is created by lifting i.e. EtaExpansion */
290+ private def isProbablyLifted (block : Block )(using Context ) =
291+ def isSyntheticDef (t : Tree ) =
292+ t match
293+ case t : (ValDef | DefDef ) => t.symbol.isSyntheticWithIdent
294+ case _ => false
295+ block.stats.forall(isSyntheticDef)
296+
289297 private def traverseAnnotsOfDefinition (sym : Symbol )(using Context ): Unit =
290298 for annot <- sym.annotations do
291299 if annot.tree.span.exists
@@ -438,6 +446,12 @@ object ExtractSemanticDB:
438446 registerUseGuarded(None , sym, tree.span, tree.source)
439447 case _ => ()
440448
449+ // If tree is lifted, ignore Synthetic status on all the definitions and traverse all childrens
450+ case tree : Block if isProbablyLifted(tree) =>
451+ tree.stats.foreach:
452+ case t : (ValDef | DefDef ) if ! excludeChildren(t.symbol) => traverseChildren(t)
453+ case _ => ()
454+ traverse(tree.expr)
441455
442456 case _ =>
443457 traverseChildren(tree)
You can’t perform that action at this time.
0 commit comments