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 would expect the type of these two enum values to simply be CustomGameState, instead their type is CustomGameState|CUSTOM_GAME_STATE_PHASE_1A, a union with themself. I do not want this union, it messes up all my definitions.
The text was updated successfully, but these errors were encountered:
I do not agree with that fix, that changes the subtype definition of a union type, which was fine. The issue is that global variables are declared as their own global type, even though they have a special type definition.
The issue here is the type of the variable, not the definition of subtype of union, which is now incorrect. This would mean that a function requiring type string|number (requiring string or number) would allow a variable of string|boolean (string or boolean) as input. This would mean it would allow assignment of booleans to fields that expect numbers or strings:
---@returnnumber | stringfunctionmyfun()
---@typenumber | booleanlocalmyvar=truereturnmyvar-- Allowed in your version! Returns true while return type is number|string.end
When defining a global variable, such as:
I would expect the type of these two enum values to simply be
CustomGameState
, instead their type isCustomGameState|CUSTOM_GAME_STATE_PHASE_1A
, a union with themself. I do not want this union, it messes up all my definitions.The text was updated successfully, but these errors were encountered: