luau-lang / luau

A fast, small, safe, gradually typed embeddable scripting language derived from Lua
https://luau-lang.org
MIT License
3.79k stars 349 forks source link

For loop variable types not inferred from generic iterator with new type solver #1270

Open Ketasaja opened 1 month ago

Ketasaja commented 1 month ago
--!strict
local i: {number} = {}

for j, k in next, i do -- j has type `K`, k has type `V`
end

Tested on 0.627.