-
-
Save hinrik/afb7ac00748b88fcbb15515c0f918100 to your computer and use it in GitHub Desktop.
This file contains 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
alias IntOrNil = Array(Int32 | Nil) | |
mixed = [4, 5, nil] | |
ints = [6, 7] | |
array_storage = [] of IntOrNil | |
array_storage << mixed | |
array_storage << ints | |
hash_storage = {} of IntOrNil => Int32 | |
hash_storage[mixed] = 1 | |
hash_storage[ints] = 2 # This gives: | |
# in src/hash.cr:45: instantiating 'insert_in_bucket(Int32, Array(Int32), Int32)' | |
# | |
# entry = insert_in_bucket index, key, value | |
# ^~~~~~~~~~~~~~~~ | |
# | |
# in src/hash.cr:854: instantiating 'Hash::Entry(Array(Int32 | Nil), Int32):Class#new(Array(Int32), Int32)' | |
# | |
# return entry.next = Entry(K, V).new(key, value) | |
# ^~~ | |
# | |
# in src/hash.cr:898: instance variable '@key' of Hash::Entry(Array(Int32 | Nil), Int32) must be Array(Int32 | Nil), not Array(Int32) | |
# | |
# def initialize(@key : K, @value : V) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment