-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Unable to rename the property of destructuring assignment #6312
Comments
Please check the repro in #6459 (comment) as well. |
I was able to reproduce that problem. // renamed `A#foo` to `A#bar`
class A {
bar: string;
}
class B {
syntax1(a: A): void {
let { foo } = a; // error, should be `{ bar }`
}
syntax2(a: A): void {
let { bar: foo } = a;
}
} |
Another repro courtesy of @falsandtru that we should add tests for: Code Rename // a.ts
export var a;
// b.ts
import {a} from './a';
export {a} Expected behavior: import {c} from './a';
export {c} Actual behavior: import {c} from './a';
export {a} |
… should reference property Fixes #6312
… should reference property Fixes #6312
Another repro from test cases found during fixing this about destructuring assignment: interface I {
property1: number;
property2: string;
}
var elems: I[];
var p2;
for ({ /*This should be referenced too*/property1 : p2 } of elems) {
} |
…signment Handles destructuring assignment part of #6312
…signment Handles destructuring assignment part of #6312
This still does not work reliably. For example: const x = 1;
const o = { x };
{
const { x } = o;
x;
} Renaming any |
leaving this issue and using #15787 to track the change. |
Rename
a
tob
.expected:
actual:
The text was updated successfully, but these errors were encountered: