There was a recent Luau regression causing it to flag method calls that were technically sound. I haven’t done enough investigation to find out what FFlag causes the issue, but I have a minimum repro.
--!strict
local C = {}
C.__index = C
function C.new(): C
local self = setmetatable({}, C)
self:update()
return self
end
export type C = typeof(C.new())
function C.update(self: C) end
The self:update()
line here should not be flagged as incorrect, and it actually wasn’t before a few days ago - but now it is.
Moving the update
definition above new
fixes the problem, leading me to believe that something might have happened with bidirectional typechecking(?), sealed tables(?), or any number of other things. This might actually be intended behavior if some sort of temporal analysis was added, but it seems incorrect.
The issue still occurs as of March 8th, 2022 on Roblox Studio version 0.516.0.5160305 (32bit). I have these FFlags set:
{
"DFFlagDisableDPIScale": false,
"DFFlagVariableDPIScale2": true,
"FFlagStudioFixHighDpiQml": true,
"FFlagStudioWindowsDpiScale": true
}