-
Notifications
You must be signed in to change notification settings - Fork 505
Open
Labels
bugSomething isn't workingSomething isn't working
Description
export type function tblpartial(tbl: type)
assert(tbl:is("table"), "tblpartial can only be applied to tables")
local new = types.newtable()
for k, v in tbl:properties() do
local read = assert(v.read, "properties cannot be write-only")
new:setreadproperty(k, types.optional(read))
end
return new
end
local function tblmerge<T>(base: T, override: tblpartial<T>): T error("unimplemented") end
tblmerge({ a = 1 }, {}) -- Type '{ }' could not be converted into '{ read a: number? }'This code causes the type error commented on the last line. Expected behavior would be that there are no type errors here.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working