Skip to content

(SOLVER V2) Table indexing does not properly handle metatables. #2165

@hardlyardi

Description

@hardlyardi

When indexing a table's field which can be nil, the type solver does not consider an __index value:

local nya: setmetatable<{
	meow: string?,
}, {
	__index: {
		meow: string,
	},
}>
-- TypeError: Type 'string?' could not be converted into 'string'
local purr: string = nya.meow

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions