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
This program unexpectedly compiles with no error or warning about the superfluous type annotation
local x: integer, string = 1
It's probably worth it to emit an error or warning when the number of types is greater than the number of variables declared.
The troublesome part of making this an error or warning could prevent some obscure corner case of using an annotation for bidirectional inference regarding generic function returns.
Even this contrived example is probably better off without the annotation but is technically a use case:
global func: function<T, U>(U): T, U
local x: integer, string = func(1)
The text was updated successfully, but these errors were encountered:
Oh, good call with the latter example there, though it might be simpler to treat the whole count mismatch as a bug and require that the user does local x, _ there.
This program unexpectedly compiles with no error or warning about the superfluous type annotation
It's probably worth it to emit an error or warning when the number of types is greater than the number of variables declared.
The troublesome part of making this an error or warning could prevent some obscure corner case of using an annotation for bidirectional inference regarding generic function returns.
Even this contrived example is probably better off without the annotation but is technically a use case:
The text was updated successfully, but these errors were encountered: