1. raise an inference error
2. allow a to be a variant type of either int or string
3. allow a to change types as many times as you want, with all references
lexically after a given type-change using that new type
I don't really like 3. Option 1 would be simplest, obviously, and probably
should be the initial way it behaves. Option 2 could come later, if we decide
to improve the compile-time type system in that way.
headius added a comment - 13/Oct/09 09:28 PM I suppose there's three things you could do here:
1. raise an inference error
2. allow a to be a variant type of either int or string
3. allow a to change types as many times as you want, with all references
lexically after a given type-change using that new type
I don't really like 3. Option 1 would be simplest, obviously, and probably
should be the initial way it behaves. Option 2 could come later, if we decide
to improve the compile-time type system in that way.
I suppose there's three things you could do here:
1. raise an inference error
2. allow a to be a variant type of either int or string
3. allow a to change types as many times as you want, with all references
lexically after a given type-change using that new type
I don't really like 3. Option 1 would be simplest, obviously, and probably
should be the initial way it behaves. Option 2 could come later, if we decide
to improve the compile-time type system in that way.