Type check an index expression (base[index]). It may also represent type application.
(self, e: IndexExpr)
| 4487 | return result |
| 4488 | |
| 4489 | def visit_index_expr(self, e: IndexExpr) -> Type: |
| 4490 | """Type check an index expression (base[index]). |
| 4491 | |
| 4492 | It may also represent type application. |
| 4493 | """ |
| 4494 | result = self.visit_index_expr_helper(e) |
| 4495 | result = self.narrow_type_from_binder(e, result) |
| 4496 | p_result = get_proper_type(result) |
| 4497 | if ( |
| 4498 | self.is_literal_context() |
| 4499 | and isinstance(p_result, Instance) |
| 4500 | and p_result.last_known_value is not None |
| 4501 | ): |
| 4502 | result = p_result.last_known_value |
| 4503 | return result |
| 4504 | |
| 4505 | def visit_index_expr_helper(self, e: IndexExpr) -> Type: |
| 4506 | if e.analyzed: |
nothing calls this directly
no test coverage detected