diff --git a/gitnexus/src/core/ingestion/export-detection.ts b/gitnexus/src/core/ingestion/export-detection.ts index 926669c41..dc02f4c4c 100644 --- a/gitnexus/src/core/ingestion/export-detection.ts +++ b/gitnexus/src/core/ingestion/export-detection.ts @@ -205,7 +205,9 @@ const swiftExportChecker: ExportChecker = (node, _name) => { while (current) { if (current.type === 'modifiers' || current.type === 'visibility_modifier') { const text = current.text || ''; - if (/\bprivate\b|\bfileprivate\b/.test(text)) return false; + // Exclude private(set)/fileprivate(set) — only the setter is restricted, + // the symbol itself is still readable cross-file. + if (/\b(private|fileprivate)\b(?!\s*\()/.test(text)) return false; } current = current.parent; } diff --git a/gitnexus/src/core/ingestion/type-extractors/swift.ts b/gitnexus/src/core/ingestion/type-extractors/swift.ts index 8634dc4dd..70e673084 100644 --- a/gitnexus/src/core/ingestion/type-extractors/swift.ts +++ b/gitnexus/src/core/ingestion/type-extractors/swift.ts @@ -340,8 +340,11 @@ const extractForLoopBinding: ForLoopExtractor = (node, { scopeEnv, declarationTy if (!child) continue; if (child.type === 'pattern' || child.type === 'simple_identifier') { if (!loopVarName) { - // The loop variable - may be inside a pattern node or a direct simple_identifier - loopVarName = child.type === 'pattern' ? child.text : child.text; + // Extract a simple identifier from the pattern. Skip non-trivial patterns + // (e.g. tuple destructuring `for (a, b) in ...`) to avoid polluting scopeEnv. + const varName = extractVarName(child) ?? (child.type === 'simple_identifier' ? child.text : undefined); + if (!varName) return; // Non-simple pattern — bail out + loopVarName = varName; continue; } }