luau icon indicating copy to clipboard operation
luau copied to clipboard

String and boolean literals being inferred as `string` and `boolean` types rather than the literal type during table construction with metatable

Open centau opened this issue 2 years ago • 0 comments

Screenshots below demonstrate the bug:

image

image

Source:

type Foo = typeof(setmetatable(
    {} :: {
        Bar: false
    },
    {} :: {}
))

local foo: Foo = setmetatable({ Bar = false }, {})

centau avatar Apr 03 '23 19:04 centau