|
47 | 47 | bind_self, |
48 | 48 | erase_to_bound, |
49 | 49 | freeze_all_type_vars, |
50 | | - function_type, |
51 | 50 | get_all_type_vars, |
52 | 51 | make_simplified_union, |
53 | 52 | supported_self_type, |
@@ -360,7 +359,7 @@ def analyze_instance_member_access( |
360 | 359 | if mx.is_lvalue and not mx.suppress_errors: |
361 | 360 | mx.msg.cant_assign_to_method(mx.context) |
362 | 361 | if not isinstance(method, OverloadedFuncDef): |
363 | | - signature = function_type(method, mx.named_type("builtins.function")) |
| 362 | + signature = mx.chk.function_type(method) |
364 | 363 | else: |
365 | 364 | if method.type is None: |
366 | 365 | # Overloads may be not ready if they are decorated. Handle this in same |
@@ -1325,7 +1324,7 @@ def analyze_class_attribute_access( |
1325 | 1324 | return AnyType(TypeOfAny.from_error) |
1326 | 1325 | else: |
1327 | 1326 | assert isinstance(node.node, SYMBOL_FUNCBASE_TYPES) |
1328 | | - typ = function_type(node.node, mx.named_type("builtins.function")) |
| 1327 | + typ = mx.chk.function_type(node.node) |
1329 | 1328 | # Note: if we are accessing class method on class object, the cls argument is bound. |
1330 | 1329 | # Annotated and/or explicit class methods go through other code paths above, for |
1331 | 1330 | # unannotated implicit class methods we do this here. |
@@ -1490,7 +1489,7 @@ def analyze_decorator_or_funcbase_access( |
1490 | 1489 | """ |
1491 | 1490 | if isinstance(defn, Decorator): |
1492 | 1491 | return analyze_var(name, defn.var, itype, mx) |
1493 | | - typ = function_type(defn, mx.chk.named_type("builtins.function")) |
| 1492 | + typ = mx.chk.function_type(defn) |
1494 | 1493 | if isinstance(defn, (FuncDef, OverloadedFuncDef)) and defn.is_trivial_self: |
1495 | 1494 | return bind_self_fast(typ, mx.self_type) |
1496 | 1495 | typ = check_self_arg(typ, mx.self_type, defn.is_class, mx.context, name, mx.msg) |
|
0 commit comments