Skip to content

feat(mq-check): support piped builtin calls and self keyword type propagation#1370

Merged
harehare merged 2 commits intomainfrom
feat/mq-check-piped-self-constraint
Mar 2, 2026
Merged

feat(mq-check): support piped builtin calls and self keyword type propagation#1370
harehare merged 2 commits intomainfrom
feat/mq-check-piped-self-constraint

Conversation

@harehare
Copy link
Copy Markdown
Owner

@harehare harehare commented Mar 2, 2026

  • Fixes type inference for piped builtin calls in argument position (e.g. map(first()))
  • Adds support for 'self' keyword to unify with piped input type
  • Updates README external tool links
  • Adds integration tests for piped builtin calls and self keyword type propagation

…pagation

- Fixes type inference for piped builtin calls in argument position (e.g. map(first()))
- Adds support for 'self' keyword to unify with piped input type
- Updates README external tool links
- Adds integration tests for piped builtin calls and self keyword type propagation
Copilot AI review requested due to automatic review settings March 2, 2026 12:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the mq-check type inference engine to better handle piped builtin calls used in argument position (e.g. map(first())) and to propagate the piped input type through a self keyword, alongside small README link updates and new integration tests.

Changes:

  • Extend piped-input deferral logic to cover nested calls (to support map(first())-style higher-order usage).
  • Add special typing for self to unify with the piped input type.
  • Add integration tests for the above behaviors and update README external tool links.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
crates/mq-check/src/constraint.rs Adjusts piped-input deferral detection and adds self keyword typing behavior.
crates/mq-check/tests/integration_test.rs Adds integration tests for argument-position piped builtin calls and self propagation.
README.md Updates external tool links (mq-check) and adds mq-lsp entry.

if matches!(
parent.kind,
SymbolKind::Block | SymbolKind::Function(_) | SymbolKind::Macro(_)
SymbolKind::Block | SymbolKind::Function(_) | SymbolKind::Macro(_) | SymbolKind::Call
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Including SymbolKind::Call in might_receive_piped_input makes any nested call defer overload/arity errors (e.g. print(add("x")) could stop reporting "no matching overload" because the inner call’s parent is a Call). This broad deferral looks like a regression; consider narrowing the condition to only the specific scenario you intend (e.g., calls used as higher-order filter arguments with no explicit args), or add a dedicated predicate for that case rather than treating all parent Calls as pipe-capable.

Suggested change
SymbolKind::Block | SymbolKind::Function(_) | SymbolKind::Macro(_) | SymbolKind::Call
SymbolKind::Block | SymbolKind::Function(_) | SymbolKind::Macro(_)

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 2, 2026

@harehare I've opened a new pull request, #1371, to work on those changes. Once the pull request is ready, I'll request review from you.

@harehare harehare merged commit 3849289 into main Mar 2, 2026
6 checks passed
@harehare harehare deleted the feat/mq-check-piped-self-constraint branch March 2, 2026 13:06
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.

3 participants