Thanks for reporting! Please include a minimal reproduction when possible.
Area
- Incan Language (syntax/semantics)
- Compiler (frontend/backend/codegen)
Summary
Expected: a top-level pub partial callable preset should be importable from another module like any other public callable symbol. Imported call sites should preserve the preset keyword arguments and expose only the remaining callable surface.
Actual: an imported public partial preset is rejected as private or not exported. In the larger InQL PR #44 fix attempt, using imported partial presets for registry spec builders also caused downstream generated Rust to treat the preset as the full underlying constructor rather than the narrowed callable surface.
Reproduction steps
- Create
src/presets.incn:
pub model Spec:
pub namespace: str
pub policy: str
pub klass: str
pub lifecycle: str
"""Build a core portable spec."""
pub core_spec = partial Spec(namespace="core", policy="portable")
- Create
tests/test_imported_partial.incn:
from presets import core_spec
def test_imported_partial_preset_keeps_presets() -> None:
spec = core_spec(klass="scalar", lifecycle="v1")
assert spec.namespace == "core"
assert spec.policy == "portable"
assert spec.klass == "scalar"
assert spec.lifecycle == "v1"
- Run:
incan test tests/test_imported_partial.incn
Output / logs
Code generation error: typecheck failed (1 errors): Cannot import `core_spec` from `presets`: it is private or not exported. Mark it `pub` in that module.
Environment
OS: macOS
Rust: current project toolchain
Incan: 0.3.0-rc17, release/v0.3
Command: incan test tests/test_imported_partial.incn
Context: surfaced while fixing InQL PR #44 registry helper indirection by trying to replace simple spec-builder wrappers with partial FunctionSpec(...) presets.
Thanks for reporting! Please include a minimal reproduction when possible.
Area
Summary
Expected: a top-level
pubpartial callable preset should be importable from another module like any other public callable symbol. Imported call sites should preserve the preset keyword arguments and expose only the remaining callable surface.Actual: an imported public partial preset is rejected as private or not exported. In the larger InQL PR #44 fix attempt, using imported partial presets for registry spec builders also caused downstream generated Rust to treat the preset as the full underlying constructor rather than the narrowed callable surface.
Reproduction steps
src/presets.incn:tests/test_imported_partial.incn:incan test tests/test_imported_partial.incnOutput / logs
Environment
OS: macOS
Rust: current project toolchain
Incan: 0.3.0-rc17, release/v0.3
Command:
incan test tests/test_imported_partial.incnContext: surfaced while fixing InQL PR #44 registry helper indirection by trying to replace simple spec-builder wrappers with
partial FunctionSpec(...)presets.