-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Translate playground example (3.8 breaking changes) into ja #797
Conversation
// verify that undeclared fields in a union conform to any indexed | ||
// types in the union. | ||
// 以前のバージョンのTypeScriptでは、 | ||
// インデックスシグネチャを含む共用体に宣言されていないフィールドについて |
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.
indexed type
の翻訳で、一般的に使用されていると思われるインデックスシグネチャとしました 🙇
Ref: TypeScript Deep Dive
|
||
// For example, the TimingCache below indicates that any | ||
// key on the object will be a number: | ||
// 例えば、以下のIdentifierCacheは、 |
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.
原文がTimingCache
となっているのですが、文脈的にIdentifierCache
だと思われるので、変更しました。
What I'm wondering if I should fix this change on the original one 🤔
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.
確かにIdentifierCache
っぽいですね
もともとの方にPR送っていただけると 🙏
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.
ありがとうございます!
いくつか指摘しました!
// types in the union. | ||
// 以前のバージョンのTypeScriptでは、 | ||
// インデックスシグネチャを含む共用体に宣言されていないフィールドについて | ||
// 型チェックが行われませんでした |
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.
// 型チェックが行われませんでした | |
// 型チェックが行われませんでした。 |
// インデックスシグネチャについてはこちら: example:indexed-types | ||
// を参照してください。 |
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.
行数がずれない方が良さそうなのでこちらでお願いします 🙏
// インデックスシグネチャについてはこちら: example:indexed-types | |
// を参照してください。 | |
// インデックスシグネチャについてはこちら: example:indexed-types |
|
||
// For example, the TimingCache below indicates that any | ||
// key on the object will be a number: | ||
// 例えば、以下のIdentifierCacheは、 |
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.
確かにIdentifierCache
っぽいですね
もともとの方にPR送っていただけると 🙏
// こちらが修正され、型チェックにより、 | ||
// 'file_two'のキーについてのエラーが出るようになりました。 |
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.
// こちらが修正され、型チェックにより、 | |
// 'file_two'のキーについてのエラーが出るようになりました。 | |
// こちらが修正され、コンパイラーから | |
// 'file_two'のキーについてのエラーが出るようになりました。 |
|
||
// This also takes into account when the key is a different | ||
// type, for example: ([key: string] and [key: number]) | ||
// この型チェックは、キーの型が異なる場合にも考慮に入れられています。 |
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.
// この型チェックは、キーの型が異なる場合にも考慮に入れられています。 | |
// この型チェックは、キーの型が異なる場合も考慮に入れられています。 |
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.
LGTM 👍
Thanks everyone! |
Part of #220
Checking Unions with Index Signatures.ts