List of Incorrectly Typed Datatype Functions

The following datatype functions are improperly typed, whether it be missing their arguments’ names or having them unspecified as any. Here is a list of all the corrected types.

Functions

type Axes.new = (...Enum.NormalId) -> Axes
type Faces.new = (...Enum.NormalId) -> Faces

type FloatCurveKey.new = (time: number, value: number, interpolation: Enum.KeyInterpolationMode) -> FloatCurveKey
type RotationCurveKey.new = (time: number, cframe: CFrame, interpolation: Enum.KeyInterpolationMode) -> RotationCurveKey
type NumberSequenceKeypoint.new = (time: number, value: number, envelope: number?) -> NumberSequenceKeypoint

type Instance.new = (className: string, parent: Instance?) -> Instance
type Instance.fromExisting(instance: Instance) -> Instance

type PhysicalProperties.new =
	| (material: Enum.Material) -> PhysicalProperties
	| (density: number, friction: number, elasticity: number) -> PhysicalProperties
	| (density: number, friction: number, elasticity: number, frictionWeight: number, elasticityWeight: number) -> PhysicalProperties

type Vector2.min = (...Vector2) -> Vector2
type Vector2.max = (...Vector2) -> Vector2
type Vector3.min = (...Vector3) -> Vector3
type Vector3.max = (...Vector3) -> Vector3
Note: Instance.fromExisting took a packed generic, but this meant it would allow any non-instance type. The best approach would to add a magic type.

Methods

type Vector2:Min = (...Vector2) -> Vector2
type Vector2:Max = (...Vector2) -> Vector2
type Vector3:Min = (...Vector3) -> Vector3
type Vector3:Max = (...Vector3) -> Vector3
type OverlapParams:AddToFilter = (instances: Instance | {Instance}) -> ()
type RaycastParams:AddToFilter = (instances: Instance | {Instance}) -> ()

There are some internal restrictions which prevent better typing of some of the Roblox methods.

This is incorrect, Axes can be constructed from Enum.Axis as well.

This is also incorrect, type packs are allowed to be empty, but these methods do not work without arguments.
Requiring at least two arguments instead of one is an intentional decision made by us.

Same here, it is our intention to require at least one argument as it catches more errors.

Current typechecker is not powerful enough to resolve this union, so this cannot be typed like this at the moment.

Generic works well enough, we prefer to keep typing in the bounds of Luau language when possible.