Last active
November 5, 2017 22:56
-
-
Save hinrik/17f1075edc50cb6c7c315db819a5fa58 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 struct Foo | |
end | |
struct Bar < Foo | |
end | |
struct Baz < Foo | |
end | |
hash = {} of Foo => Int32 | |
bar = Bar.new | |
baz = Baz.new | |
hash[bar] = 3 | |
hash[baz] = 5 | |
p hash | |
p hash[bar] | |
p hash[baz] # Missing hash key: Baz() (KeyError) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment