Skip to content

Releases: caffeinelabs/motoko

1.10.0

19 Jun 13:13
69de48c

Choose a tag to compare

  • motoko (moc)

    • feat: M0218 ("redundant stable keyword") now ships a machine-applicable edit, so mops check --fix removes the explicit stable keyword on fields of a persistent actor (#6175).

    • feat: Permitting destructuring patterns against actor types — let { foo } = a, func g({foo} : actor T) {}, etc. (#6149).

    • feat: /// @deprecated M0235 <message> — the caffeine deprecation warning (M0235) can now carry a free-text message, rendered as a note: sub-diagnostic at every use site. M0154 free-text deprecation messages now render the same way (#6153).

    • perf: Multi-value Wasm codegen is now on by default, --no-experimental-multi-value flag disables (if not desired) (#6165).

    • bugfix: M0237 (implicit argument can be omitted) only fires now when the suggested removal preserves the same type instantiation. Previously the edit could be rejected (M0098) (#6166).

    • bugfix: M0236 dot-notation suggestion no longer fires for literal receivers — the lit.f() rewrite could misparse (-1.1.isNaN()-(1.1.isNaN())), mis-lex (0xff.abs as a hex float), or fail to type-check when it lost a literal coercion (Blob.isEmpty("\00")"\00".isEmpty()) (#6173).

    • bugfix: M0236 dot-notation suggestion no longer fires when the receiver cannot be inferred or would infer to a different type causing the call to resolve to a different function (#6177).

    • bugfix: Implicit argument derivation now resolves type variables that occur only in a covariant result position (e.g. JSON-style decoders Text -> ?T). Previously such a variable was solved to None (bottom), so the implicit had to be passed explicitly (#6186).

    • bugfix: Diagnostic columns now count Unicode codepoints (matching editor displays and rustc), and JSON diagnostics gain byte_start/byte_end for encoding-independent edit anchors. Previously mops check --fix over-deleted on multi-byte lines (e.g. Char.toNat32('京') trimmed the trailing )) (#6168).

1.9.0-m0237-fix

04 Jun 08:00
56ddce8

Choose a tag to compare

1.9.0-m0237-fix Pre-release
Pre-release
chore(deps): Bump DeterminateSystems/update-flake-lock from 5ba4a20ae…

1.9.0-m0236-fix

03 Jun 14:47
2e524e5

Choose a tag to compare

1.9.0-m0236-fix Pre-release
Pre-release
chore: drop misconfigured idl-mo-float32 fail test (#6170)

Misconfigured since
[#2297](https://github.com/caffeinelabs/motoko/pull/2297) (2021):
`MOC-FLAG --actor-idl` points at `idl-mo-bad-method`, so it tests the
M0160 snowman case, not float32. The duplication went unnoticed because
`fancy_of_message` raised `Sys_error` on the secondary diagnostic's
`.did` path, masking both tests' real output.

Fixing the typo doesn't help: `moc` has supported the Candid `float32`
type since the original M0153 case was written, so the corrected test no
longer fails. Drop it.

Split out of [#6168](https://github.com/caffeinelabs/motoko/pull/6168)
for clean review.

Co-authored-by: Cursor <cursoragent@cursor.com>

1.9.0

02 Jun 07:48
e7c78d7

Choose a tag to compare

  • motoko (moc)

    • feat: Structural implicit derivation for records and tuples via __record and __tuple combiners. Per-field results are lazy thunks, enabling short-circuiting for operations like compare (#5903).

    • feat: --experimental-multi-value flag enables function-level multi-value Wasm codegen. Off by default (#6113).

1.8.2

21 May 16:33
f45204b

Choose a tag to compare

  • motoko (moc)

    • bugfix: M0236 dot-notation suggestion no longer fires when the receiver argument is not already a postfix expression (e.g. Nat.toText((x * a + b) % c)). The compiler used to print the suggestion as (<expr>).toText(...) but emit no machine-applicable edits, leaving mops check --fix with nothing to do; suggesting (complex).f() over Module.f(complex) is also a debatable style change. Trivial-receiver cases (variables, literals, calls) are unaffected (#6144).

1.8.1

20 May 17:04
a61916b

Choose a tag to compare

  • motoko (moc)

    • bugfix: Split stable-signature compatibility error M0169 — the "previous version does not contain the stable variable required by the migration function" case now reports as new code M0263, leaving M0169 strictly for the "stable variable would be implicitly discarded" (data-loss) case. The two scenarios have different fixes and now have distinct codes (#6134).

1.8.0

15 May 12:00
75c4123

Choose a tag to compare

  • motoko (moc)

    • feat: Implicit argument derivation — the compiler can derive implicit arguments from functions that themselves have implicit parameters (e.g., compare for [Nat] from Array.compare<Nat> + Nat.compare). Works transitively and is depth-limited via --implicit-derivation-depth (#5966).

    • feat: and-patterns — p1 and p2 matches when both legs match, binding from both (#6049).

    • bugfix: M0236 dot-notation auto-fix on unparenthesized single-argument calls (e.g. List.reverse b) no longer rewrites them into a bare function reference (b.reverse), which silently turned a call into a no-op; the suggestion now produces b.reverse() (#6096).

1.7.0

29 Apr 12:26
1e65e26

Choose a tag to compare

  • motoko (moc)

    • feat: Add null-coalescing operator ?? (#5722).
      e1 ?? e2 evaluates to the unwrapped contents of e1 when e1 is ?v,
      otherwise to e2. The right-hand side is evaluated lazily (short-circuit).
      For example, opt ?? defaultValue replaces the verbose
      switch opt { case (?v) v; case null defaultValue }.
      The right-hand side may be a block (e.g. opt ?? { let x = 1; x }),
      a do-block, or a Prim.trap for fail-fast unwrapping. Because { ... }
      on the right is parsed as a block, a bare record literal must be wrapped
      in extra braces or parentheses, e.g. opt ?? ({ x = 0 }) or
      opt ?? {{ x = 0 }}.

    • perf: Compile enhanced multi-migration chains as per-step functions instead of one deeply-nested inlined expression, avoiding the wasm-function complexity limit hit by long chains (#6065).

    • bugfix: Preserve GC-only roots (blob deduplication table, migration functions list) across graph-copy upgrades, and defer actor type compatibility checks to ICStableRead so enhanced multi-migration chains with multiple pending steps are accepted (#5993).

    • bugfix: Clearer error when installing a Motoko canister over a non-Motoko or otherwise incompatible canister (#6044).

1.6.0

21 Apr 10:00
b818df6

Choose a tag to compare

  • motoko (moc)

    • feat: expose caller attributes feature through primitives (#5970).

    • bugfix: Fix moc.js resolution of relative flag paths (e.g. --enhanced-migration, --actor-idl): resolve against the project root (via new setProjectRoot API) instead of the source file's directory, matching native moc behavior. The language server should call setProjectRoot(path) before processing files (#6015).

1.5.1

13 Apr 10:23
395ce0b

Choose a tag to compare

  • motoko (moc)

    • bugfix: Resolve relative paths in moc.js flags (e.g. --enhanced-migration, --actor-idl) against the source file's directory, fixing "not a directory" errors when these flags are passed with relative paths via the language server (#6002).