Open MaxGraey opened 6 years ago
In https://github.com/AssemblyScript/assemblyscript/commit/0e33806cf6de109816fe2c49390fad26896591c4 I noticed that, at the current point, at least static
fields must have a type annotation because these are compiled lazily but might become resolved before being compiled, and there isn't a proper resolveExpression
for any expression yet that we could use if there wasn't a type annotation. Hence, implementing a full-fledged resolver seems to be one requirement to make this proposal work without exceptions.
It's probably possible to do this using TypeScript's compiler API. It might also be possible to do this using Hegel, though it only works with a statically-typed subset of JavaScript.