How do I create a nested Hash type?

This works for me:

$ crystal eval --time --progress --error-trace 'h=Hash{"one" => 1, "two" => Hash{"foo" => 3}}; printf %[debug: >#{h}< >%s< >%s< >%s<\n], h["one"], h["two"], h["two"];'   
debug: >{"one" => 1, "two" => {"foo" => 3}}< >1< >{"foo" => 3}< >{"foo" => 3}<
Execute: 00:00:00.012389834

But this fails:

$ crystal eval --time --progress --error-trace 'h=Hash{"one" => 1, "two" => Hash{"foo" => 3}}; printf %[debug: >#{h}< >%s< >%s< >%s<\n], h["one"], h["two"], h["two"]["foo"];'
error in line 1 (main)                   
Error: undefined method '[]' for Int32 (compile-time type is (Hash(String, Int32) | Int32))

What is the correct syntax to access the nested value of key "foo"?

In Perl this would be $h{two}{foo}.

After some playing I got this to work:

$ crystal eval --time --progress --error-trace 'h=Hash{"one" => 1, "two" => Hash{"foo" => 3}}; printf %[debug: >#{h}< >%s< >%s< >%s<\n], h["one"], h["two"], h["two"].as(Hash)["foo"];'
debug: >{"one" => 1, "two" => {"foo" => 3}}< >1< >{"foo" => 3}< >3<
Execute: 00:00:00.010882643

But it looks way less compact and efficient syntax like Perl. Is there a better way?