We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
declare var
declare function
Since #9734 (swc 1.9.3) it's no longer possible to use the resolver to figure out the scope of a declare var.
Even if this was intentional, it seems inconsistent with declare function which still has the correct scope set?
// file.d.ts export class Test { // ctxt: 2 method(): typeof publicVar; } declare function random(): number; // ctxt: 2 export declare var publicVar: number; // ctxt: 0 (previously 2 as well)
https://play.swc.rs/?version=1.9.3&code=H4sIAAAAAAAAA0XMQQqDMBBG4X0gd%2FiX7RXqNcR9TEYqmEyYTIoi3l2lqPvvPZozi8JPrhS0VBSrNUAk%2FXJ4vT%2FQJRMPyLWfRt85aazZrLEm0NEIYajJ68gJ4lLgeCapxp5OSP%2F5RX9Ons%2FNdnIgB2WCAAAA&config=H4sIAAAAAAAAA1WQvW7DMAyE9z6FoTmoCw8ZsrbIlilPQCh0w0J%2FICkgRuB3jyTHcbqJ3%2FF04N0%2Fus78iTWH7l6eZUjAgvyaC5EpKNwKMTolFMuU1OxWVaVKyhkbmRfBKPAvajWhDF%2FDYFbOEGSM7N8TsuAPjhTwGPnbgciR0F3k%2Be8rihGsvvkKIp8i6zlmtljDrqpJDn2P4j%2Fl2qfFstsMnIOSb7uQNXpQsuYpz%2F8ucDFK3RvBSb2tcePjJTvc6qqVLFfuzbZEgcZp9TZEclqdrav5AeQIxLB6AQAA
No response
Previously, the above said the scope of publicVar was the same scope as random.
publicVar
random
Now it says the ctxt of random is 2 and publicVar is 0.
2
0
1.11.1
The text was updated successfully, but these errors were encountered:
declare
handle_types
Here is another same problem: #9892
Sorry, something went wrong.
Ah, looks like a duplicate. I'll close this one. Thanks!
kdy1
Successfully merging a pull request may close this issue.
Describe the bug
Since #9734 (swc 1.9.3) it's no longer possible to use the resolver to figure out the scope of a
declare var
.Even if this was intentional, it seems inconsistent with
declare function
which still has the correct scope set?Input code
Config
Playground link (or link to the minimal reproduction)
https://play.swc.rs/?version=1.9.3&code=H4sIAAAAAAAAA0XMQQqDMBBG4X0gd%2FiX7RXqNcR9TEYqmEyYTIoi3l2lqPvvPZozi8JPrhS0VBSrNUAk%2FXJ4vT%2FQJRMPyLWfRt85aazZrLEm0NEIYajJ68gJ4lLgeCapxp5OSP%2F5RX9Ons%2FNdnIgB2WCAAAA&config=H4sIAAAAAAAAA1WQvW7DMAyE9z6FoTmoCw8ZsrbIlilPQCh0w0J%2FICkgRuB3jyTHcbqJ3%2FF04N0%2Fus78iTWH7l6eZUjAgvyaC5EpKNwKMTolFMuU1OxWVaVKyhkbmRfBKPAvajWhDF%2FDYFbOEGSM7N8TsuAPjhTwGPnbgciR0F3k%2Be8rihGsvvkKIp8i6zlmtljDrqpJDn2P4j%2Fl2qfFstsMnIOSb7uQNXpQsuYpz%2F8ucDFK3RvBSb2tcePjJTvc6qqVLFfuzbZEgcZp9TZEclqdrav5AeQIxLB6AQAA
SWC Info output
No response
Expected behavior
Previously, the above said the scope of
publicVar
was the same scope asrandom
.Actual behavior
Now it says the ctxt of
random
is2
andpublicVar
is0
.Version
1.11.1
Additional context
No response
The text was updated successfully, but these errors were encountered: