ek9_unseal_type
Removes the 'allow only A, B, C' clause from a sealed class or trait, keeping its 'as open' / 'as abstract'; answers status and edits[] (one REPLACE on the declaration line), or conflicts[] (kind 'already-unsealed') when there is no clause.
When to use it
'Unseal Shape' is one call with symbol:'Shape' - no file or line needed. Use it when a sealed class or trait's `allow only ...` subtype set is no longer warranted and the type should be openly extensible again.
When not to use it
- ADDING an `allow only` clause (the opposite direction) - use
ek9_seal_type. - The type stays sealed but you want MORE subtypes in the existing allowlist — use
ek9_add_to_sealed_allowlist. - After unsealing, locking the (now-extensible) class down entirely — chain
ek9_make_closed(as open → closed) orek9_make_concrete(as abstract → concrete).
Details
Class or trait targets only (a record/component/function target errors); a target that is not sealed is status:conflicts with kind 'already-unsealed'. The extensibility modifier is always preserved (sealed classes require `as open` OR `as abstract` per E05270; traits carry none). Unsealing is a WIDENING change — existing subtypes were all in the removed allowlist so they keep compiling, and prior E05240 blocks on new extensions are resolved. The design cost is that dispatchers over the target silently lose compile-time exhaustiveness per E05260 (new subtypes then hit the default fallback) — check ek9_query_dispatchers before committing.
Arguments
| Argument | Type | Required | What it is |
|---|---|---|---|
file | string | The EK9 source file - OPTIONAL when symbol is a construct name; required to anchor on a member or a use site. | |
line | integer | 1-based line of the declaration or a reference - OMIT it and pass symbol:'<name>' to let the tool find the line (a model counting lines in a file miscounts); if you do count, use ek9_read_file(lineNumbers:true). | |
symbol | string | A construct NAME alone ('Shape', 'sample.deps.core::Validator') - no file needed, the tool finds it workspace-wide; or, with file (+ line), the identifier you mean there. |
It also takes the arguments every tool takes.
See also
- Show me in the IDE: Unseal Type / Add to Allowlist
- Fixes E05240