I’m well aware that is not a standard Roblox type. Thank you studio, message received. Now how do I make it shutup about it if you even can?
I’m well aware that is not a standard Roblox type. Thank you studio, message received. Now how do I make it shutup about it if you even can?
By fixing the warning. Unless createdParts[k]
is a custom part class instance, this should be intended behavior.
It is a custom part class instance.
Overloading IsA on a custom class here is extremely useful in my use case, and prevents me from having to do a ton of much more annoying type checking.
I would probably recommend moving to an external editor, like vscode, where you can suppress these warnings. Otherwise, I recommend an alternative ‘name’ like class:is()
instead of class:IsA()
The problem is that I am using this table as a map of mixed objects. There are real BaseParts in that map as well as my spoofed deallocated parts, so using :is() will throw an error.
It’s disappointing that the only solution seems to be
A) Make my code less readable
B) Deal with it
C) Don’t use the editor that comes with the engine
Off to feature requests I go if there are no better solutions .
Edit: Hahaha, wait. I can’t post there, and they removed the post approval process. I can’t ask someone to post for me since that’s against the rules too. Given literally no alternative, I’m now left frustrated.
You could wrap the string under question in parentheses. createdParts[k]:IsA(("DeallocatedPart"))
. This is because the linter is pattern matching for these expressions, but sometimes it has false positives like this. We want to improve it to be more type aware.
Alternatively, you can disable this particular lint pass in whole by writing --!nolint UnknownType
on the top of the script, but that’s going to disable potentially real issues. It’s documented in Linting - Luau.