Skip to content

Hot v3.0.20

Choose a tag to compare

@github-actions github-actions released this 04 Dec 22:21
· 2 commits to main since this release

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 check before 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

  • Event is a core type. fn (event: Event) and Event(type, data) work in any namespace without an import. A namespace that declares its own Event keeps 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 where constraints, literal unions, enum payloads and custom constructors as a namespace type does.
  • New hot check diagnostics. Errors: use-before-definition at top level, generic arity, and one "No overload of f accepts (A, B)" error for a call no overload fits. Warnings: arm-never-matches, ambiguous-overload, mixed-lazy-overloads, unhandled-err and impossible-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 user labels. All default to off, and an existing installation plans no change.

Fixes

  • hot check resolves 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 now unresolved-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 where Draft is 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 a null arm, and arms from another enum don't count as coverage.
  • Checker false positives on Fn<A, B> parameters, Str? against Str | 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 and assoc-in check 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 BudgetExceeded instead 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 -> Tool conversion.

Behaviour changes

  • Code that hot check accepted 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 a Map parameter, so assoc, merge and keys on a variant halt.
  • Newtypes over a built-in are unwrapped at built-in parameters, fields and returns. is-type and match arms are exact, so is-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

Full Changelog: v3.0.19...v3.0.20