Luau typechecking interprets GetEnumItems incorrectly

local normalIds: {Enum.NormalId} = Enum.NormalId:GetEnumItems()
--> Type '{EnumItem}' could not be converted into '{Enum.NormalId}'

Enum.GetEnumItems is always considered to be (Enum)->{EnumItem} regardless of the actual return value. Each enum’s GetEnumItems function actually returns an array of the same type of enum. Enum.NormalId.GetEnumItems should be interpreted as (typeof(Enum.NormalId))->{Enum.NormalId}, Enum.AssetType.GetEnumItems should be (typeof(Enum.AssetType))->{Enum.AssetType}, and so on.

Thanks for the report! We’ve filed a ticket to our internal database and we’ll follow up when we have an update for you.

3 Likes

A fix should be available in the Studio update next week.

2 Likes