Skip to content

bugfix - preserve decorated callable defaults across aliases (#703)#704

Merged
dannymeijer merged 1 commit into
release/v0.3from
bugfix/703-decorated-default-callsite-filling
May 27, 2026
Merged

bugfix - preserve decorated callable defaults across aliases (#703)#704
dannymeijer merged 1 commit into
release/v0.3from
bugfix/703-decorated-default-callsite-filling

Conversation

@dannymeijer
Copy link
Copy Markdown
Contributor

Summary

This PR fixes callable default-argument preservation for decorated functions and methods when the decorated callable surface still matches the source declaration, including direct imports, public facade re-exports, alias re-exports, and alias-expanded Union[...] parameter surfaces. It also moves call-site signature selection toward one canonical merge path so source defaults and imported callable metadata do not diverge across module boundaries.

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: Decorated wrappers keep source default-argument calls when their final callable surface is unchanged. Calls such as imported or re-exported count() no longer lose defaults because the defining signature crossed a module boundary.
  • Internals: Function signature resolution now has a shared effective-call-signature merge path. The emitter supplies alias-aware type equivalence so transparent aliases and their expanded surfaces can inherit defaults without a decorator-only special case.
  • Risks: This touches function-call and method-call argument shaping, so regressions would most likely appear around default arguments, decorated callables, imported/re-exported functions, or alias-heavy callable signatures.

Testing / verification

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

Manual verification notes:

  • cargo test --test cli_integration test_decorated_functions_preserve_default_argument_calls_issue703 --features lsp
  • cargo test --test cli_integration test_imported_partial_preset_defaults_survive_decorator_argument_issue698 --features lsp
  • cargo test --test cli_integration test_decorator_callable_exposes_source_name_issue694 --features lsp
  • cargo test --test cli_integration issue70 --features lsp
  • cargo test --test cli_integration issue69 --features lsp
  • cargo test --test codegen_snapshot_tests user_defined_decorators
  • cargo test --test integration_tests e2e_imported_generic_decorator_factory_preserves_function_signatures
  • cargo test --test integration_tests e2e_method_call_decorator_factories_use_checked_receiver_lowering
  • git diff --check
  • make pre-commit

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 #703

@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) incan language semantics Suggestions, features, or bugs related to the Incan Language itself (syntax and semantics) tooling Suggestions, features, or bugs related to the Tooling (CLI/formatter/test runner) labels May 27, 2026
@dannymeijer dannymeijer self-assigned this May 27, 2026
@dannymeijer dannymeijer added this to the 0.3 Release milestone May 27, 2026
@dannymeijer dannymeijer marked this pull request as ready for review May 27, 2026 12:53
@dannymeijer dannymeijer merged commit 345aaab into release/v0.3 May 27, 2026
33 checks passed
@dannymeijer dannymeijer deleted the bugfix/703-decorated-default-callsite-filling branch May 27, 2026 12:55
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) incan language semantics Suggestions, features, or bugs related to the Incan Language itself (syntax and semantics) tooling Suggestions, features, or bugs related to the Tooling (CLI/formatter/test runner)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant