You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it could be helpful to provide simple type inference for let and for statements, to make the language a little cleaner. So the following would be allowed:
let x: u8 = 7
let y = x --[[ y is u8 ]]
let z: [u16; 4] = [1, 2, 3, 4]
for w in z do
--[[ w is u16 ]]
end
Since the type-checker has to derive what y and w should be anyway, it should be simple to allow it to just assume the type. (One might want y or w to be a longer type, but we'd still have to derive u8 and u16 respectively to determine which types are longer.)
The text was updated successfully, but these errors were encountered:
I definitely think that we should have explicit types in the function signatures, for what it's worth. I don't really see us having more complicated type inference than what I'm suggesting above.
I think it could be helpful to provide simple type inference for
let
andfor
statements, to make the language a little cleaner. So the following would be allowed:Since the type-checker has to derive what
y
andw
should be anyway, it should be simple to allow it to just assume the type. (One might wanty
orw
to be a longer type, but we'd still have to deriveu8
andu16
respectively to determine which types are longer.)The text was updated successfully, but these errors were encountered: