You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Regression on main: indexing table<string, V> gives unknown instead of V #1334
---@parampttable<string, integer>---@paramkstringlocalfunctiong(pt, k)
---@typebooleanlocala=pt.X-- 0.25.1: Cannot assign `integer` to `boolean`---@typebooleanlocalc=pt[k] -- 0.25.1: Cannot assign `integer` to `boolean`localu=pt.X.y-- 0.25.1: Undefined field `y`localv=pt.X() -- 0.25.1: Cannot call expression of type `integer`returna, c, u, vend---@typeintegerlocali=1---@typebooleanlocalctl=i-- control: warns on bothreturng, ctl
emmylua_check on 0.25.1 reports all four lines in g. On main (56267ead, 0.30.0) it reports only the control line. An index read of table<string, V> behaves as unknown: no assignment or argument mismatch, and indexing or calling it is allowed. It is the same for pt.X, pt['X'] and pt[k], for a parameter, and for a local typed with ---@type table<string, integer> (with or without an initializer).
Impact
Every table<string, V> read loses its type. With #1319 fixed, vim.env.X (---@type table<string, string?>) reads as unknown instead of string?.
Activity
test(semantic): cover `{ [K]: V }` reads and literal-key rejection (E…