Use declared types in inference and checking. This means several things: * Imports prefer declarations over inference, when declarations are available. * When we encounter a binding, we check that the bound value's inferred type is assignable to the live declarations of the bound symbol, if any. * When we encounter a declaration, we check that the declared type is assignable from the inferred type of the symbol from previous bindings, if any. * When we encounter a binding+declaration, we check that the inferred type of the bound value is assignable to the declared type.
26 lines
671 B
Rust
26 lines
671 B
Rust
use std::hash::BuildHasherDefault;
|
|
|
|
use rustc_hash::FxHasher;
|
|
|
|
pub use db::Db;
|
|
pub use module_name::ModuleName;
|
|
pub use module_resolver::{resolve_module, system_module_search_paths, vendored_typeshed_stubs};
|
|
pub use program::{Program, ProgramSettings, SearchPathSettings, SitePackages};
|
|
pub use python_version::PythonVersion;
|
|
pub use semantic_model::{HasTy, SemanticModel};
|
|
|
|
pub mod ast_node_ref;
|
|
mod db;
|
|
mod module_name;
|
|
mod module_resolver;
|
|
mod node_key;
|
|
mod program;
|
|
mod python_version;
|
|
pub mod semantic_index;
|
|
mod semantic_model;
|
|
pub(crate) mod site_packages;
|
|
mod stdlib;
|
|
pub mod types;
|
|
|
|
type FxOrderSet<V> = ordermap::set::OrderSet<V, BuildHasherDefault<FxHasher>>;
|