local Children = newproxy()
local Macro:{[string|typeof(Children)]:true} = {
["_exec"] = true;
["_run"] = true;
["_init"] = true;
["_base"] = true;
["Class"] = true;
["_count"] = true;
[Children] = true;
}
Expected behavior
Guys, wth is going on with new typesolver in a past week? Its fully unusable
Roblox studio having a bunch of script error are so common nowadays
So annoying how new typesolver was great at giving better autocompletion and no type errors, but in the past month or 2 it has been completely ruined.
Great job Roblox.
Try true? or boolean, despite not having a false or nil to get rid of the current error
I know I eventually put in boolean, but the problem still persists.
I always used “true” generic instead of boolean in types where, well, it’s always true and not just a boolean. This error has been happening for about 2 weeks now.
More accurate title:
“Strings and booleans should be inferred literally when used as a generic”
I reported this 4 years ago and the fact its still not fixed in the new solver.
Heres an example of the string inferrence issue:
type Symbol<T> = ...
local function Symbol<T>(key: T): Symbol<T>
end
local sym1 = Symbol("Cat") --> Symbol<string>
local sym2: Symbol<"Cat"> = Symbol("Cat") --> TypeError: Symbol<string> cannot be converted to Symbol<"Cat">
That’s strange.
Is it maybe generics that is so odd?
It has not been happening to me with regular tables until recently.
This is a known problem with the new solver: it’s difficult to infer what the programmer intends when mixing generic types with singletons. We’ve been trying to focus on performance and stability as of late, but I am sorry to hear you’ve been running into issues.
We’re hoping to do some spot fixes to make the experience for singletons more consistent.
Hello! Sorry for the delay, but checking back in to say the initial issue is fixed:
--!strict
local Children = newproxy()
local Macro:{[string|typeof(Children)]:true} = {
["_exec"] = true;
["_run"] = true;
["_init"] = true;
["_base"] = true;
["Class"] = true;
["_count"] = true;
[Children] = true;
}
This snippet no longer errors. I see there’s another comment about:
type Symbol<T> = ...
local function Symbol<T>(key: T): Symbol<T>
end
local sym1 = Symbol("Cat") --> Symbol<string>
local sym2: Symbol<"Cat"> = Symbol("Cat")
I believe this still errors, but I would encourage another ticket to address this issue.