typeof is highlighted inconsistently inside generic type arguments
Description:
When multiple typeof() type expressions are used as generic type arguments, Roblox Studio highlights them using different colors even though they have the same syntactic role.
In the provided example, the first typeof is highlighted using the type color, while the second typeof is highlighted using the keyword or built-in global color.
Both expressions are valid type expressions and are used as type arguments for the same generic type. This appears to be a visual syntax-highlighting issue in the Script Editor.
Reproduction Steps:
- Open any place in Roblox Studio.
- Create or open a Script, LocalScript, or ModuleScript.
- Paste the following code:
type Pair<A, B> = {
a: A,
b: B,
}
local str = "aa"
local value = {
a = str,
b = str,
} :: Pair<typeof(str), typeof(str)>
- Compare the syntax highlighting of the two
typeofexpressions in the final line.
Actual Behavior:
The two typeof expressions are highlighted using different colors. The first one uses the type color, while the second one uses the keyword or built-in global color.
This can make it appear as though the two expressions are being interpreted differently, even though they are used in identical type positions.
Expected Behavior:
Both typeof expressions should be highlighted using the same color because they have the same syntactic role and are both being used as generic type arguments.
