Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .sources/VERSIONS
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .sources/motoko
Submodule motoko updated 121 files
25 changes: 23 additions & 2 deletions docs/languages/motoko/reference/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 4 additions & 0 deletions docs/languages/motoko/reference/motoko-grammar.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ This section describes the concrete syntax, or grammar, of Motoko. The specifica
<typ_un> ::=
<typ_nullary>
'?' <typ_un>
'??' <typ_un>
'weak' <typ_un>

<typ_pre> ::=
Expand Down Expand Up @@ -217,6 +218,7 @@ This section describes the concrete syntax, or grammar, of Motoko. The specifica
'#' <id>
'#' <id> <exp_nullary>
'?' <exp_un>
'??' <exp_un>
<unop> <exp_un>
<unassign> <exp_un>
'actor' <exp_plain>
Expand All @@ -237,6 +239,7 @@ This section describes the concrete syntax, or grammar, of Motoko. The specifica
<exp_nondec> ::=
<exp_bin>
<exp_bin> ':=' <exp>
<exp_bin> '??' <exp_nest>
<exp_bin> <binassign> <exp>
'return' <exp>?
<parenthetical>? 'async' <exp_nest>
Expand Down Expand Up @@ -320,6 +323,7 @@ This section describes the concrete syntax, or grammar, of Motoko. The specifica
'#' <id>
'#' <id> <pat_nullary>
'?' <pat_un>
'??' <pat_un>
<unop> <lit>

<pat_bin> ::=
Expand Down
Loading