nearprotocol / assemblyscript

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

unhelpful error message when trying to use storage.get<T> with primitives #58

Open janedegtiareva opened 5 years ago

janedegtiareva commented 5 years ago

steps to repro: try to build a contract which contains this line storage.getPrimitive<i32>("counter")

expected behavior: some error which references the problematic line in source

actual behavior: The compiler output is an assertion failure without a reference to a line in source code:

AssertionError: assertion failed at n.assert (/Users/evgueniadegtiareva/near/NEARStudio/templates/node_modules/assemblyscript/dist/asc.js:1:698370) at e.asNullable (/Users/evgueniadegtiareva/near/NEARStudio/templates/node_modules/assemblyscript/dist/assemblyscript.js:1:129907)