[Typed Luau] Script analyzer throws confusing warnings when type mismatches occur in strict mode

Occasionally, when a type mismatch occurs, typed Lua creates some strange warnings:
image

This is confusing and doesn’t really clarify what the problem is – in this example, you can identify it easily enough, but for larger functions, it would be harder.

This warning is also confusing and occurs in a similiar circumstance.
image

These both occur in Studio version 0.444.0.409999 with the typed Lua beta enabled.

3 Likes