When passing an Instance
to RaycastParams:AddToFilter()
within a script with strict mode enabled, Luau emits a type error warning about it expecting an argument of type {any}
, despite instances being supported by the engine and being mentioned in its documentation:
Repro file:
strictCast.rbxl (50.0 KB) (check ServerScriptService)
System info:
- OS: Windows 11 22H2 (ok seriously why is my pc not updating)
- Studio version: 0.614.0.614012
- CPU: Intel(R) Core™ i5-10400F CPU @ 2.90GHz
- Memory: 16GB 2400 MHz DDR4
- Storage: Yes
- GPU: NVIDIA GeForce RTX 3060
Beta features:
- Dragger QoL Improvements
- EditableImage and EditableMesh
- Faster Play Solo
- Grass Length Customization
- In-experience CSG improvements
- Luau Native Code
- New Studio Camera Controls
- Notched Screen Support
- Notification Overhaul
- Scripts Are Non-Strict By Default
- Terrain Editor
- Updated Roblox Controls
- Upgrade Shorelines
Expected behavior
No warning is emitted, and the method’s behaviour remains the same.