Closed
Description
Vue - Official extension or vue-tsc version
Vue - Official, v.2.0.28
VSCode version
1.92.2
Vue version
3.3.4
TypeScript version
5.5.3
System Info
No response
Steps to reproduce
- Disable the Hybrid Mode in VSCode
- Create a Vue file
- Paste into script part the following TS code:
export type StrictTranslationKey = 'test'
export function bindEnumeratedTranslations<Key extends string>(list: readonly Key[], mapping: (key: Key) => StrictTranslationKey): Record<Key, string>
export function bindEnumeratedTranslations<Enum extends Record<string, string | number>>(value: Enum, mapping: (key: Enum[string]) => StrictTranslationKey): Record<Enum[string], string>
export function bindEnumeratedTranslations<Key extends string, Enum extends Record<string, string | number>>(list: readonly Key[] | Enum, mapping: (key: Key | Enum[string]) => StrictTranslationKey): Record<any, any> {
// stub
return {}
}
const correct = bindEnumeratedTranslations(['test', 'test2'], key => 'test')
const error = bindEnumeratedTranslations(['test', 'test2'], key => 'wrong')
- Check the error for
bindEnumeratedTranslations
at the line
const error = bindEnumeratedTranslations(['test', 'test2'], key => 'wrong')
What is expected?
Full error description like this:
This works only with enabled Hybrid Mode.
What is actually happening?
Not full error description:
Link to minimal reproduction
No response
Any additional comments?
No response