A Result error type needs an annotation when inference cannot determine it Adopted November 9, 2026 · 6.0.0 · Being verified
Problem The success value may be visible without enough information to know which error type the function returns. A wide fallback would hide the constraint at call sites.
Decision If inference cannot determine the error type, checking reports TPZ5022 and asks for a type annotation.
Examples
An unknown Result error type requires an annotation reject · check · Verification · not-run
main.tpz An unknown Result error type requires an annotation function value () { Ok( 1 ) } let result = value () Expected output Nonzero exit
No stdout. Expected result Expected result Rejection during check. Nonzero exit.
No stdout.
This exact example has not been executed.
A Result return annotation fixes the error type run · runtime · Verification · not-run
main.tpz A Result return annotation fixes the error type Open in Playground → import std.io function value () -> Result < int , string > { Ok( 1 ) } let result = match ( value ()) { case Ok(number) => number case Err(_) => 0 } io. writeLine ( "{result}" ) Expected output Exit code 0
1
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Alternatives considered Fall back to a dynamic value type. The return contract would no longer identify the possible error type.Introduce a new diagnostic code. Return inference already has the rule and the code, so one form suffices.Why The same diagnostic as return inference identifies the annotation to add.
Changed rules Annotating an unresolved Result error type →
Partly answered pending items Return inference and nested callable contexts →
A callback returns its own propagated error Adopted November 10, 2026 · 6.0.0 · Being verified
Problem A lambda passed to map can use ?. Callers need to know whether that completes the lambda or leaves an enclosing function.
Decision When ? propagates from a lambda or callback, return Result or Option from that call. If the Result error type cannot be inferred, checking reports TPZ5022 and requires a type annotation. Examples
Mapping a propagating lambda produces an array of Results run · runtime · Verification · not-run
main.tpz Mapping a propagating lambda produces an array of Results Open in Playground → import std.io function surrounding () -> int { let inputs: Array < Result < int , string >> = [Ok( 1 ), Err( "stop" ), Ok( 3 )] let advance: ( Result < int , string > ) -> Result < int , string > = (value) => { let number = value ? io. writeLine ( "lambda {number}" ) Ok(number + 1 ) } let results: Array < Result < int , string >> = inputs. map (advance) io. writeLine ( "after map" ) for result in (results) { match (result) { case Ok(number) => io. writeLine ( "ok {number}" ) case Err(error) => io. writeLine ( "err {error}" ) } } 7 } io. writeLine ( "{ surrounding ()}" ) Expected output Exit code 0
lambda 1
lambda 3
after map
ok 2
err stop
ok 4
7
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout lambda 1 lambda 3 after map ok 2 err stop ok 4 7 This exact example has not been executed.
None returns from its lambda while the caller continues run · runtime · Verification · not-run
main.tpz None returns from its lambda while the caller continues import std.io let advance: ( Option < int > ) -> Option < int > = (value) => { let number = value ? io. writeLine ( "some {number}" ) Some(number + 1 ) } let missing = advance (None()) io. writeLine ( "after none" ) match (missing) { case Some(number) => io. writeLine ( "{number}" ) case None() => io. writeLine ( "none" ) } let present = advance (Some( 2 )) match (present) { case Some(number) => io. writeLine ( "{number}" ) case None() => io. writeLine ( "none" ) } Expected output Exit code 0
after none
none
some 2
3
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
An integer-returning lambda cannot propagate a Result reject · check · Verification · not-run
main.tpz An integer-returning lambda cannot propagate a Result Open in Playground → let read: ( Result < int , string > ) -> int = (value) => { value ? } Expected output Nonzero exit
No stdout. Expected result Expected result Rejection during check. Nonzero exit.
No stdout.
This exact example has not been executed.
Alternatives considered Return nonlocally from the enclosing function. The function invoking the callback would have to handle nonlocal control flow.Leave the destination of ? unspecified. Each function boundary needs one destination for ? so the same code reads the same way.Why The nearest callable body tells readers where ? returns.
Changed rules Propagation returns from the current callable →
Resolved pending items Return inference and nested callable contexts →
An empty concurrent group returns an empty record Adopted November 7, 2026 · 6.0.0 · Being verified
Problem Each concurrent arm contributes a result field. The language needs a result for a group with no arms as well.
Decision A concurrent group with no arms produces an empty record. In a type position, {} denotes the empty record type. As an expression it is still a block that returns unit. Examples
An untimed group may have no arms check · checking · Verification · not-run
example.tpz An untimed group may have no arms let joined = concurrent {} Expected output Exit code 0
No stdout. Expected result Expected result Checking accepts the program. Exit code 0.
No stderr.
No stdout.
This exact example has not been executed.
An empty concurrent record passes through an explicit record signature run · runtime · Verification · not-run
example.tpz An empty concurrent record passes through an explicit record signature import std.io function keep (value: {}) -> {} { value } let joined: {} = keep ( concurrent {}) io. writeLine ( "completed" ) Expected output Exit code 0
completed
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
The zero-field record is distinct from unit reject · checking · Verification · not-run
example.tpz The zero-field record is distinct from unit let joined: () = concurrent {} Expected output Nonzero exit
No stdout. Expected result Expected result Rejection during check. Nonzero exit.
No stdout.
This exact example has not been executed.
Alternatives considered Require at least one arm. The result rule would need a special case at zero arms.Why The arm-to-field relationship also holds for an empty group.
Changed rules Concurrent groups may contain zero arms →
A timeout evaluates a Duration expression once Adopted November 7, 2026 · 6.0.0 · Being verified
Problem A program may read its timeout from a setting or calculate it. Literal-only syntax would require rewriting code that already has the same duration as a value.
Decision Accept an ordinary Duration expression. Evaluate it once before starting the deadline and the arms.
Examples
Parentheses preserve a timeout value run · runtime · Verification · not-run
example.tpz Parentheses preserve a timeout value import std.io let joined = concurrent (timeout: ( 0 ms)) { value: 1 } else { { value: 7 } } io. writeLine ( "{joined.value}" ) Expected output Exit code 0
7
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
A bound Duration is the same timeout value run · runtime · Verification · not-run
example.tpz A bound Duration is the same timeout value import std.io let budget: Duration = 0 ms let joined = concurrent (timeout: budget) { value: 1 } else { { value: 7 } } io. writeLine ( "{joined.value}" ) Expected output Exit code 0
7
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Evaluate the timeout once before any arm run · runtime · Verification · not-run
example.tpz Evaluate the timeout once before any arm import std.io function budget () -> Duration { io. writeLine ( "budget" ) 0 ms } let joined = concurrent (timeout: budget ()) { value: { io. writeLine ( "arm" ) 1 } } else { io. writeLine ( "fallback" ) { value: 7 } } io. writeLine ( "{joined.value}" ) Expected output Exit code 0
budget
fallback
7
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
An integer does not implicitly become Duration reject · checking · Verification · not-run
example.tpz An integer does not implicitly become Duration let joined = concurrent (timeout: 1 ) { value: 1 } else { { value: 7 } } Expected output Exit code 1
No stdout. Expected result Expected result Rejection during check. Exit code 1.
No stdout.
This exact example has not been executed.
Alternatives considered Accept a literal only, as now. The same value would be rejected for being written with parentheses or a name.Accept constant expressions only. An expression that computes the same value should be accepted too.Why Timeout arithmetic uses ordinary expressions with a defined evaluation point.
Changed rules A timeout accepts a Duration expression →
A deadline wins when completion coincides with it Adopted November 7, 2026 · 6.0.0 · Being verified
Problem An arm may finish at the instant its deadline expires. The result depends on which event takes precedence.
Decision A timeout wins when completion coincides with the deadline. The rule also covers zero milliseconds. Declaration order gives no priority to faults that occur simultaneously. Examples
Zero duration takes the fallback for one ready arm run · runtime · Verification · not-run
example.tpz Zero duration takes the fallback for one ready arm import std.io let joined = concurrent (timeout: 0 ms) { value: 1 } else { { value: 7 } } io. writeLine ( "{joined.value}" ) Expected output Exit code 0
7
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Zero duration takes the complete fallback for multiple ready arms run · runtime · Verification · not-run
example.tpz Zero duration takes the complete fallback for multiple ready arms Open in Playground → import std.io let joined = concurrent (timeout: 0 ms) { left: 1 right: 2 } else { { left: 7 , right: 8 } } io. writeLine ( "{joined.left}:{joined.right}" ) Expected output Exit code 0
7:8
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
A zero-duration fallback can raise its own runtime fault run · runtime · Verification · not-run
example.tpz A zero-duration fallback can raise its own runtime fault function divide (divisor: int ) -> int { 42 / divisor } let joined = concurrent (timeout: 0 ms) { value: 1 } else { { value: divide ( 0 ) } } Expected output Exit code 1
No stdout. Expected result Expected result Rejection during run. Exit code 1.
No stdout.
This exact example has not been executed.
Alternatives considered Let a completion seen on the final poll win. The outcome would depend on polling timing instead of the deadline boundary.Leave the result of a deadline race unspecified. The result of 0ms and simultaneous completion must be fixed for a program to repeat its result.Why Code can predict the timeout result at the boundary.
Changed rules Deadline priority and competing faults →
Resolved pending items Zero duration and competing outcomes →
A concurrent arm cannot transfer control out of its boundary Adopted November 7, 2026 · 6.0.0 · Being verified
Problem If one concurrent arm returns from an outer function, the behavior of its siblings also needs a rule. Control transfers entirely within the arm do not have that problem.
Decision Reject return, loop control and error propagation statically when their target lies outside the arm.
Examples
Called functions and inner loops consume their own control transfer run · running · Verification · not-run
example.tpz Called functions and inner loops consume their own control transfer Open in Playground → import std.io function advance (value: Result < int , string > ) -> Result < int , string > { let number: int = value ? return Ok(number + 1 ) } let joined = concurrent { result: advance (Err( "missing" )) count: { let mut count = 0 while (count < 3 ) { count += 1 if (count < 3 ) { continue } break } count } } match (joined.result) { case Ok(_) => io. writeLine ( "unexpected" ) case Err(message) => io. writeLine (message) } io. writeLine ( "{joined.count}" ) Expected output Exit code 0
missing
3
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
An arm cannot return from its enclosing function reject · checking · Verification · not-run
example.tpz An arm cannot return from its enclosing function function escape () -> int { let joined = concurrent { value: { return 1 } } 0 } Expected output Nonzero exit
No stdout. Expected result Expected result Rejection during check. Nonzero exit.
No stdout.
This exact example has not been executed.
An arm cannot break its enclosing loop reject · checking · Verification · not-run
example.tpz An arm cannot break its enclosing loop while ( true ) { let joined = concurrent { value: { break } } break } Expected output Nonzero exit
No stdout. Expected result Expected result Rejection during check. Nonzero exit.
No stdout.
This exact example has not been executed.
An arm cannot continue its enclosing loop reject · checking · Verification · not-run
example.tpz An arm cannot continue its enclosing loop while ( true ) { let joined = concurrent { value: { continue } } break } Expected output Nonzero exit
No stdout. Expected result Expected result Rejection during check. Nonzero exit.
No stdout.
This exact example has not been executed.
An arm cannot propagate a Result to its enclosing function reject · checking · Verification · not-run
example.tpz An arm cannot propagate a Result to its enclosing function function escape (value: Result < int , string > ) -> Result < int , string > { let joined = concurrent { result: value ? } Ok( 0 ) } Expected output Nonzero exit
No stdout. Expected result Expected result Rejection during check. Nonzero exit.
No stdout.
This exact example has not been executed.
Alternatives considered Cancel sibling arms when control leaves the arm. One return would need additional rules for both the outer destination and sibling cancellation.Define return and Result for an arm itself. It would not match the current runtime arm boundary and would need new control semantics.Why Readers can reason about each arm's control flow independently.
Changed rules Each arm has its own control boundary →
Resolved pending items Control transfer and propagation across an arm boundary →
A timed group falls back even when a branch never finishes Adopted November 9, 2026 · 6.0.0 · Being verified
Problem A branch may run in an infinite loop or recurse without returning. The caller needs to know both when the group can end and which external effects survive.
Decision A timed concurrent group takes its fallback when the deadline expires. A host call already in progress runs to completion. Effects that already happened remain, and abandoned branches have no further effects after the group ends. Untimed groups make no fairness guarantee. Examples
A positive deadline ends an infinite loop run · runtime · Verification · not-run
main.tpz A positive deadline ends an infinite loop Open in Playground → import std.io let joined = concurrent (timeout: 1 ms) { value: { while ( true ) {} 0 } } else { io. writeLine ( "fallback" ) { value: 7 } } io. writeLine ( "{joined.value}" ) Expected output Exit code 0
fallback
7
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Alternatives considered Interrupt a host call at the deadline. This would impose a separate interruption guarantee on synchronous host calls.Guarantee fair scheduling for untimed groups. Routine code would pay for yield checks even without a timeout.Why A timeout gives callers a way out when a branch never completes.
Changed rules Timed group progress →
Partly answered pending items Deferred cleanup in abandoned arms →
A branch abandoned at the deadline skips user cleanup Adopted November 10, 2026 · 6.0.0 · Being verified
Problem Cleanup in a concurrent branch can itself take a long time or get stuck. The caller also needs to know what happens to a file the abandoned branch opened.
Decision An abandoned concurrent branch skips its remaining defer and using cleanup. Language cleanup runs on normal exit and on return, break, continue, or error propagation through ?. The runtime reclaims host resources opened by the abandoned branch when the group ends. Examples
An abandoned arm skips its registered defer run · runtime · Verification · not-run
main.tpz An abandoned arm skips its registered defer Open in Playground → import std.io let joined = concurrent (timeout: 1 ms) { value: { defer { io. writeLine ( "abandoned cleanup" ) } while ( true ) {} 0 } } else { io. writeLine ( "fallback" ) { value: 7 } } Expected output Exit code 0
fallback
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
A normally completed arm runs its defer before the result run · runtime · Verification · not-run
main.tpz A normally completed arm runs its defer before the result Open in Playground → import std.io let joined = concurrent (timeout: 10 s) { value: { defer { io. writeLine ( "completed cleanup" ) } 7 } } else { io. writeLine ( "fallback" ) { value: 0 } } io. writeLine ( "{joined.value}" ) Expected output Exit code 0
completed cleanup
7
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Completed cleanup followed by an abandoned arm run · runtime · Verification · not-run
main.tpz Completed cleanup followed by an abandoned arm Open in Playground → import std.io let completed = concurrent { value: { defer { io. writeLine ( "completed cleanup" ) } 1 } } let abandoned = concurrent (timeout: 1 s) { value: { defer { io. writeLine ( "abandoned cleanup" ) } while ( true ) {} 0 } } else { io. writeLine ( "fallback" ) { value: 0 } } Expected output Exit code 0
completed cleanup
fallback
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout completed cleanup fallback This exact example has not been executed.
Alternatives considered Run cleanup in the abandoned branch. A stuck cleanup could keep the group open past its deadline.Leave cleanup up to the implementation. The same program could produce different cleanup effects on different targets.Why A stalled cleanup in an abandoned branch cannot delay the caller further.
Changed rules Deadline abandonment skips language cleanup →Runtime reclamation of abandoned arm handles →
Resolved pending items Deferred cleanup in abandoned arms →
Entry files and imported modules use the same statement rules Adopted November 7, 2026 · 6.0.0 · Being verified
Problem A statement could run in an entry file and be skipped after that file was imported. Changing the file's role meant relearning when initialization happened.
Decision Use the same top-level statement rules for entry files and imports. Initialize dependencies first, then ready modules in name order. Initialize each module once per execution and reject cycles before initialization with TPZ3006. Examples
Free calls, assignments, and loops in an entry run · runtime · Verification · not-run
helpers.tpz Free calls, assignments, and loops in an entry Open in Playground → import std.io export let value: int = 1 let mut count: int = 0 io. writeLine ( "free" ) for item in ([ 1 ]) { count = count + item io. writeLine ( "loop" ) } io. writeLine ( "{count}" ) Expected output Exit code 0
free
loop
1
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
run · runtime · Verification · not-run
main.tpz The same source file imported import helpers import std.io io. writeLine ( "{helpers.value}" ) Expected output Exit code 0
free
loop
1
1
helpers.tpz The same source file imported import std.io export let value: int = 1 let mut count: int = 0 io. writeLine ( "free" ) for item in ([ 1 ]) { count = count + item io. writeLine ( "loop" ) } io. writeLine ( "{count}" ) Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Alternatives considered Require a separate initialization function for imported files. Identical work would need different syntax in an entry file and a module.Keep filtering statements in imported files as before. Statement rules would differ by file role.Why The same source rules say which statements run when a file is imported.
Changed rules The same statements in every source file →Dependency order and one initialization →Reject cycles before initialization →
User code cannot name compiler-generated declarations Adopted November 20, 2026 · 6.0.0 · In progress
Problem The standard module std. lispex contains _ _ Prepared Lispex Rule Carrier, a type the compiler generates to implement the module's rule factories. When user code imported that name with import std. lispex { _ _ Prepared Lispex Rule Carrier }, the compiler stopped with an internal error instead of a diagnostic. No rule said whether user code could name a compiler-generated declaration.
Decision User code cannot name a declaration the compiler generates. This covers generated declarations in a standard module whose names start with _ _. The type of such a declaration reaches the public surface only through a public alias of that module, such as Prepared Lispex Rule, and that alias does not count as exposing a private type (TPZ3014). When user code asks for such a name through a selected import or a namespace path, it gets TPZ3009 during name resolution, the same diagnostic as any other name the module does not export. It never becomes an internal error. Only the implementation inside the same standard module and compiler-generated code use a generated declaration. A declaration with the same spelling in user code follows the ordinary rules, independent of this decision. Alternatives considered Let user code name generated declarations. An implementation detail would become a user contract. In the current implementation, making this name public also stops working programs with an internal error.Leave an import of a generated name as an internal error. An internal compiler error caused by user code breaks the diagnostic contract.Why The public surface is a contract users can rely on. If names the compiler generates for its implementation leak out, every change to that implementation breaks user programs.
Changed rules Public and private declarations →Namespace imports and selected exports →Visibility through a namespace →
Export let binds names with an ordinary pattern Adopted November 7, 2026 · 6.0.0 · Being verified
Problem Exporting several destructured values one at a time can repeat initialization. The same pattern is useful whether its names are private or public.
Decision Use an ordinary immutable let pattern in export let. Export every name it binds. Initialize once and install the bindings after a full match. Check their public types. A pattern binding no names produces TPZ2007. Examples
Export every record binding after one initializer run · runtime · Verification · not-run
main.tpz Export every record binding after one initializer import lib import std.io { writeLine } writeLine ( "{lib.first}" ) writeLine ( "{lib.second}" ) Expected output Exit code 0
init
10
20
lib.tpz Export every record binding after one initializer import std.io { writeLine } function make () -> { first: int , second: int } { writeLine ( "init" ) { first: 10 , second: 20 } } export let { first: first, second: second } = make () Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
An outer pattern annotation supplies each public binding type check · checking · Verification · not-run
main.tpz An outer pattern annotation supplies each public binding type import lib { count, label } let number: int = count let text: string = label Expected output Exit code 0
No stdout. lib.tpz An outer pattern annotation supplies each public binding type export let { nested: { count: count }, label: label }: { nested: { count: int }, label: string } = { nested: { count: 4 }, label: "four" } Expected result Expected result Checking accepts the program. Exit code 0.
No stderr.
No stdout.
This exact example has not been executed.
Export names from an ordinary nominal record pattern run · runtime · Verification · not-run
main.tpz Export names from an ordinary nominal record pattern import lib import std.io { writeLine } writeLine ( "{lib.first + lib.second}" ) Expected output Exit code 0
42
lib.tpz Export names from an ordinary nominal record pattern record Pair { first: int , second: int } export let Pair { first: first, second: second } = Pair { first: 20 , second: 22 } Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Use plain let when a pattern publishes no binding reject · parse · Verification · not-run
main.tpz Use plain let when a pattern publishes no binding Open in Playground → Expected output Nonzero exit
No stdout. Expected result Expected result Rejection during parse. Nonzero exit.
No stdout.
This exact example has not been executed.
Export preserves the ordinary refutable-let rejection reject · checking · Verification · not-run
main.tpz Export preserves the ordinary refutable-let rejection let maybe: Option < int > = None() export let Some(value) = maybe Expected output Nonzero exit
No stdout. Expected result Expected result Rejection during check. Nonzero exit.
No stdout.
This exact example has not been executed.
Each bound name must have a public resolved type reject · resolve · Verification · not-run
main.tpz Each bound name must have a public resolved type import lib let observed = lib.count Expected output Nonzero exit
No stdout. lib.tpz Each bound name must have a public resolved type record Hidden { value: int } export let { item: item, count: count } = { item: Hidden { value: 1 }, count: 2 } Expected result Expected result Rejection during resolve. Nonzero exit.
No stdout.
This exact example has not been executed.
Alternatives considered Allow one name per exported let. Destructuring and declaration would need to be repeated to export the same data.Name the exported bindings in a separate export list. Exporting should not require rewriting the destructuring.Why The structure used to unpack a value remains visible in its exports.
Changed rules The shape of an exported binding →Exported bindings are immutable →
Public declarations are checked after type resolution Adopted November 7, 2026 · 6.0.0 · Being verified
Problem An exported function can state its type or let the compiler infer it. The choice should not affect whether it exposes a private type.
Decision Check the resolved types of public declarations. Exposing a module-private nominal type produces TPZ3014. A transparent alias is allowed if its expanded type is public. Examples
An explicit public result cannot expose a private nominal type reject · resolve · Verification · not-run
main.tpz An explicit public result cannot expose a private nominal type import lib let value = lib. make () Expected output Nonzero exit
No stdout. lib.tpz An explicit public result cannot expose a private nominal type record Hidden { value: int } export function make () -> Hidden { Hidden { value: 7 } } Expected result Expected result Rejection during resolve. Nonzero exit.
No stdout.
This exact example has not been executed.
An inferred public result obeys the same visibility rule reject · resolve · Verification · not-run
main.tpz An inferred public result obeys the same visibility rule import lib let value = lib. make () Expected output Nonzero exit
No stdout. lib.tpz An inferred public result obeys the same visibility rule record Hidden { value: int } export function make () { Hidden { value: 7 } } Expected result Expected result Rejection during resolve. Nonzero exit.
No stdout.
This exact example has not been executed.
An alias expansion cannot hide a private nominal result reject · resolve · Verification · not-run
main.tpz An alias expansion cannot hide a private nominal result import lib let value = lib. make () Expected output Nonzero exit
No stdout. lib.tpz An alias expansion cannot hide a private nominal result record Hidden { value: int } type Alias = Hidden export function make () -> Alias { Hidden { value: 7 } } Expected result Expected result Rejection during resolve. Nonzero exit.
No stdout.
This exact example has not been executed.
A private alias of a public type is transparent check · checking · Verification · not-run
main.tpz A private alias of a public type is transparent import lib let value: int = lib. count () Expected output Exit code 0
No stdout. lib.tpz A private alias of a public type is transparent type Count = int export function count () -> Count { 1 } Expected result Expected result Checking accepts the program. Exit code 0.
No stderr.
No stdout.
This exact example has not been executed.
Alternatives considered Require annotations on every exported declaration. Developers would have to repeat a result the compiler can already infer.Keep checking only the written syntax instead of the resolved type. The result should not depend on whether an annotation was written.Why Visibility follows the actual type independently of annotation style.
Changed rules Resolved public type visibility →
Record defaults follow export visibility Adopted November 7, 2026 · 6.0.0 · Being verified
Problem A record default can refer to a name in another module. A private-name exception would make the same access depend on where it appeared.
Decision Apply ordinary module visibility to name access in record defaults.
Examples
Reject a private value in a record default reject · resolve · Verification · not-run
main.tpz Reject a private value in a record default import std.io import defaults record Item { value: int = defaults.seed } let item = Item {} io. writeLine ( "{item.value}" ) Expected output Nonzero exit
No stdout. defaults.tpz Reject a private value in a record default export let visible: int = 0 let seed: int = 41 let mut state: int = 42 type Secret = int Expected result Expected result Rejection during resolve. Nonzero exit.
No stdout.
This exact example has not been executed.
Use an exported value in a record default run · running · Verification · not-run
main.tpz Use an exported value in a record default import std.io import defaults record Item { value: int = defaults.seed } let item = Item {} io. writeLine ( "{item.value}" ) Expected output Exit code 0
41
defaults.tpz Use an exported value in a record default export let visible: int = 0 export let seed: int = 41 let mut state: int = 42 type Secret = int Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
A record default cannot read a private mutable value reject · resolve · Verification · not-run
main.tpz A record default cannot read a private mutable value import defaults record Item { value: int = defaults.state } let item = Item {} Expected output Nonzero exit
No stdout. defaults.tpz A record default cannot read a private mutable value export let visible: int = 0 let seed: int = 41 let mut state: int = 42 type Secret = int Expected result Expected result Rejection during resolve. Nonzero exit.
No stdout.
This exact example has not been executed.
A default value does not grant access to a private type reject · resolve · Verification · not-run
main.tpz A default value does not grant access to a private type import defaults record Item { value: int = { let saved: defaults. Secret = 1 saved } } let item = Item {} Expected output Nonzero exit
No stdout. defaults.tpz A default value does not grant access to a private type export let visible: int = 0 let seed: int = 41 let mut state: int = 42 type Secret = int Expected result Expected result Rejection during resolve. Nonzero exit.
No stdout.
This exact example has not been executed.
Alternatives considered Allow private names only inside defaults. The export boundary would depend on where the name was read.Why Visibility works the same way in defaults and ordinary access.
Changed rules Record defaults respect module privacy →
As changes the imported name Adopted November 7, 2026 · 6.0.0 · Being verified
Problem A module or value can be imported under its original name. Repeating that name after as makes the reader compare two spellings before seeing that nothing changes.
Decision Use as only when the name changes. Repeating the default name produces TPZ2009.
Examples
Reject a namespace alias repeating its default name reject · parse · Verification · not-run
main.tpz Reject a namespace alias repeating its default name import lib as lib let result: int = lib.value Expected output Nonzero exit
No stdout. lib.tpz Reject a namespace alias repeating its default name export let value: int = 1 Expected result Expected result Rejection during parse. Nonzero exit.
No stdout.
This exact example has not been executed.
Omit the namespace alias to keep its default name check · checking · Verification · not-run
main.tpz Omit the namespace alias to keep its default name import lib let result: int = lib.value Expected output Exit code 0
No stdout. lib.tpz Omit the namespace alias to keep its default name export let value: int = 1 Expected result Expected result Checking accepts the program. Exit code 0.
No stderr.
No stdout.
This exact example has not been executed.
Reject a selected alias repeating its source name reject · parse · Verification · not-run
main.tpz Reject a selected alias repeating its source name import lib { value as value } let result: int = value Expected output Nonzero exit
No stdout. lib.tpz Reject a selected alias repeating its source name export let value: int = 1 Expected result Expected result Rejection during parse. Nonzero exit.
No stdout.
This exact example has not been executed.
Omit the selected alias to keep its source name check · checking · Verification · not-run
main.tpz Omit the selected alias to keep its source name import lib { value } let result: int = value Expected output Exit code 0
No stdout. lib.tpz Omit the selected alias to keep its source name export let value: int = 1 Expected result Expected result Checking accepts the program. Exit code 0.
No stderr.
No stdout.
This exact example has not been executed.
Alternatives considered Allow a redundant alias. The same import would have both an aliased and unaliased spelling.Require an alias on every import. One import should have one way to write it.Why An alias shows an actual rename.
Changed rules An alias changes the local name →
Imported values have immutable bindings Adopted November 9, 2026 · 6.0.0 · Being verified
Problem A module may need to modify an array it imports. It needs to know how that differs from using an imported handle to an open file.
Decision An imported binding is immutable. let mut x = imported gives the importing module a separate mutable value. Host resource handles such as an imported File share resource state. Examples
A mutable local leaves the exported array unchanged run · runtime · Verification · not-run
main.tpz A mutable local leaves the exported array unchanged import std.io import helpers { items } let mut local = items local. push ( 3 ) io. writeLine ( "{items.length}:{local.length}" ) Expected output Exit code 0
2:3
helpers.tpz A mutable local leaves the exported array unchanged export let items = [ 1 , 2 ] Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
An imported array has an immutable root reject · check · Verification · not-run
main.tpz An imported array has an immutable root import helpers { items } items[ 0 ] = 9 Expected output Nonzero exit
No stdout. helpers.tpz An imported array has an immutable root export let items = [ 1 , 2 ] Expected result Expected result Rejection during check. Nonzero exit.
No stdout.
This exact example has not been executed.
Why An importer can edit its own array without changing the value in the exporting module.
Changed rules Imported values →Rebinding imported declarations →
Resolved pending items Mutation through imported values →