-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
usage: fix special handling of parameter initializer #40
Labels
Comments
Turns out to be a bug in |
Actually the above example is handled correctly by the compiler, but has a bug in this library: let foo;
(bar = () => foo, foo) => bar; // initializer uses parameter `foo`
(bar = foo) => { // initializer uses outer variable `foo`
var foo = 1;
} |
ajafff
changed the title
usage: remove special handling of parameter initializer
usage: fix special handling of parameter initializer
Mar 22, 2018
make sure the following still works correctly: declare let foo: number;
function fn(bar: typeof foo) { // refers to the inner `foo`
var foo = '';
} |
also make sure this weird clusterfuck either works as expected or is fixed upstream: microsoft/TypeScript#22825 |
Another case: let foo = 1;
(function({bar = foo}) {
var foo = 2; // unused
return bar; // returns 1
})({}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently the
foo
parameter is marked as unused. Actually the outer variablefoo
is unused.The text was updated successfully, but these errors were encountered: