Created
April 17, 2016 23:29
-
-
Save wmoxam/973e3d12204c8200ea39eda8382ae635 to your computer and use it in GitHub Desktop.
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
| abstract class Base | |
| end | |
| class Example1 < Base | |
| end | |
| class Example2 < Base | |
| end | |
| class Test | |
| setter :a | |
| end | |
| t1 = Test.new | |
| t1.a = Example1 | |
| t2 = Test.new | |
| t2.a = Example2 | |
| # crystal tool hierarchy test.cr | |
| +- class Reference (4 bytes) | |
| | | |
| +- class Test (24 bytes) | |
| | @a : Base+:Class? (16 bytes) | |
| How can I specify an array of Base+:Class ? | |
| klasses = [] of Base+ | |
| klasses << Example1 | |
| -- > no overload matches 'Array(Base+)#<<' with type Example1:Class | |
| klasses = [] of Base+:Class | |
| -- > unexpected token: Class |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment