We need  a better way to distinguish between infer.Obj and infer.Fn since an Object may be identified as infer.Fn as in #4710. If I move this before ``intanceof infer.Fn`` check, then we fix the issue #4710.