Skip to content

bugfix - materialize imported decorator const str arguments (#638)#641

Merged
dannymeijer merged 1 commit into
release/v0.3from
bugfix/638-decorator-const-str-spans
May 22, 2026
Merged

bugfix - materialize imported decorator const str arguments (#638)#641
dannymeijer merged 1 commit into
release/v0.3from
bugfix/638-decorator-const-str-spans

Conversation

@dannymeijer
Copy link
Copy Markdown
Contributor

Summary

This PR fixes the remaining #638 decorator case where both the decorator factory and const str argument are imported. Decorator factory lowering now gives nested synthetic callees their own neutral span so span-keyed expression metadata for the full factory call cannot overwrite the callee signature needed by argument materialization.

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: Imported decorator factories now accept imported const str arguments in incan test, matching the intended InQL/RFC 014 authoring shape.
  • Internals: The full synthetic decorator factory call keeps the source decorator span for typechecker handoff, while its nested synthetic callee uses a neutral span to avoid span-keyed metadata collision.
  • Risks: Decorator lowering spans are touched for function and method decorators. Existing decorator codegen coverage plus the new imported factory regression test cover the affected path.

Testing / verification

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

Manual verification notes:

  • cargo test e2e_imported_decorator_factory_const_str_argument_materializes --test integration_tests -- --nocapture
  • cargo test e2e_imported_const_str_materializes_at_test_call_sites --test integration_tests -- --nocapture
  • cargo test user_defined --test codegen_snapshot_tests
  • 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): N/A

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

@incan-triage-bot incan-triage-bot Bot added 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 22, 2026
@dannymeijer dannymeijer self-assigned this May 22, 2026
@dannymeijer dannymeijer added this to the 0.3 Release milestone May 22, 2026
@dannymeijer dannymeijer marked this pull request as ready for review May 22, 2026 19:53
@dannymeijer dannymeijer merged commit 16f80d4 into release/v0.3 May 22, 2026
33 checks passed
@dannymeijer dannymeijer deleted the bugfix/638-decorator-const-str-spans branch May 22, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

bug - Decorator and imported const str arguments are not materialized as str call arguments

1 participant