Advantage is that when transforming TS to JS, you can just clear resolved_ts_references (or ignore it) when calculating if a symbol is referenced or not.
Symbols would be stored together regardless of whether they're types or not to allow for when a symbol is used in both contexts e.g.:
import Foo from 'foo';
let foo = new Foo(); // JS usage
function bar(foo: Foo) {} // TS usage
Maybe use a different AST type TSIdentiferReference for identifiers in TS contexts, to simplify visitors.
Boshen's idea from today's meeting:
Store references used in TS
IdentiferReference
s separately from normal references:Advantage is that when transforming TS to JS, you can just clear
resolved_ts_references
(or ignore it) when calculating if a symbol is referenced or not.Symbols would be stored together regardless of whether they're types or not to allow for when a symbol is used in both contexts e.g.:
Maybe use a different AST type
TSIdentiferReference
for identifiers in TS contexts, to simplify visitors.See also the point "Get rid of Reference" in #32.