4 ms·
I don't know, but generally call-site inference has a couple of notable issues: - If you don't have any calls to the function yet (i.e. "bar(foo)" wasn't there
by billti 10y ago
I don't know, but generally call-site inference has a couple of notable issues:
- If you don't have any calls to the function yet (i.e. "bar(foo)" wasn't there above), then there is nothing to infer from, so you have no idea what the type is at this point (other than by the use of the parameter inside the function).
- Is your call-site wrong? If the parameter type is explicit, this is easily checked. If not, then again you can only go by what the function does with it. (Which may not be much help if it's something like "RestAPI.post(JSON.stringify(theParamInQuestion))" ).