There are two conditions I have noticed where my Luau types are incorrect. The first one is in this example:
The
CustomKeyframe
type is incorrectly coerced to a boolean, even though the actual part of the check I used was the Broken
property of the object… not the object itself
Another case where the type checker failed was in this example scenario:
Here the method’s types function just fine, but when placed in an
if
statement:It appears to lose track of the type and casts the method call to
unknown
Expected behavior
The if
statement should be checking the type of the object and coercing / casting it appropriately given the nature of the clause, as opposed to not understanding method call types nor properties of custom objects. It also should not abstract away custom types, like expanding CustomKeyframe
into its full type information, it should just say the CustomKeyframe
type for self