From 98513527c55f325813d6e9a03d4943bbb465d351 Mon Sep 17 00:00:00 2001 From: "pr-automation-bot-public[bot]" Date: Tue, 5 May 2026 16:39:40 +0000 Subject: [PATCH] chore: bump Motoko to v1.7.0 --- .sources/VERSIONS | 2 +- .sources/motoko | 2 +- docs/languages/motoko/reference/changelog.md | 25 +++++++++++++++++-- .../motoko/reference/motoko-grammar.md | 4 +++ 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/.sources/VERSIONS b/.sources/VERSIONS index 1ea551ed..4e062b86 100644 --- a/.sources/VERSIONS +++ b/.sources/VERSIONS @@ -50,7 +50,7 @@ chain-fusion-signer v0.3.0 papi v0.1.1 168bc9d ic-pub-key v1.0.1 f89fa55 icp-cli v0.2.3 caeac37 -motoko v1.6.0 b818df6 +motoko v1.7.0 1e65e26 motoko-core v2.4.0 cd37dbf cdk-rs ic-cdk v0.20.1 / ic-cdk-timers v1.0.0 / ic-cdk-executor v2.0.0 317f55c candid 2025-12-18 # candid v0.10.20, didc v0.5.4 2e4a2cf diff --git a/.sources/motoko b/.sources/motoko index b818df61..1e65e263 160000 --- a/.sources/motoko +++ b/.sources/motoko @@ -1 +1 @@ -Subproject commit b818df61897bd613683c38136a8226df97aaf176 +Subproject commit 1e65e26346b35927869dda044bb76763627c2c57 diff --git a/docs/languages/motoko/reference/changelog.md b/docs/languages/motoko/reference/changelog.md index 0b11b96a..27d3e755 100644 --- a/docs/languages/motoko/reference/changelog.md +++ b/docs/languages/motoko/reference/changelog.md @@ -22,13 +22,34 @@ $(dfx cache show)/moc --version # Motoko compiler changelog +## 1.7.0 (2026-04-29) + +* 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 (2026-04-21) * motoko (`moc`) - * 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. + * feat: expose caller attributes feature through primitives (#5970). - * feat: expose caller attributes feature through prim (#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 (2026-04-13) diff --git a/docs/languages/motoko/reference/motoko-grammar.md b/docs/languages/motoko/reference/motoko-grammar.md index d2ff7a43..919f636f 100644 --- a/docs/languages/motoko/reference/motoko-grammar.md +++ b/docs/languages/motoko/reference/motoko-grammar.md @@ -64,6 +64,7 @@ This section describes the concrete syntax, or grammar, of Motoko. The specifica ::= '?' + '??' 'weak' ::= @@ -217,6 +218,7 @@ This section describes the concrete syntax, or grammar, of Motoko. The specifica '#' '#' '?' + '??' 'actor' @@ -237,6 +239,7 @@ This section describes the concrete syntax, or grammar, of Motoko. The specifica ::= ':=' + '??' 'return' ? ? 'async' @@ -320,6 +323,7 @@ This section describes the concrete syntax, or grammar, of Motoko. The specifica '#' '#' '?' + '??' ::=