Skip to content

bugfix - preserve expected types for vocab generic calls (#735)#737

Merged
dannymeijer merged 1 commit into
release/v0.3from
bugfix/735-vocab-expected-type-propagation
Jun 1, 2026
Merged

bugfix - preserve expected types for vocab generic calls (#735)#737
dannymeijer merged 1 commit into
release/v0.3from
bugfix/735-vocab-expected-type-propagation

Conversation

@dannymeijer
Copy link
Copy Markdown
Contributor

Summary

This PR preserves contextual expected return types across generic call planning so expression-position vocab desugar output gets the same generic retargeting as equivalent source calls. This fixes DSL-generated calls such as orders.select(...) inferring the source row model instead of the expected output row model.

Type of change

  • Bug fix
  • New feature
  • Refactor / maintenance
  • Documentation
  • CI / tooling
  • RFC (adds/updates docs/RFCs/*)

Area(s)

Select the primary areas touched (used for review routing; labels are managed separately):

  • Incan Language (syntax/semantics)
  • Compiler (frontend/backend/codegen)
  • Tooling (CLI/formatter/test runner)
  • Editor integration (LSP/VS Code extension)
  • Runtime / Core crates (stdlib/core/derive)
  • Documentation

Key details

  • User-facing behavior: Expression-position vocab blocks can desugar to generic function, helper, and method calls that use the same expected output type context as direct source.
  • Internals: Added one explicit expected-return path through call checking, generic function validation, callable-value calls, stdlib module calls, and generic method validation; vocab output uses that shared planner rather than a special case.
  • Risks: This touches shared generic call inference. The main risk is changing when contextual return hints bind type parameters before argument checking, so the PR includes a vocab integration regression and full release-gate verification.

Testing / verification

  • make test / cargo test
  • make examples (if relevant)
  • incan fmt --check . (if relevant)
  • Manual verification described below

Manual verification notes:

  • cargo test --locked consumer_check_desugared_generic_method_call_uses_expected_return_type_issue735 --test integration_tests -- --nocapture
  • cargo test --locked consumer_check_desugared_public_field_callee_call_typechecks_as_method_issue727 --test integration_tests -- --nocapture
  • cargo test --locked --test cli_integration run_types_rust_callback_closures_in_every_match_arm_issue733 -- --nocapture
  • cargo test --locked -p incan --lib generic_method -- --nocapture
  • cargo fmt --check
  • git diff --check
  • make pre-commit (full gate, including smoke-test-fast and benchmark build checks)

Docs impact

  • No docs changes needed
  • Docs updated
  • Docs follow Divio intent (tutorial/how-to/reference/explanation) where applicable

If docs updated:

  • Link(s): workspaces/docs-site/docs/release_notes/0_3.md

Checklist

  • I kept public docs user-focused and moved internals to contributing docs when appropriate
  • I avoided duplicating canonical install/run instructions in multiple places
  • I added/updated tests where it materially reduces regressions

Closes #735

@incan-triage-bot incan-triage-bot Bot added documentation Improvements or additions to documentation incan compiler Suggestions, features, or bugs related to the Compiler (frontend/backend/codegen) labels Jun 1, 2026
@dannymeijer dannymeijer marked this pull request as ready for review June 1, 2026 14:45
@dannymeijer dannymeijer self-assigned this Jun 1, 2026
@dannymeijer dannymeijer added this to the 0.3 Release milestone Jun 1, 2026
@dannymeijer dannymeijer merged commit e9e8515 into release/v0.3 Jun 1, 2026
34 checks passed
@dannymeijer dannymeijer deleted the bugfix/735-vocab-expected-type-propagation branch June 1, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation incan compiler Suggestions, features, or bugs related to the Compiler (frontend/backend/codegen)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant