Better handling of Hash with default block but of the wrong type #15057
Labels
good first issue
This is an issue suited for newcomers to become aquianted with working on the codebase.
status:discussion
topic:stdlib:collection
Discussion
I'd like to see the error message related to missing hash keys improved to make some edge cases more clear.
I kept getting a
Missing hash key
exception and was very confused because the exception included the key and because of the default block, should not be possible. It ultimately was because ofcrystal/src/hash.cr
Line 1193 in 46ca8fb
Solutions I could think of are either to maybe have a dedicated error path when there is a block but its type doesn't match, or include the type of the key in the existing error message.
The text was updated successfully, but these errors were encountered: