How do I silence this error?

I’m working on a function that I’ll be using to copy raycast params. The problem is that I’m scripting with strict mode on and I got a warning, but have no idea how to silence it.

Here’s my current code:

--!strict

type Dictionary<KeyType, ValueType> = {[KeyType]: ValueType};
type table = Dictionary<any, any>;

local RaycastParamsProperties: table = {
	"CollisionGroup", 
	"FilterType", 
	"FilterDescendantsInstances", 
	"IgnoreWater"
};

local function DeepCopy(parameters: RaycastParams): RaycastParams?
	local new_parameters: RaycastParams = RaycastParams.new();
	
	for _, property: string in pairs(RaycastParamsProperties) do
		new_parameters[property] = parameters[property]; -- the error occurs on this line
	end;
	
	return new_parameters;
end;

The warning I’m receiving is, “Expected type table, got ‘RaycastParams’ instead.”

You can either:

  1. Cast parameters and new_parameters to any:
(new_parameters :: any)[property] = (parameters :: any)[property]
  1. Have them be of type any to begin with:
parameters: any
local new_parameters: any