Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mypy/semanal.py
Original file line number Diff line number Diff line change
Expand Up @@ -3786,7 +3786,7 @@ def visit_call_expr(self, expr: CallExpr) -> None:
expr.analyzed = PromoteExpr(target)
expr.analyzed.line = expr.line
expr.analyzed.accept(self)
elif refers_to_fullname(expr.callee, 'builtins.dict'):
elif isinstance(expr.callee, RefExpr) and expr.callee.fullname == 'builtins.dict':
expr.analyzed = self.translate_dict_call(expr)
elif refers_to_fullname(expr.callee, 'builtins.divmod'):
if not self.check_fixed_args(expr, 2, 'divmod'):
Expand Down
11 changes: 11 additions & 0 deletions test-data/unit/check-type-aliases.test
Original file line number Diff line number Diff line change
Expand Up @@ -659,3 +659,14 @@ reveal_type(w) # N: Revealed type is "__main__.Out.In"
reveal_type(x) # N: Revealed type is "__main__.Out.In.Inner"
reveal_type(y) # N: Revealed type is "__main__.Out.In.Inner"
reveal_type(z) # N: Revealed type is "__main__.Out.In"

[case testTypeAliasDictNoVarAnnotatedError]
from typing import Dict
D = Dict[str, str]
d = D()
[builtins fixtures/dict.pyi]

[case testTypeAliasListNoVarAnnotatedError]
from typing import List
L = List[str]
l = L()