Skip to content

Commit 96b3b7d

Browse files
committed
Translate a paragraph
How to translate "by metaphor" ?
1 parent 789089b commit 96b3b7d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/subtyping.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,22 @@ Some important variances:
125125

126126
いくつか重要な変性があります。
127127

128+
<!--
128129
* `&'a T` is variant over `'a` and `T` (as is `*const T` by metaphor)
129130
* `&'a mut T` is variant over `'a` but invariant over `T`
130131
* `Fn(T) -> U` is invariant over `T`, but variant over `U`
131132
* `Box`, `Vec`, and all other collections are variant over the types of
132133
their contents
133134
* `UnsafeCell<T>`, `Cell<T>`, `RefCell<T>`, `Mutex<T>` and all other
134135
interior mutability types are invariant over T (as is `*mut T` by metaphor)
136+
-->
137+
138+
* `&'a T``'a``T` において変性です( `*const T` も同じということがわかるでしょう)
139+
* `&'a mut T``'a` において変性ですが、 `T` においては非変性です
140+
* `Fn(T) -> U``T` において非変性ですが、 `U` においては変性です
141+
* `Box``Vec` や他の全てのコレクションは、要素の型において変性です
142+
* `UnsafeCell<T>``Cell<T>``RefCell<T>``Mutex<T>` や他の内部可変性型は `T` において
143+
非変性です( `*mut T` も同じということがわかるでしょう)
135144

136145
To understand why these variances are correct and desirable, we will consider
137146
several examples.

0 commit comments

Comments
 (0)