Repository navigation
-
motoko (
moc)-
Diagnostics located in a Candid
.didfile show the file's path, not just
its name, and--error-format=humanshows a source excerpt for them
(#6521). -
bugfix: A contextual-dot call with explicit type arguments, such as
b.get<Nat>(), now checks that the receiver fits theselfparameter
under those type arguments. Before, a mismatched receiver type-checked and
the generated code read values at the wrong type (#6518). -
bugfix: a function literal passed to a generic call whose type arguments
are inferred is now rejected when its return type annotation doesn't fit
the expected return type. Previously, a call such as
apply(5, func(x) : Int { -1 })was accepted whereapplyexpects a
T -> Natfunction (#6516). -
bugfix: Candid decoding rejects signed LEB128 numbers longer than ten
bytes instead of decoding them to an arbitrary value (#6500). -
bugfix: Compiling a program that
moc --checkaccepts no longer fails
with the internal errorDom.Make(X).Clashfrom the IR checker. The crash
depended only on how many async function types a file declares, so an
unrelated edit could trigger it, for example adding a method to an actor
type (#6522). -
bugfix: Different
weaktypes are no longer treated as the same type.
Before, when one type, or one actor's stable variables, held two or
more differentweaktypes, every one after the first was checked as
the first. Subtyping, stability, and upgrade compatibility then accepted
mismatched content types, inferred types could be wrong, and type
inference could fail with a spurious "bad instantiation" error (#6517). -
bugfix: Importing a Candid file now fails with error M0153 when two fields
of a record, two tags of a variant, or two methods of a service have
colliding Motoko hashes. Before,moceither crashed with an internal
error or, with the IR check off (as inmoc.js), compiled code that could
read a value at the wrong type (#6519).
-