🔎 Search Terms
export let, undefined, assignment, assigned
🕗 Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about
export let
⏯ Playground Link
No response
💻 Code
// a.tsexportletx: {foo(): void}if(!!false){// @ts-expect-error Variable 'x' is used before being assigned.x.foo()}// b.tsimport{x}from'./a.ts'// TS compiles, throws at runtimex.foo()🙁 Actual behavior
TS compiles, only throws at runtime.
🙂 Expected behavior
TS refuses to compile without ! non-null assertion, with error probably being reported in the exporting module a.ts rather than the importing module b.ts.
Additional information about the issue
No response
🔎 Search Terms
export let,undefined, assignment, assigned🕗 Version & Regression Information
export let⏯ Playground Link
No response
💻 Code
🙁 Actual behavior
TS compiles, only throws at runtime.
🙂 Expected behavior
TS refuses to compile without
!non-null assertion, with error probably being reported in the exporting modulea.tsrather than the importing moduleb.ts.Additional information about the issue
No response