Something is wrong there.
Type c1- Hash(String, Type)which is not one of the union types Type. Hash(String, Type)not compatible with Hash(String | Symbol, Type).
Either include Hash(String, Type)in the union Type, or give a c1type Hash(String | Symbol, Type)(i.e. HOpts):
c1 = HOpts.new
You will also have another error in this line of code:
ctx["stuff"]["foo"] = { "bar" => 1 }
ctx["stuff"] Type, , . , ctx["stuff"] ( ), . , { "bar" => 1 } Hash(String, Int32), Hash(String, Type), :
ctx["stuff"].as(HOpts)["foo"] = HOpts{ "bar" => 1 }