Strict type solver infers object as "never"?

I’m not sure if this is a bug with the new type solver, but it seems to infers a Tool type variable as never.


I tried changing

chosen_weapon.Parent ~= REPLICATED_STORAGE.Weapons.Selectable

to

not chosen_weapon.Parent == REPLICATED_STORAGE.Weapons.Selectable

and it worked, but it’s practically the same thing and it yields a warning…
I added these server-sided sanity checks because I don’t trust Roblox’s anti-cheat system.
What should I do? Thanks for reading.

player_chosen_weapons is a nil and not a dictionary
Its pretty obvious that it simply will never heppen
Never means that this operation is impossible to heppen Type checking - Luau

1 Like

Sorry, forgot to mention player_chosen_weapons is a dictionary in the script.
chosen_weapon is the variable that, for some reason, is inferred as never, despite the fact that it can be confirmed to be a tool.

Try changing Tool? to Instance?

Then your early returns make this area of code simply unreachable i suppose