0.16.1
- motoko (
moc)-
bugfix: fix compile-time exception showing
???type when using 'improved type inference' (#5423). -
Allow inference of invariant type parameters, but only when the bound/solution is an 'isolated' type (meaning it has no proper subtypes nor supertypes other than
Any/None) (#5359).
This addresses the limitation mentioned in #5180.
Examples of isolated types include all primitive types exceptNatandInt, such asBool,Text,Blob,Float,Char,Int32, etc.
NatandIntare not isolated becauseNatis a subtype ofInt(Nat <: Int).For example, the following code now works without explicit type arguments:
import VarArray "mo:core/VarArray"; let varAr = [var 1, 2, 3]; let result = VarArray.map(varAr, func x = debug_show (x) # "!"); // [var Text]
-
ignorenow warns when its argument has typeasync*, as it will have no effect (#5419). -
bugfix: fix rare compiler crash when using a label and identifier of the same name in the same scope (#5283, #5412).
-
bugfix:
mocnow warns about parentheticals onasync*calls, and makes sure that they get discarded (#5415).
-