A variadic parameter can receive no trailing arguments or an empty spread. A default would make it unclear whether an effectful expression runs in either case.
Decision
Reject a default on a variadic parameter.
Examples
A variadic parameter rejects a default initializer
reject · parse · Verification · not-run
example.tpzA variadic parameter rejects a default initializer
A type parameter's capabilities are explicit protocol bounds
Adopted November 18, 2026 · 6.0.0 · Being verified
Problem
Accepting t.field in a generic function could require examining every concrete type used at calls. The requirements would be hidden until instantiation.
Decision
A type parameter or opaque projection with no static member contract cannot read a field or call a method through a dot. The generic definition produces TPZ5006 during checking.
Apply the same check after alias expansion and optional unwrapping. Using ?. on a non-optional receiver produces TPZ5001.
Declare a required capability with T: P and call P.method(value).
The required primary-location contract is Pending.
This exact example has not been executed.
A protocol bound makes the required generic call explicit
check · check · Verification · not-run
example.tpzA protocol bound makes the required generic call explicitOpen in Playground →
protocol Readable {
functionread(value: Self) ->int
}
record Item { value: int }
impl Readable<Item> {
functionread(value: Item) ->int { value.value }
}
function read<T: Readable>(value: T) ->int {
Readable.read(value)
}
let result: int=read(Item { value: 7 })
Expected outputExit code 0
$ topaz check example.tpz --language-version 6.0
Expected result
Expected result
Checking accepts the program. Exit code 0.
This exact example has not been executed.
Alternatives considered
Resolve dot members only after substituting a concrete type. Every instantiation would have to decide capabilities and diagnostics again, including access to private members.
Keep the current behavior. Access to private methods would leak.
Why
Developers can read the function's requirements in its declaration and check them at its definition.
Calls use positional arguments and records carry named options
Adopted November 7, 2026 · 6.0.0 · Being verified
Problem
Moving a call into a callback gets harder when functions use different rules for named and positional arguments. Independent options still need readable names.
Decision
Use positional arguments for calls. Named call arguments are unavailable.
Place required parameters before defaulted parameters and the variadic parameter last.
Pass independent options in a record with named fields.
Explicit type arguments follow a name or member access
Adopted November 7, 2026 · 6.0.0 · Being verified
Problem
Putting <T> after a grouped callee creates another place where a comparison and a call must be distinguished. The distinction can depend on how the callee was written.
Decision
Write explicit type arguments after a name or member access. A <T> after a parenthesized expression does not supply type arguments to a call.
function-parenthesized-callee-type-argument at example.tpz:2:29
This exact example has not been executed.
Alternatives considered
Allow type arguments after any callee expression. The parser would have more places to distinguish type arguments from comparisons.
Why
A grouped callee still refers to its declaration. Call the name directly to specify types or let the compiler infer them. If real use appears, explicit type arguments on a computed callee will be reviewed again.
Whitespace between type arguments and the call does not change the parse
Adopted November 16, 2026 · 6.0.0 · In progress
Problem
A space could make identity<int>(1) and identity<int> (1) parse differently. The grammar needs a way to distinguish an intended comparison.
Decision
After a name or member, parse type arguments when < and > enclose a type-list shape and the next token is (. Ignore whitespace and line breaks for this test.
Otherwise < begins a comparison. Parentheses can make an intended comparison explicit.
Checking rejects a non-generic callee or an invalid type argument and suggests parenthesizing an intended comparison.
function-non-generic-type-arguments at example.tpz:2:1
This exact example has not been executed.
Alternatives considered
Read it as a call only when the closing angle and opening parenthesis touch. One space would change the meaning of the program.
Spell type arguments at a call with a separate leading symbol. Type arguments would then have two spellings for the same intent.
Reject the form as ambiguous in the parser. The parser cannot tell a type from a value, so it would also reject valid generic calls inside an argument list.
Make comparison operators non-associative. It does not resolve the case inside a comma-separated argument list.
Why
The same tokens specify the same call regardless of layout.
An argument in a union call has one type across branches
Adopted November 18, 2026 · 6.0.0 · In progress
Problem
A method or function field can be called on a receiver with several possible types. Previously, the same unannotated lambda could be checked with a different type in each branch.
Decision
Use independent arguments to instantiate the branch signatures first. Use context for a position such as a lambda parameter or result only if all concrete branches give that position the same type.
Give each argument expression one final type and check it against each concrete branch. Missing context produces TPZ5020, while a known incompatible type produces TPZ5001 during checking.
A branch represented by a rigid type parameter provides no context. The result combines the possible branch results into a union.
Evaluate the callee and explicit arguments once in source order, then fill in only the actual branch’s defaults.
Examples
Matching callback parameters provide one lambda context
check · checking · Verification · not-run
example.tpzMatching callback parameters provide one lambda contextOpen in Playground →
The required primary-location contract is Pending.
This exact example has not been executed.
Alternatives considered
Check the lambda separately in each branch. A single expression would have different types and diagnostics depending on the branch.
Merge expected types across branches, or require identical signatures. Merging would need a second set of inference rules. Requiring identical signatures would reject arguments that satisfy every branch.
Why
Argument types and diagnostics are independent of branch order, and one annotation can express the caller’s intent when context is missing.
If two parameters have the same name, a reference in the body needs a way to choose between their arguments. Shadowing can leave one argument inaccessible by name.
Decision
Reject a repeated name within one parameter list in named functions and lambdas.
Examples
Distinct parameter names in functions and lambdas
run · runtime · Verification · not-run
example.tpzDistinct parameter names in functions and lambdasOpen in Playground →
import std.io { writeLine }
functionadd(left: int, right: int) ->int { left + right }
let addLambda: (int, int) ->int= (left, right) => left + right
writeLine("{add(1, 2)}")
writeLine("{addLambda(3, 4)}")
Expected outputExit code 0
3
7
$ topaz run example.tpz --language-version 6.0
Expected result
Expected result
Execution completes. Exit code 0.
Expected stdout
3
7
This exact example has not been executed.
A named function rejects a repeated parameter name
reject · checking · Verification · not-run
example.tpzA named function rejects a repeated parameter name
functionchoose(value: int, value: int) ->int { value }
Accept both arguments by position, let the later name shadow the earlier one, and reject only an ambiguous named argument. A name must mean one thing in the declaration and in a named call.