Closed
Description
TypeScript Version: 3.2.1
Search Terms:
Code
function test(
foo = (() => bas)(), // missing error
bar = bas, // ok, already has error
baz = () => bas, // ok, accessing 'bas' is deferred
bas: string,
) {}
Expected behavior:
Referencing bas
in the initializer of foo
should be an error.
Control flow analysis inlines IIFEs, but this check doesn't seem to do that.
Actual behavior:
No compile error, resulting in a runtime error.
Related Issues: