Skip to content

Conversation

@dhruvmanila
Copy link
Member

@dhruvmanila dhruvmanila commented Nov 6, 2025

No description provided.

@dhruvmanila dhruvmanila added the internal An internal refactor or improvement label Nov 6, 2025
@dhruvmanila dhruvmanila requested a review from dcreager as a code owner November 6, 2025 16:51
@dhruvmanila dhruvmanila added the ty Multi-file analysis & type inference label Nov 6, 2025
@dhruvmanila
Copy link
Member Author

Yikes, the main commit fails which is why there are failures in the CI as it tries to build a ty executable from main as well as this PR.

@MichaReiser
Copy link
Member

Are those checks failing because main isn't building?

Comment on lines 4897 to 4903
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)
}) {
Copy link
Member Author

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.

@dhruvmanila
Copy link
Member Author

Are those checks failing because main isn't building?

Yes!

@MichaReiser
Copy link
Member

Let's merge it. We can easily change it to not use try if we feel confident in a follow up PR

@MichaReiser MichaReiser merged commit 35640dd into main Nov 6, 2025
37 of 41 checks passed
@MichaReiser MichaReiser deleted the dhruv/fix-main branch November 6, 2025 20:10
dcreager added a commit that referenced this pull request Nov 7, 2025
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal An internal refactor or improvement ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants