Erroneous warning with task.spawn/defer/delay/pcall/etc... and literals

If you expect a string literal as an argument to a function which is passed to task.spawn/defer/delay/pcall etc, you will get a warning erroneously telling you that “type could not be converted to ‘“literal”’”.

Example:

local function f(a: 'literal') end

task.spawn(f, 'literal') -- type string could not be converted to '"literal"'

local function g(a: true) end

task.spawn(g, true) -- type boolean could not be converted to '"true"'

Beta features
Have all beta features enabled

System info
AMD Ryzen 7 7800X3D 8-Core Processor @ 4.20 GHz
32.0GB DDR5 RAM @ 5200MHz (31.2 usable)
NVIDIA GeForce RTX 4080

1 Like

Thanks for the report! We’ll follow up when we have an update for you.

1 Like

Thanks for the report!

This is a real bug, but we won’t be prioritizing a fix because we’re focusing on a refresh of type inference right now. The new system should take care of issues like this.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.