Known Issues and Workarounds
Known Issues
-
#1663: Using an explicit
returnin all branches of anif letexpression causes a compile error. The workaround is to use implicit returns instead. -
#1387: In order to use
unwrap()from theresultlibrary, all symbols ofresultneeds to be imported viause::result::*;. -
#870: All
implblocks need to be defined before any of the functions they define can be called.
Missing Features
-
#1182 Arrays in a
storageblock are not yet supported. See the Manual Storage Management section for details on how to usestoreandgetfrom the standard library to manage storage slots directly. Note, however, thatStorageMap<K, V>does support arbitrary types forKandVwithout any limitations. -
#428: Arrays are currently immutable which means that changing elements of an array once initialized is not yet possible.
-
#1077: Dynamic vectors, i.e.
Vec<T>, have not yet been implemented.
General
-
No compiler optimization passes have been implemented yet, therefore bytecode will be more expensive and larger than it would be in production. Note that eventually the optimizer will support zero-cost abstractions, avoiding the need for developers to go down to inline assembly to produce optimal code.
-
Currently, we need to parse the Sway code before formatting it. Hence, the formatter cannot work on Sway code that does not parse correctly. This requirement may be changed in the future.