Lots of types are unrecognized by script analysis

Lots of types aren’t recognized by script analysis when comparing typeof(x) to a string literal.

Example:
image
Example Code:

local t = 1
if typeof(t) == "CellId" then

end

Here is the list of all unrecognized types

Axes
CellId
ColorSequence
ColorSequenceKeypoint
DockWidgetPluginGuiInfo
Faces
NumberRange
NumberSequence
NumberSequenceKeypoint
PhysicalProperties
RBXScriptConnection
RBXScriptSignal
RbxLibrary
Region3int16
Vector2int16
Vector3int16
8 Likes

Thanks! Looks like our new type system has a few omissions. We’ll try to correct them quickly, for now you can use local typeof = typeof as a workaround (which will silence the warnings by not detecting them), or just live with them for a bit.

6 Likes

Does this mean type predicates are coming with typed lua? :eyes:

Yes - we will support type refinement through predicates. Typed Lua isn’t ready yet but we’re starting to migrate our existing code to share as much as possible with Luau - what you’re seeing is that script analysis is now internally driven by Luau parser and Luau type environment, even though the type system itself hasn’t been enabled yet.

1 Like

There are still a few missing types, PluginDrag and PathWaypoint are still not recognized by script analysis. Could these be added too?

print(typeof(PathWaypoint.new())=="PathWaypoint")
print(typeof(PluginDrag.new())=="PluginDrag")