File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 124124from mypy .subtypes import (
125125 covers_at_runtime ,
126126 find_member ,
127- is_equivalent ,
128127 is_same_type ,
129128 is_subtype ,
130129 non_method_protocol_members ,
@@ -1845,7 +1844,7 @@ def check_callable_call(
18451844 if (
18461845 callee .is_type_obj ()
18471846 and (len (arg_types ) == 1 )
1848- and is_equivalent (callee .ret_type , self . named_type ( "builtins.type" ) )
1847+ and is_named_instance (callee .get_instance_type (), "builtins.type" )
18491848 ):
18501849 callee = callee .copy_modified (ret_type = TypeType .make_normalized (arg_types [0 ]))
18511850
Original file line number Diff line number Diff line change @@ -7324,11 +7324,12 @@ class A:
73247324 pass
73257325
73267326class B:
7327- def __new__(cls) -> Any:
7327+ def __new__(cls, x: int = 0 ) -> Any:
73287328 pass
73297329
73307330reveal_type(A()) # N: Revealed type is "__main__.A"
73317331reveal_type(B()) # N: Revealed type is "Any"
7332+ reveal_type(B(1)) # N: Revealed type is "Any"
73327333
73337334[case testNewReturnType3]
73347335
You can’t perform that action at this time.
0 commit comments