You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// --strictfunctiontest(){letv: number;(function*(){yield1;v=1;})();v;// still undefined}
Expected behavior:
Error Variable 'v' is used before being assigned.
Actual behavior:
No error, but v is still undefined at runtime.
I noticed this while looking through the code in binder.ts where it says that all non-async IIFEs are inlined. Note that adding the async modifier to the generator function brings up the expected error.
TypeScript Version: 2.8.1
Search Terms:
Code
Expected behavior:
Error
Variable 'v' is used before being assigned.
Actual behavior:
No error, but
v
is stillundefined
at runtime.I noticed this while looking through the code in
binder.ts
where it says that all non-async IIFEs are inlined. Note that adding theasync
modifier to the generator function brings up the expected error.Playground Link: https://agentcooper.github.io/typescript-play/#code/GYVwdgxgLglg9mABFApgZygCgJSIN4BQixiANilIgG4BciYIAtgEYoBOA3ESZqJLAgBUOfNxIkAnjBSkAJogCMXceKqIAvIuUkAvthzbiVDogD0pxBhilSicLJTAYYFLII6CQA
Related Issues:
The text was updated successfully, but these errors were encountered: