(
self, enum_type: TypeInfo, index: Expression, context: Context
)
| 4790 | return make_simplified_union(value_types), set(key_names) |
| 4791 | |
| 4792 | def visit_enum_index_expr( |
| 4793 | self, enum_type: TypeInfo, index: Expression, context: Context |
| 4794 | ) -> Type: |
| 4795 | string_type: Type = self.named_type("builtins.str") |
| 4796 | self.chk.check_subtype( |
| 4797 | self.accept(index), |
| 4798 | string_type, |
| 4799 | context, |
| 4800 | "Enum index should be a string", |
| 4801 | "actual index type", |
| 4802 | ) |
| 4803 | return Instance(enum_type, []) |
| 4804 | |
| 4805 | def visit_cast_expr(self, expr: CastExpr) -> Type: |
| 4806 | """Type check a cast expression.""" |
no test coverage detected