-
Notifications
You must be signed in to change notification settings - Fork 460
Closed
Labels
bugSomething isn't workingSomething isn't workingnew solverThis issue is specific to the new solver.This issue is specific to the new solver.
Description
Under the new solver and --!strict
, simple math in a loop seems to confuse it and it complains about failing to find operators +
and -
local function KahanSum(values: {number}): number
local sum: number = 0
local compensator: number = 0
for _, value in values do
local y = value - compensator
local t = sum + y
compensator = (t - sum) - y
sum = t
end
return sum
end
It throws errors on every line in the loop but the last. If I manually type y
as local y: number = value - compensator
the errors vanish.
Another snippet that triggers a similar issue for other operators:
local function HistogramString(values: {number})
local histogram = {}
values = table.clone(values)
table.sort(values)
local count = #values
local range = (count - 1)
local digitIndex = range // 2 + 1
while digitIndex < count and values[digitIndex] == 0 do
digitIndex = count - ((count - digitIndex) // 2)
end
end
11poe
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingnew solverThis issue is specific to the new solver.This issue is specific to the new solver.