Skip to content

Conversation

@zharinov
Copy link
Member

@zharinov zharinov commented Jan 1, 2026

Summary

  • Add QueryContext<'a> struct that bundles the commonly-passed analysis context (interner, type_ctx, symbol_table)
  • Add context() accessor to QueryAnalyzed for downstream modules
  • Refactor LinkedQuery to reuse LinkOutput instead of duplicating its fields

Motivation

Analysis of the compiler pipeline revealed that QueryAnalyzed already bundles the core context but doesn't expose it coherently. Downstream modules (compile, emit) extract these individually:

// Before: 6 separate extractions
Compiler::compile(
    query.interner(),
    query.type_context(),
    &query.symbol_table,
    ...
)

// After: unified context available
let ctx = query.context();

Additionally, LinkedQuery was duplicating LinkOutput fields instead of reusing the struct.

Test plan

  • All 677 lib tests pass
  • All 14 CLI tests pass

@zharinov zharinov enabled auto-merge (squash) January 1, 2026 19:45
@zharinov zharinov merged commit f05a5fc into master Jan 1, 2026
4 checks passed
@zharinov zharinov deleted the refactor/query-context branch January 1, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants