-
Notifications
You must be signed in to change notification settings - Fork 34
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
Enhance: TypeScriptの型を厳格化 #891
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 <53254905+salano-ym@users.noreply.github.com>
What
as
や!
による型アサーションを減らします。CharStream
のeof
やchar
がgetterであるために意図しないnarrowingが発生していたので通常のメソッドに変更します。visitNode
関数にジェネリクスを使用します。Ast.For
の型を変更し、(var
およびfrom
,to
)またはtimes
のどちらかが必須となるようにします。Token
の型を変更し、識別子やリテラルの場合はvalue
を、テンプレートリテラルの場合はchildren
を必須にします。Why
Resolve #880
Additional info (optional)