-
Notifications
You must be signed in to change notification settings - Fork 39
Enhance: TypeScriptの型を厳格化 #891
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
base: master
Are you sure you want to change the base?
Enhance: TypeScriptの型を厳格化 #891
Conversation
|
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
|
| var: string; // イテレータ変数名 | ||
| from: Expression; // 開始値 | ||
| to: Expression; // 終値 | ||
| } | { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | { | |
| } | { | |
| var: string; // イテレータ変数名 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
varとtimesが同時に定義されることはないと思います。
for let i, 10 {}はfrom = 0, to = 10になりますし
Co-authored-by: salano_ym <[email protected]>
What
asや!による型アサーションを減らします。CharStreamのeofやcharがgetterであるために意図しないnarrowingが発生していたので通常のメソッドに変更します。visitNode関数にジェネリクスを使用します。Ast.Forの型を変更し、(varおよびfrom,to)またはtimesのどちらかが必須となるようにします。Tokenの型を変更し、識別子やリテラルの場合はvalueを、テンプレートリテラルの場合はchildrenを必須にします。Why
Resolve #880
Additional info (optional)