Explosion.Hit type checking uses Instance instead of BasePart

Issue:
Explosion.Hit:Connect uses (Instance, number) instead of (BasePart, number) (Take note of how BasePart.Touched uses (BasePart).) Explosion.Hit will only fire for BaseParts so using Instance in the type checking is a bit confusing and also hides BasePart specific functions from the type checker.

See: Explosion | Roblox Creator Documentation

Expected Behavior:
Change the Instance type checking to BasePart. This will allow the type checker to know that BasePart functions exist on the Instance being passed so developers don’t get warnings for this.

Repro:

local Expl:Explosion = Instance.new'Explosion'
Expl.Hit:Connect(function(Part: BasePart, Distance:number): ()
	print('Hit part: ' .. Part:GetFullName())
end)

Pictures:
image
image

2 Likes

Thanks for the report! We’ve filed a ticket to our internal database and we’ll follow up when we have an update for you.

1 Like

Release 500 has fixed this.

2 Likes

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