You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exportclassA{privatedistanceToConstraints(p: Point): number;privatedistanceToConstraints(x: number,y: number): number;privatedistanceToConstraints(...args: any[]): number{if(args.length===1&&args[0]instanceofPoint){letp: Point=args[0];return1;}if(args.length===2&&typeofargs[0]==="number"&&typeofargs[1]==="number"){letx: number=args[0];lety: number=args[1];return2;}thrownewError("overload does not exist");}}
I think it should work for now. I only worry about the typeof .. === "number" etc. checks. These might be to restrictive. (following: "Be liberal in inputs and conservative in your outputs").
Loosening the input restrictions could lead to not be able to identify the input signatures correctly anymore.
The text was updated successfully, but these errors were encountered:
currently I implemented this concept:
I think it should work for now. I only worry about the
typeof .. === "number"
etc. checks. These might be to restrictive. (following: "Be liberal in inputs and conservative in your outputs").Loosening the input restrictions could lead to not be able to identify the input signatures correctly anymore.
The text was updated successfully, but these errors were encountered: