Skip to content

Commit

Permalink
fixup! [red-knot] feat: resolve deferred type hints with __future__ a…
Browse files Browse the repository at this point in the history
…nnotations
  • Loading branch information
Slyces committed Sep 19, 2024
1 parent e4e0331 commit 301d065
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions crates/red_knot_python_semantic/src/semantic_index/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,11 +554,8 @@ where
// imports here, we assume the user's intent was to apply the `__future__`
// import, so we still check using it (and will also emit a diagnostic about a
// miss-placed `__future__` import.)
self.has_future_annotations |= alias.name.id.as_str() == "annotations"
&& node
.module
.as_ref()
.is_some_and(|module| module.id().as_str() == "__future__");
self.has_future_annotations |= alias.name.id == "annotations"
&& node.module.as_deref() == Some("__future__");

let symbol = self.add_symbol(symbol_name.clone());

Expand Down

0 comments on commit 301d065

Please sign in to comment.