-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fix main by using infer_expression
#21299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Yikes, the |
384b697 to
6e9b398
Compare
6e9b398 to
1f0f03c
Compare
|
Are those checks failing because main isn't building? |
| if let Some(default) = arguments.find_keyword("default") { | ||
| let func_ty = self.get_or_infer_expression(func, TypeContext::default()); | ||
| let func_ty = self | ||
| .try_expression_type(func) | ||
| .unwrap_or_else(|| self.infer_expression(func, TypeContext::default())); | ||
| if func_ty.as_class_literal().is_some_and(|class_literal| { | ||
| class_literal.is_known(self.db(), KnownClass::ParamSpec) | ||
| }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think at this point, the expression should've already been inferred because this is in the deferred region and the function symbol should've already been inferred. So, I could directly use self.expression_type instead.
Yes! |
|
Let's merge it. We can easily change it to not use |
* origin/main: Remove duplicate preview tests for `FURB101` and `FURB103` (#21303) [ty] Add support for `Literal`s in implicit type aliases (#21296) [ty] Add missing `heap_size` to `variance_of` queries (#21318) [`pyupgrade`] Fix false positive on relative imports from local `.builtins` module (`UP029`) (#21309) [ty] Make range/position conversions fallible (#21297) Bump 0.14.4 (#21306) Fix main by using `infer_expression` (#21299) [ty] Understand legacy and PEP 695 `ParamSpec` (#21139) [ty] Discover site-packages from the environment that ty is installed in (#21286) [ty] Make special cases for `UnionType` slightly narrower (#21276) Require ignore 0.4.24 in `Cargo.toml` (#21292) [ty] Favour imported symbols over builtin symbols (#21285) docs: revise Ruff setup instructions for Zed editor (#20935) [ty] Update salsa (#21281) [syntax-error]: no binding for nonlocal PLE0117 as a semantic syntax error (#21032)
No description provided.