Int autocast when visit a hash key is a Int or give compile error instead?

map = Hash(Int32, String).new { |hash, k| hash[k] = "#{k} " }

p map[13.to_i64]

Above code build no error, but will get runtime error.

Unhandled exception: Missing hash key: 13 (KeyError)
  from /home/zw963/Crystal/share/crystal/src/hash.cr:498 in '[]'
  from 1.cr:14:3 in '__crystal_main'
  from /home/zw963/Crystal/share/crystal/src/crystal/main.cr:129:5 in 'main_user_code'
  from /home/zw963/Crystal/share/crystal/src/crystal/main.cr:115:7 in 'main'
  from /home/zw963/Crystal/share/crystal/src/crystal/system/unix/main.cr:9:3 in 'main'
  from /usr/lib/libc.so.6 in '??'
  from /usr/lib/libc.so.6 in '__libc_start_main'
  from /home/zw963/.cache/crystal/crystal-run-1.tmp in '_start'
  from ???

I thought, can we give a compile-time error instead, or just autocast no any error?

Thanks

Related: Better handling of Hash with default block but of the wrong type · Issue #15057 · crystal-lang/crystal · GitHub

Is another issue referenced in this issue about adding type restrictions to Hash to make it more comp time safe, but it’s a breaking change so it’s kinda in limbo.