Skip to content
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

Rename members does not work on type argument values #6244

Closed
tinganho opened this issue Dec 25, 2015 · 9 comments
Closed

Rename members does not work on type argument values #6244

tinganho opened this issue Dec 25, 2015 · 9 comments

Comments

@tinganho
Copy link
Contributor

interface A {
    a: string;
}
function f(): Promise<A> {
    return Promise.resolve({
        a: '',
    });
}

Renaming A.a to A.b doesn't work on above example.

@tinganho
Copy link
Contributor Author

The cursor could also be in both places. Both yield error result.

@tinganho tinganho changed the title Rename members does not work on type argument types Rename members does not work on type argument values Dec 25, 2015
@DanielRosenwasser
Copy link
Member

This is because we can't figure out Promise<A> is the type returned by Promise.resolve - it's just Promise<{ a: string }> which is structurally compatible. @RyanCavanaugh don't we have an issue for use-sites as an inference site for type arguments? I can't find it.

We should also consider a "Rename all structurally compatible types." option for rename.

@mhegazy
Copy link
Contributor

mhegazy commented Jan 7, 2016

We talked about this before, not sure if there is an issue for this though.

@mhegazy
Copy link
Contributor

mhegazy commented Jan 7, 2016

@DanielRosenwasser wanna file an issue for it?

@DanielRosenwasser
Copy link
Member

Which issue specifically? Structural references, or adding inference sites?

@mhegazy
Copy link
Contributor

mhegazy commented Jan 7, 2016

structural references.

@DanielRosenwasser
Copy link
Member

Done. See #6388.

@mhegazy
Copy link
Contributor

mhegazy commented Jan 7, 2016

We can close this one then?

@DanielRosenwasser
Copy link
Member

Yup. The inference site idea was #5254 for future reference.

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants