0.6.14
-
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 asdfx
to verify upgrade compatibility (see extended documentation).New compiler options:
--public-metadata <name>: emit ICP custom section<name>(candid:argsorcandid:serviceormotoko:stable-types) aspublic(default isprivate)--stable-types: emit signature of stable types to.mostfile--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
didcavailable 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 indexingxs[i]in the following snippet
happend to type-check before, becauseiwas given the more precise
typeNat(inferred fromrun's parameter type), regardless of the
overly liberal declaration as anInt:func run(f : Nat -> Text) {...}; let xs = ["a", "b", "c"]; run(func(i : Int) { xs[i] });
This no longer works,
ihas to be declared asNat(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
Intequality comparisons
- code generation for