Type refining also restricts assignment
This code:
type Foo = {
val: boolean,
}
local function foo(a: Foo)
if a.val == true then
return
end
a.val = true
end
causes the following error: Type 'true' could not be converted into 'false'. Even if the value can only be false here, it should let you assign it to the unrefined type it was
Thanks for the report! What version of luau-lsp are you using? This looks like a class of bug that has recently been fixed, and I'm unable to reproduce your error when running with the latest version of Luau, but I can reproduce it with an older version.
I use the vsc extension, I just updated it today to: 1.52.1. Im still able to reproduce it.
I only have this setting: "luau-lsp.fflags.enableNewSolver": true to enable the new solver, Im not sure if I need to do something else