Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add arguments to callee context in a call expression #3116
I think limiting the context to
((lambda x: x+1) if condition else (lambda x: x+2))("1")
So I would like to understand what are the potential problems with always propagating the context. Maybe there's another way to avoid these problems.
Agreed that the limitation makes this not very useful. The change in the output of a test case indicates that there was a behavior change elsewhere, and it might be because there is no type context when we infer the argument types, but I'm not sure. There is also the fact that the argument types are inferred repeatedly, which might result in poor performance when type checking large expressions, such as those that are machine-generated.
I wouldn't recommend making this much more complicated, since the code around type checking calls is already very difficult to understand. Maybe also special casing