I’m just wondering how I would specify a type for a quadratic bezier function that accepts any interpolate-able value and to ascertain that the function call is valid? Currently I have a function that just calls each of their lerp methods doing p0:lerp(p1:lerp(p2, t), t). The issue is that when I try assigning a type to the variables p0, p1 and p2, it just gives me type checking errors. Is it possible to do what I’m trying to do?
Currently, the type Interpolatable is specified as CFrame | Vector3 | Vector2 | UDim2 | Color3, all of which have Lerp methods. Any ideas to get rid of the type checking errors?
I’ve tried using & instead of |, but I still get type checking errors on the other side, when trying to call the method, stating that type isn’t compatible.
Edit: I think I found a solution by doing a hacky type assertion thing but I’m still not sure it’s the proper solution: