RaycastParams and OverlapParams have incorrect type for FilterDescendantsInstances

Repro steps:

  • This script in the New Luau Type Solver beta (not sure if it’s required):
--!strict

local parts: { BasePart } = {}

local rayParams = RaycastParams.new()
rayParams.FilterDescendantsInstances = parts

local overlapParams = OverlapParams.new()
overlapParams.FilterDescendantsInstances = parts

Expected behavior:
No warnings

Actual behavior:
There are warnings because of this, due to the type of FilterDescendantsInstances being { Instance } and not { BasePart }.

This is a problem in code which accumulates the filter dynamically and uses the correct type to store the parts.

1 Like

Fixing this requires a new language feature (read-only arrays).

We want to do this eventually, but we can’t prioritize it just yet.

2 Likes

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