Skip to content

Commit

Permalink
Make error messages about invalid stdlib pop up in the right place
Browse files Browse the repository at this point in the history
Reviewed By: stroxler

Differential Revision: D66503476

fbshipit-source-id: 3b5f65b0ae45c85ab0b0461eb032e604e4ef949b
  • Loading branch information
ndmitchell authored and facebook-github-bot committed Nov 26, 2024
1 parent 6d55815 commit 07fa743
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pyre2/pyre2/bin/alt/answers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,12 @@ impl<'a> Answers<'a> {
match solver.get_import(name, module, TextRange::default()) {
Type::ClassDef(cls) => Some(cls),
ty => {
tracing::error!(
"Did not expect non-class type `{ty}` for stdlib import `{module}.{name}`"
self.errors.add(
self.bindings.module_info(),
TextRange::default(),
format!(
"Did not expect non-class type `{ty}` for stdlib import `{module}.{name}`"
),
);
None
}
Expand Down

0 comments on commit 07fa743

Please sign in to comment.