Boo: Explicitly specifying the type of a hash

Posted by Kiv on Stack Overflow See other posts from Stack Overflow or by Kiv
Published on 2010-01-29T01:51:01Z Indexed on 2010/03/11 21:39 UTC
Read the original article Hit count: 366

Filed under:
|
|

I am new to Boo, and trying to figure out how to declare the type of a hash. When I do:

   myHash = {}
   myHash[key] = value
   (later)
   myHash[key].method()

the compiler complains that "method is not a member of object". I gather that it doesn't know what type the value in the hash is.

Is there any way I can declare to the compiler what type the keys and values of the hash are so that it won't complain?

© Stack Overflow or respective owner

Related posts about boo

Related posts about static-typing