Closed
Description
openedon Jan 25, 2024
π Search Terms
ts2556 ts2345
π Version & Regression Information
version: 5.3.3
β― Playground Link
No response
π» Code
const BoxGeometry = (_width: number, _height: number) => undefined;
const SphereGeometry = (_radius: number, _height: number, _openEnded?: boolean) => undefined;
export const Geometry = {
Box: BoxGeometry,
Sphere: SphereGeometry,
};
type GeometryType = keyof typeof Geometry;
export type GetArgument<T extends GeometryType> = Parameters<(typeof Geometry)[T]>;
export function load<T extends GeometryType>(type: T, args: GetArgument<T>) {
const geometry = Geometry[type](...args);
}
π Actual behavior
π Expected behavior
...args should not report an error
Additional information about the issue
No response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment