Last active
June 24, 2017 04:44
-
-
Save ezura/2d8c733c0355394fc2fc9526f7e4f5cb to your computer and use it in GitHub Desktop.
p.163
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class B<out Any> {} | |
| val b: B<String> = B() | |
| val b_: B<out Any> = b // out あり | |
| b_ | |
| // B@5327a06e | |
| val b: B<String> = B() | |
| val b_: B<Any> = b // out なし | |
| b_ | |
| // B@31c2affc |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
上と下、同じに見える。使う側で out 指定する必要あるのか。ありなしでどういう違いがあるのか。(class とか func 宣言時に指定するなら意味があるのわかる)