@@ -21,7 +21,6 @@ use smallvec::SmallVec;
2121use strum:: IntoEnumIterator ;
2222use ty_module_resolver:: { KnownModule , ModuleName , resolve_module} ;
2323
24- use super :: deferred;
2524use super :: {
2625 DefinitionInference , DefinitionInferenceExtra , ExpressionInference , ExpressionInferenceExtra ,
2726 FunctionDecoratorInference , InferenceRegion , ScopeInference , ScopeInferenceExtra ,
@@ -130,6 +129,7 @@ mod function;
130129mod imports;
131130mod named_tuple;
132131mod paramspec_validation;
132+ mod post_inference;
133133mod subscript;
134134mod type_expression;
135135mod typed_dict;
@@ -263,7 +263,7 @@ pub(super) struct TypeInferenceBuilder<'db, 'ast> {
263263 /// A set of functions that have been defined **and** called in this region.
264264 ///
265265 /// This is a set because the same function could be called multiple times in the same region.
266- /// This is mainly used in [`deferred ::overloaded_function::check_overloaded_function`] to
266+ /// This is mainly used in [`post_inference ::overloaded_function::check_overloaded_function`] to
267267 /// check an overloaded function that is shadowed by a function with the same name in this
268268 /// scope but has been called before. For example:
269269 ///
@@ -680,12 +680,12 @@ impl<'db, 'ast> TypeInferenceBuilder<'db, 'ast> {
680680 let ty = ty_and_quals. inner_type ( ) ;
681681 match definition. kind ( self . db ( ) ) {
682682 DefinitionKind :: Function ( function) => {
683- deferred :: function:: check_function_definition (
683+ post_inference :: function:: check_function_definition (
684684 & self . context ,
685685 * definition,
686686 & |expr| self . file_expression_type ( expr) ,
687687 ) ;
688- deferred :: overloaded_function:: check_overloaded_function (
688+ post_inference :: overloaded_function:: check_overloaded_function (
689689 & self . context ,
690690 ty,
691691 * definition,
@@ -694,15 +694,15 @@ impl<'db, 'ast> TypeInferenceBuilder<'db, 'ast> {
694694 & mut seen_overloaded_places,
695695 & mut seen_public_functions,
696696 ) ;
697- deferred :: typeguard:: check_type_guard_definition (
697+ post_inference :: typeguard:: check_type_guard_definition (
698698 & self . context ,
699699 ty,
700700 function. node ( self . module ( ) ) ,
701701 self . index ,
702702 ) ;
703703 }
704704 DefinitionKind :: Class ( class_node) => {
705- deferred :: static_class:: check_static_class_definitions (
705+ post_inference :: static_class:: check_static_class_definitions (
706706 & self . context ,
707707 ty,
708708 class_node. node ( self . module ( ) ) ,
@@ -715,11 +715,14 @@ impl<'db, 'ast> TypeInferenceBuilder<'db, 'ast> {
715715 }
716716
717717 for definition in & deferred_definitions {
718- deferred:: dynamic_class:: check_dynamic_class_definition ( & self . context , * definition) ;
718+ post_inference:: dynamic_class:: check_dynamic_class_definition (
719+ & self . context ,
720+ * definition,
721+ ) ;
719722 }
720723
721724 for function in & self . called_functions {
722- deferred :: overloaded_function:: check_overloaded_function (
725+ post_inference :: overloaded_function:: check_overloaded_function (
723726 & self . context ,
724727 Type :: FunctionLiteral ( * function) ,
725728 function. definition ( self . db ( ) ) ,
@@ -730,7 +733,7 @@ impl<'db, 'ast> TypeInferenceBuilder<'db, 'ast> {
730733 ) ;
731734 }
732735
733- deferred :: final_variable:: check_final_without_value ( & self . context , self . index ) ;
736+ post_inference :: final_variable:: check_final_without_value ( & self . context , self . index ) ;
734737 }
735738 }
736739
@@ -1449,7 +1452,7 @@ impl<'db, 'ast> TypeInferenceBuilder<'db, 'ast> {
14491452 // Check that no type parameter with a default follows a TypeVarTuple
14501453 // in the type alias's PEP 695 type parameter list.
14511454 if let Some ( type_params) = type_alias. type_params . as_deref ( ) {
1452- deferred :: type_param_validation:: check_no_default_after_typevar_tuple_pep695 (
1455+ post_inference :: type_param_validation:: check_no_default_after_typevar_tuple_pep695 (
14531456 & self . context ,
14541457 type_params,
14551458 ) ;
0 commit comments