-
Notifications
You must be signed in to change notification settings - Fork 72
4.29. Casting Between Types #85
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
4.29. Casting Between Types #85
Conversation
b76ceea
to
68b9127
Compare
68b9127
to
1aeb62a
Compare
* `e` has type `*T` and `U` is a numeric type, while `T: Sized`; *ptr-addr-cast* | ||
<!-- * `e` has type `*T`, `U` has type `*U_0`, and either `U_0: Sized` or | ||
`unsize_kind(T) == unsize_kind(U_0)`; a *ptr-ptr-cast* --> | ||
* `e` が型 `*T` を持ち、 `U` が `*U_0` であり、 `U_0: Sized` または `unsize_kind(T) == unsize_kind(U_0)` である場合; *ptr-ptr-cast* |
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.
ptr-ptr-cast の説明で、
原文は、 "U has type U_0" となっているのですが、
U は型を表すメタ変数のはずなので、 「Uが型U_0を持つ」というのはおかしいと思い、
「Uが*U_0である」と訳しました。
私の理解が正しいならば、英語の方が "U is *U_0" であるべきな気がするのですが、ご意見いただきたいです。
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.
タイブエイリアスの場合なんかもあるのでなんとも、といったところですね。
どちらにしても大きく意味を損なう訳ではないのでこのままで良いと思います。
翻訳しました。 |
|
||
A cast `e as U` is valid if `e` has type `T` and `T` *coerces* to `U`. | ||
<!-- A cast `e as U` is valid if `e` has type `T` and `T` *coerces* to `U`. --> | ||
`e as U` というキャストは、 `e` が型 `T` を持ち、かつ `T` が `U` に型強制されるとき、有効です。 |
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.
[markdown]
「T
coerces to U
.」に出てきている**
が抜けているようです。
@kw-udon |
@KeenS |
ありがとうございます、マージします。 |
型間のキャスト(Casting Between Types) の章の翻訳をします。