This is not possible in Boo. Boo uses implicit static typing. Thus, all variables are strongly typed based on their first assignment within their scope. Once assigned, the type of the variable cannot change.
Garbage collection ensures that objects on the heap that are no longer referenced will be removed from the heap, but they will not affect the scope of the individual variables of each language. In Boo, a variable does not go out of scope until the end of the block in which it was defined.
The duck introduced in Boo is processed by the compiler, which assigns it a static type of "object", and then uses the runtime code to accomplish the dullness that the underlying .NET runtime considers a common object.
source share