Skip to content

0.6.14

Compare
Choose a tag to compare
@github-actions github-actions released this 19 Nov 17:31
· 1007 commits to master since this release
8459514
  • The compiler now embeds the existing Candid interface and new
    stable signature of a canister in additional Wasm custom sections,
    to be selectively exposed by the IC, and to be used by tools such as dfx
    to verify upgrade compatibility (see extended documentation).

    New compiler options:

    • --public-metadata <name>: emit ICP custom section <name> (candid:args or candid:service or motoko:stable-types) as public (default is private)
    • --stable-types: emit signature of stable types to .most file
    • --stable-compatible <pre> <post>: test upgrade compatibility between stable-type signatures <pre> and <post>

    A Motoko canister upgrade is safe provided:

    • the canister's Candid interface evolves to a Candid subtype; and
    • the canister's Motoko stable signature evolves to a stable-compatible one.

    (Candid subtyping can be verified using tool didc available at:
    https://github.com/dfinity/candid.)

  • BREAKING CHANGE (Minor):
    Tightened typing for type-annotated patterns (including function parameters)
    to prevent some cases of unintended and counter-intuitive type propagation.

    This may break some rare programs that were accidentally relying on that
    propagation. For example, the indexing xs[i] in the following snippet
    happend to type-check before, because i was given the more precise
    type Nat (inferred from run's parameter type), regardless of the
    overly liberal declaration as an Int:

    func run(f : Nat -> Text) {...};
    let xs = ["a", "b", "c"];
    run(func(i : Int) { xs[i] });

    This no longer works, i has to be declared as Nat (or the type omitted).

    If you encounter such cases, please adjust the type annotation.

  • Improved garbage collection scheduling

  • Miscellaneous performance improvements

    • code generation for for-loops over arrays has improved
    • slightly sped up Int equality comparisons