Closed tommy-mitchell closed 2 years ago
Made the test simpler:
// Identifier `bar` has no Symbol
const anyCall = (foo: any) => foo.bar();
// Fails with `Cannot read properties of undefined (reading 'flags')` in 0.24.0
expectType<any>(anyCall('foo'));
Refactors the parser as mentioned here in #161 and adds a regression test:
(AST Viewer). Adapted from
zx
core.ts
.I'm not sure why
tsd
is parsing the source code ofzx
instead of just thetest-d
files. I wasn't able to reproduce this in a test case.Having a
Node
but not aSymbol
means that the given expression is syntactically-correct, but not semantically-correct. Ultimately, I was wrong to assume thatmaybeAlias
would be non-null and it's safer to have this check.