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 Reader<out T> { | |
| // Compile-time error: Can't use 'out' type variable 'T' in an 'in' position. | |
| void write(T x) => print(x); | |
| // OK | |
| T read() => null; | |
| } | |
| class Writer<in T> { | |
| // Compile-time error: Can't use 'in' type variable 'T' in an 'out' position |
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
| // Add a contravariant variance modifier | |
| class Writer<in T> { | |
| void write(T x) => print(x); | |
| } | |
| main() { | |
| // Compile-time error: The constructor returns type 'Writer<int>' | |
| // that isn't of expected type 'Writer<Object>'. | |
| Writer<Object> objectWriter = Writer<int>(); | |
| } |
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 Writer<T> { | |
| void write(T x) => print(x); | |
| } | |
| main() { | |
| Writer<Object> objectWriter = Writer<int>(); | |
| objectWriter.write(“I’m a string!”); | |
| } |
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 MyContravariantClass<in T> {} | |
| mixin MyInvariantMixin<inout T> {} |
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 ReaderWriter<T> { | |
| void write(T x) => print(x); | |
| T read() => null; | |
| } | |
| main() { | |
| ReaderWriter<int> intRW = ReaderWriter<Object>(); | |
| // Any object can be returned, not just integers. This is unsafe. | |
| intRW.read(); |
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
| main() { | |
| // ... | |
| // Runtime error! | |
| // Unhandled exception: type 'String' is not a subtype of type 'int' of 'x' | |
| objectWriter.write("Hello world!"); | |
| } |
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 Writer<T> { | |
| void write(T x) => print(x); | |
| } | |
| main() { | |
| Writer<Object> objectWriter = Writer<int>(); | |
| objectWriter.write(2); | |
| } |
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
| main() { | |
| Iterable<Object> objectIterable = <int>[1, 2, 3]; | |
| } |
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
| <link href='https://fonts.googleapis.com/css?family=Pontano+Sans' rel='stylesheet' type='text/css'> | |
| <div class="container jumbotron"> | |
| <div class="text-center col-md-12"> | |
| <h1>Monty Oum</h1> | |
| <h3><em>Influential Animator and DDR Master</em></h3> | |
| <img class="monty-image" alt="Monty" src="https://upload.wikimedia.org/wikipedia/commons/c/c2/Monty_Oum_at_PAX_2013.jpg"> | |
| </div> | |
| <p class= "text-justify col-xs-12 col-md-8 col-md-offset-2 col-sm-10 col-sm-offset-3">Monty Oum was a self-taught animator who worked at Rooster Teeth, making animations for <em>Red Vs. Blue</em>. Afterwards, he created the animated series <em>RWBY</em>. He was occasionally on the RoosterTeeth podcasts and RTLife videos. Visit his <a href="http://roosterteeth.wikia.com/wiki/Monty_Oum">RTWikia</a> for more information.</p> | |
| <div class="text-center col-xs-12 col-md-8 col-md-offset-2 col-sm-10 col-sm-offset-3"> | |
| <h3>Filmography</h3> |
NewerOlder