nearprotocol / assemblyscript

A TypeScript to WebAssembly compiler 🚀
https://assemblyscript.org
Apache License 2.0
8 stars 1 forks source link

bool does not work in model files #54

Closed janedegtiareva closed 5 years ago

janedegtiareva commented 5 years ago

compiling with this model file produces an error:

//@nearfile // Exporting a new class TextMessage so it can be used outside of this file. export class TextMessage { sender: string; text: string; number: u64; isRead: bool; }

ERROR TS2531: Object is possibly 'null'.

 encoder.setBoolean(name, value);
                    ~~~~

in ~lib/nearEntry.ts(39,23)

willemneal commented 5 years ago

Does this happen if you give bool an initial value? If so, it can't be null, so should the default value by false?

janedegtiareva commented 5 years ago

fixed! Thank you!