Calling getmetatable
on this unioned table type from a function:
type Table = {
property: any,
[any]: any?
} | {}
causes Studio to crash only when:
- the new Lua script analysis beta feature is on,
- the
Table
type is referenced as an argument to a function, -
getmetatable
is called on that argument, - the two table types are unioned in that specific order,
- the
property
token is 3 characters or larger, - and the function token is 3 characters or larger
The crash may not occur immediately when pasted. Undoing and repasting the code will eventually cause studio to crash, however. The minimum amount of repasting I had to do was only five times, and that only happened once in my own testing.
I just discovered this bug today.
Repro
- Create a new baseplate place,
- Paste this code into any Luau source container:
type T = {
___: any,
[any]: any
} | {}
local function ___(t: T)
getmetatable(t)
end
- Studio should crash immediately, and if not, undo the operation and repeat step 2.
Specs
OS: Windows 10
CPU: AMD Ryzen 7 1700 Eight-Core Processor
Memory: 16.0 GB
GPU: Radeon RX 550