Skip to content

Commit c964566

Browse files
committed
make ci happy
1 parent 4fbae1e commit c964566

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

mypy/checker.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -947,12 +947,12 @@ def check_func_def(self, defn: FuncItem, typ: CallableType, name: Optional[str])
947947
if ctx.line < 0:
948948
ctx = typ
949949
self.fail(message_registry.FUNCTION_PARAMETER_CANNOT_BE_COVARIANT, ctx)
950-
elif (isinstance(arg_type, Instance)
950+
elif (isinstance(get_proper_type(arg_type), Instance)
951951
and arg_type.type.fullname == 'builtins.list'
952-
and isinstance(self.iterable_item_type(arg_type), TypeVarType)
953-
and self.iterable_item_type(arg_type).variance == COVARIANT):
954-
message = "Cannot use a covariant type variable as a parameter"
955-
self.fail(message, arg_type)
952+
and isinstance(self.iterable_item_type(arg_type), TypeVarType)):
953+
if(self.iterable_item_type(arg_type).variance == COVARIANT):
954+
message = "Cannot use a covariant type variable as a parameter"
955+
self.fail(message, arg_type)
956956
if typ.arg_kinds[i] == nodes.ARG_STAR:
957957
# builtins.tuple[T] is typing.Tuple[T, ...]
958958
arg_type = self.named_generic_type('builtins.tuple',

0 commit comments

Comments
 (0)