Skip to content

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

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
CaiSijian opened this issue Mar 18, 2024 · 1 comment

Comments

@CaiSijian
Copy link

原文:
注意,模板字符串可以引用的类型一共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日

@ruanyf ruanyf closed this as completed in 5d4a2f1 Mar 19, 2024
@ruanyf
Copy link
Contributor

ruanyf commented Mar 19, 2024

谢谢补充,我已经加进去了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants