Skip to content

关于TypeScript 类型运算符部分的模板字符串的可引用类型问题 #101

Closed
@CaiSijian

Description

@CaiSijian

原文:
注意,模板字符串可以引用的类型一共6种,分别是 string、number、bigint、boolean、null、undefined。引用这6种以外的类型会报错。
事实上,经过我测试,引用这六种之外的枚举类型,不会报错,可以解析。
例子:
enum e2 {
a = 'a',
b = 'b'
}
type t = w ${e2} // "w a" | "w b"
故此,望改正。
你的读者
2024年3月19日

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions