Skip to content

Commit

Permalink
Cleaner (?) fix for crash in #2302
Browse files Browse the repository at this point in the history
  • Loading branch information
Guido van Rossum committed Oct 26, 2016
1 parent b8aa01b commit b9ecdf5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mypy/checkexpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1373,7 +1373,9 @@ def visit_reveal_type_expr(self, expr: RevealTypeExpr) -> Type:

def visit_type_application(self, tapp: TypeApplication) -> Type:
"""Type check a type application (expr[type, ...])."""
tp = cast(CallableType, self.accept(tapp.expr))
tp = self.accept(tapp.expr)
if not isinstance(tp, CallableType):
return AnyType()
return self.apply_generic_arguments(tp, tapp.types, tapp)

def visit_type_alias_expr(self, alias: TypeAliasExpr) -> Type:
Expand Down

0 comments on commit b9ecdf5

Please sign in to comment.