String.char has the wrong type information in Luau

In Luau, the argument type information for string.char is wrong; it has the first argument type as string, which is incorrect.

As an example, enter string.char(1) in a script. Even outside of strict mode, it will emit an error saying This function must be called with self. Did you mean to use a colon instead of a dot?

Replacing the 1 with "1" will cause that error to go away (though it will still complain until a second argument is provided).

As of May 20th the type signature for string.char was: (string,number,number?,number?,number?)->(string)

It should instead be: (number) -> (string) or something to that effect. string.char accepts a vararg so maybe it should be () -> string.


This is occurring in Studio version 0.442.3.409454.

3 Likes

Thanks for the report! We’ve filed this internally and we’ll follow up here when we have an update for you.

1 Like

This issue should now be resolved! If this issue is still occurring, please create a new topic for us to look into.

2 Likes