Repository navigation
Hot v3.0.20
Upgrade
- No database migrations. 3.0.20 runs on a 3.0.19 database as is. See Upgrading from 3.0.19 to 3.0.20.
- Run
hot checkbefore you deploy. The checker and the runtime type checks are stricter in this release, so code that 3.0.19 accepted can be reported now. See Behaviour changes below.
Features
Eventis a core type.fn (event: Event)andEvent(type, data)work in any namespace without an import. A namespace that declares its ownEventkeeps its own.- Functions and types declared in a function body are local to it. A function or type declared in a body is visible from its declaration to the end of that body, nested blocks and closures included, and nowhere else. A local type takes
whereconstraints, literal unions, enum payloads and custom constructors as a namespace type does. - New
hot checkdiagnostics. Errors:use-before-definitionat top level, generic arity, and one "No overload offaccepts (A, B)" error for a call no overload fits. Warnings:arm-never-matches,ambiguous-overload,mixed-lazy-overloads,unhandled-errandimpossible-comparison. - Opt-in self-host alerts and options. The OpenTofu stacks add managed PostgreSQL I/O, CPU, memory and disk alerts, a host CPU alert, a GCP Pub/Sub command queue age alert, a GCS bucket
location, a fixed scheduler autoscaler on GCP scalable, and userlabels. All default to off, and an existing installation plans no change.
Fixes
hot checkresolves type names as the VM does. An unqualified constructor call or annotation naming a type from another namespace passed the check and failed at run time. It is nowunresolved-type.- Types are checked by qualified name. Two types or enums with the same short name in different namespaces are no longer interchangeable, in the checker or at run time.
- Constructed values are nominal in the checker.
Paid(...)no longer passes whereDraftis expected. Pipes check the piped value against the first parameter, and constructor, variant payload and conversion calls are checked, arity included. - Match exhaustiveness. A union of records and enums needs every member or
_, an optional type needs anullarm, and arms from another enum don't count as coverage. - Checker false positives on
Fn<A, B>parameters,Str?againstStr | Null, omitted optional fields, one-letter type names, Vec inference and top-level deep-path assignments. - Runtime overload dispatch ranks overloads by type kind and uses qualified names for ties. A call that fits no overload fails instead of running one.
- Updates check the fields they write.
assoc,update,merge, deep sets andassoc-incheck field types, including inside variant payloads. Constructor arity is enforced. - Local functions. A function declared in a body no longer replaces the namespace function of its name, compiles all of its signatures, and keeps its captured variables after the body returns, in a returned lambda or a parallel branch.
- JIT parity. A halt in a compiled constructor halts instead of becoming an Err value, and native self calls prepare their arguments as the interpreter does.
- Deeply nested values fail a type check with
BudgetExceededinstead of overflowing the stack. - slack 1.2.3, xai 1.3.1, postmark 1.2.4, ssh 0.1.3, sftp 0.1.3 and slack-admin 0.11.4 are updated for the stricter checks. xai adds a
SearchTool -> Toolconversion.
Behaviour changes
- Code that
hot checkaccepted can fail it now: constructed records of the wrong type, type names from a namespace that isn't imported, pipe and overload mismatches, constructor arity and fields, non-exhaustive union matches, and use before definition at top level. - Records are Maps, variants and newtypes are not.
is-map(record)is true. A variant or a non-Map newtype no longer passes aMapparameter, soassoc,mergeandkeyson a variant halt. - Newtypes over a built-in are unwrapped at built-in parameters, fields and returns.
is-typeand match arms are exact, sois-type(5.0, Pos)is false. - A record field refuses a record of another type unless an arrow or a constructor converts it.
- Constructors reject extra arguments, and so does a local function called through its value. Extra arguments were ignored.
- A provably invalid constructor call of a local type is a compile error. It was a runtime Err. A test that builds an invalid value on purpose should bind the input first.
- A failed deep set returns its Err from the enclosing function.
- The bytecode cache format changed (24 to 29). Caches rebuild on first run.
What's Changed
- fix(check): resolve type names as the VM does; make Event core by Curtis Summers (@csummers) in #408
- infra: add opt-in DB/host/Pub/Sub alerts, GCS bucket location, scheduler autoscaler, and labels by Curtis Summers (@csummers) in #411
- fix: static and runtime type checking review fixes by Curtis Summers (@csummers) in #409
- test(stream): make the task inbox fallback-poll test deterministic by Curtis Summers (@csummers) in #412
Full Changelog: v3.0.19...v3.0.20