Skip to content

0.6.18

Choose a tag to compare

@lsgunnlsgunn lsgunnlsgunn released this 15 Jan 22:41
· 2215 commits to master since this release
2803347

Highlights of what’s new in 0.6.18

The 0.6.18 release primarily includes user-visible new features, internal enhancements, and fixes and updates to the version of Motoko and, the Motoko base library that are supported, and Candid.

The most significant new features and fixes include the following updates:

  • A fix to dfx upgrade that prevents a main thread panic when Option::unwrap() is called on a None value.

  • A fix to the name of the language service command to restore its compatibility with IDEs.

Motoko

  • New syntax for option types: Option blocks do ? <block> and option checks <exp> !.

    Inside an option block, an option check validates that its operand expression is not null. If it is, the entire option block is aborted and evaluates to null. This simplifies consecutive null handling by avoiding verbose switch expressions.

    For example, the expression do? { f(x!, y!) + z!.a } evaluates to null if either x, y, or z is null; otherwise, it takes the options' contents and ultimately returns ?r, where r is the result of the addition.

    The argument to a do or do ? expression must be a block { ... }, never a simple expression.