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 doesn't work for string literal compared to string literal type #9257

Open
DanielRosenwasser opened this issue Jun 19, 2016 · 0 comments
Labels
Bug A bug in TypeScript
Milestone

Comments

@DanielRosenwasser
Copy link
Member

In the below, try to rename "ADD_TODO" in the case clause. It fails.

interface AddTodo {
    type: "ADD_TODO";
    text: string;
}

interface DeleteTodo {
    type: "DELETE_TODO";
    position: number
    newText: string;
} 

type TodoAction = AddTodo | DeleteTodo;

function dispatchOrSomething(action: TodoAction) {
    switch (action.type) {
        case "ADD_TODO":
            break;
        case "DELETE_TODO":

    }
}
@DanielRosenwasser DanielRosenwasser added Bug A bug in TypeScript Domain: Completion Lists The issue relates to showing completion lists in an editor and removed Domain: Completion Lists The issue relates to showing completion lists in an editor labels Jun 19, 2016
@mhegazy mhegazy assigned ghost Sep 21, 2016
@mhegazy mhegazy added this to the TypeScript 2.1 milestone Sep 21, 2016
@mhegazy mhegazy modified the milestones: TypeScript 2.1, Future Sep 29, 2016
@RyanCavanaugh RyanCavanaugh unassigned ghost Jul 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript
Projects
None yet
Development

No branches or pull requests

2 participants