diff --git a/scip_indexer/SCIPIndexer.cc b/scip_indexer/SCIPIndexer.cc index 89573c961..cd4b265d1 100644 --- a/scip_indexer/SCIPIndexer.cc +++ b/scip_indexer/SCIPIndexer.cc @@ -924,8 +924,9 @@ class CFGTraversal final { auto [namedSym, _] = symRef.value(); auto check = isMethodFileStaticInit || - method == gs.lookupStaticInitForClass(namedSym.asSymbolRef().asClassOrModuleRef().data(gs)->owner, - /*allowMissing*/ true); + (namedSym.kind() != GenericSymbolRef::Kind::Field && + method == gs.lookupStaticInitForClass(namedSym.asSymbolRef().asClassOrModuleRef().data(gs)->owner, + /*allowMissing*/ true)); absl::Status status; string kind; if (check) {