generic type interface with template literal string wrong generate implemented function
See original GitHub issueTS Template added by @mjbvz
TypeScript Version: 4.3.0-dev.20210228
Search Terms
- implement interface
- quick fix
- VS Code Version: 1.53.2
- OS Version: Darwin x64 19.6.0
- typescript version: 4.1.5
Steps to Reproduce:
i make generic type interface with template literal string, and i use implements this type in class. but vscode quick auto make interface feature wrong work. please look below screenshot.
i expect when i use implements interface and auto make interface function, setName(arg: string), setAddress(arg: number) maked . but in present name: (arg: string) and address: (arg:number) maked. so make type error in vscode…
but when i make this function myself, not make type error in vscode…
why generate implement function code wrong work with template literal string?
Does this issue occur when all extensions are disabled?: Yes
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Typescript constrain generic to string literal type for use in ...
I can write a function that does what I want, but I don't know how to express the constraint that its argument type...
Read more >Taming Strings with Template Literal Types - SitePen
As we saw above, template literals are used to generate strings using a combination of string literals and data. On the other hand,...
Read more >Type safety with TemplateStringsArray and tag functions #33304
I tried to make the template more generic with T extends string[] (for testing) then tried to see if I could check the...
Read more >Documentation - Template Literal Types - TypeScript
Generating mapping types which change properties via template literal strings.
Read more >How To Use Generics in TypeScript - DigitalOcean
Generics can appear in functions, types, classes, and interfaces. ... extensions as an array of strings, the variable ageAndExtensions will ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@RyanCavanaugh hmm… if you time is okay, can you tell me what fix file for fix this bug?
@andrewbranch Oke, thanks