From ecc51e4b3368dc031846199f38756c0f0082297e Mon Sep 17 00:00:00 2001 From: LiuYuHui Date: Wed, 5 Aug 2020 21:40:48 +0800 Subject: [PATCH] make CI happy --- mypy/checker.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mypy/checker.py b/mypy/checker.py index b8976dbcb54e9..26d41f558fa54 100644 --- a/mypy/checker.py +++ b/mypy/checker.py @@ -947,7 +947,8 @@ def check_func_def(self, defn: FuncItem, typ: CallableType, name: Optional[str]) if ctx.line < 0: ctx = typ self.fail(message_registry.FUNCTION_PARAMETER_CANNOT_BE_COVARIANT, ctx) - elif (is_named_instance(arg_type, 'builtins.list') + elif (isinstance(arg_type, Instance) + and is_named_instance(arg_type, 'builtins.list') and isinstance(self.iterable_item_type(arg_type), TypeVarType)): if(self.iterable_item_type(arg_type).variance == COVARIANT): message = "Cannot use a covariant type variable as a parameter"