File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
crates/red_knot_python_semantic/src Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1135,7 +1135,7 @@ impl<'db> Type<'db> {
11351135 }
11361136
11371137 ( Type :: ClassLiteral ( _) , Type :: Callable ( _) ) => {
1138- let metaclass_call_symbol = self
1138+ let metaclass_call_function_symbol = self
11391139 . member_lookup_with_policy (
11401140 db,
11411141 "__call__" . into ( ) ,
@@ -1144,13 +1144,15 @@ impl<'db> Type<'db> {
11441144 )
11451145 . symbol ;
11461146
1147- if let Symbol :: Type ( Type :: BoundMethod ( new_function) , _) = metaclass_call_symbol {
1147+ if let Symbol :: Type ( Type :: BoundMethod ( metaclass_call_function) , _) =
1148+ metaclass_call_function_symbol
1149+ {
11481150 // TODO: this intentionally diverges from step 1 in
11491151 // https://typing.python.org/en/latest/spec/constructors.html#converting-a-constructor-to-callable
11501152 // by always respecting the signature of the metaclass `__call__`, rather than
11511153 // using a heuristic which makes unwarranted assumptions to sometimes ignore it.
1152- let new_function = new_function . into_callable_type ( db) ;
1153- return new_function . is_subtype_of ( db, target) ;
1154+ let metaclass_call_function = metaclass_call_function . into_callable_type ( db) ;
1155+ return metaclass_call_function . is_subtype_of ( db, target) ;
11541156 }
11551157 false
11561158 }
You can’t perform that action at this time.
0 commit comments