Skip to content

Cleaner (?) fix for crash in #2302 #2333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 26, 2016
Merged
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
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