From d339f1e0818ebf28074f8c33147ffac96d8bf34c Mon Sep 17 00:00:00 2001 From: 4DBug Date: Sun, 1 Nov 2026 19:59:50 -0600 Subject: [PATCH] types: Types.object metatable reads typed any; lint baseline 91 --- src/Rosetta/Types.luau | 12 ++++++------ tools/lint_types_baseline.txt | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Rosetta/Types.luau b/src/Rosetta/Types.luau index b99de1e..0ac4854 100644 --- a/src/Rosetta/Types.luau +++ b/src/Rosetta/Types.luau @@ -656,20 +656,20 @@ Types.null = table.freeze(setmetatable({}, nullMeta)) -- own) an entry in a weak map. local objectMeta: { [any]: { any } } = setmetatable({}, { __mode = "k" }) :: any -- object -> its key order local function orderOf(v: any): { any }? - local mt = getmetatable(v) + local mt: any = getmetatable(v) if type(mt) == "table" then - local k = rawget(mt, "__keys") + local k: any = rawget(mt, "__keys") if k ~= nil then return k end end return objectMeta[v] end -local NOKEYS = table.freeze({}) +local NOKEYS: { any } = table.freeze({}) :: any function Types.object(t: { [any]: any }?, keys: { any }?): { [any]: any } local o: { [any]: any } = t or {} - local k = keys or NOKEYS - local mt = getmetatable(o) + local k: { any } = keys or NOKEYS + local mt: any = getmetatable(o) if mt == nil or (type(mt) == "table" and rawget(mt, "__keys") ~= nil) then setmetatable(o, { __object = true, __keys = k }) else @@ -684,7 +684,7 @@ function Types.set(o: { [any]: any }, k: any, v: any) local order = orderOf(o) if order and o[k] == nil and v ~= nil then if order == NOKEYS then - local mt = getmetatable(o) + local mt: any = getmetatable(o) if type(mt) == "table" and rawget(mt, "__keys") == NOKEYS then mt.__keys = { k } else diff --git a/tools/lint_types_baseline.txt b/tools/lint_types_baseline.txt index cd5b025..7fe4e49 100644 --- a/tools/lint_types_baseline.txt +++ b/tools/lint_types_baseline.txt @@ -1 +1 @@ -92 +91