Skip to content

Commit d619ba7

Browse files
committed
Handle missing type context in list concatenation check
1 parent b30a94f commit d619ba7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

mypy/checkexpr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3612,7 +3612,7 @@ def visit_op_expr(self, e: OpExpr) -> Type:
36123612
# Expressions of form list + list under a list type context get special
36133613
# type inference so literals/comprehensions honor the outer context.
36143614
ctx = get_proper_type(self.type_context[-1])
3615-
if is_named_instance(ctx, "builtins.list"):
3615+
if ctx is not None and is_named_instance(ctx, "builtins.list"):
36163616
return self.check_list_add(e)
36173617
if e.op == "%":
36183618
if isinstance(e.left, BytesExpr):

0 commit comments

Comments
 (0)