Skip to content

New Solver: Metatables cannot handle intersection types in __index #2171

@IFMNB

Description

@IFMNB

This bug absolutely destroys any operations with automatic metatables type define in every generic functions. Every time i need do it myself to fix it by :: typeof(data) & generic_t0

local t0 = {a=true}
local t1 = {s=''}
local a = setmetatable({}, {__index={}::typeof(t0) & typeof(t1)})
local c = a.a -- type does not have a field a, but typecheck also does detect this is a boolean
local b = a.s -- type does not have a field s, but typecheck also does detect this is a string

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingnew solverThis issue is specific to the new solver.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions