Skip to content

string literal can't be used as a type of a parameter #6991

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

Closed
zpdDG4gta8XKpMCd opened this issue Feb 10, 2016 · 2 comments
Closed

string literal can't be used as a type of a parameter #6991

zpdDG4gta8XKpMCd opened this issue Feb 10, 2016 · 2 comments
Assignees
Labels
Bug A bug in TypeScript Domain: Literal Types Unit types including string literal types, numeric literal types, Boolean literals, null, undefined Duplicate An existing issue was already created

Comments

@zpdDG4gta8XKpMCd
Copy link

type Boots = 'boots';
let lala = {
    nowBoots(saying: Boots): void; // works
    nowCats(saying: 'cats'): void; // doesn't works
}
@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Feb 10, 2016
@mhegazy mhegazy added this to the TypeScript 1.8.2 milestone Feb 10, 2016
@DanielRosenwasser DanielRosenwasser added the Domain: Literal Types Unit types including string literal types, numeric literal types, Boolean literals, null, undefined label Feb 10, 2016
@DanielRosenwasser
Copy link
Member

Looks like a duplicate of #6143.

@mhegazy mhegazy added the Duplicate An existing issue was already created label Feb 11, 2016
@mhegazy
Copy link
Contributor

mhegazy commented Feb 11, 2016

should be fixed in master.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Domain: Literal Types Unit types including string literal types, numeric literal types, Boolean literals, null, undefined Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

4 participants