From 54c190803aa2fcbc0bdccab1a4ae8f7382e79c4a Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Thu, 19 Oct 2023 12:35:30 -0400 Subject: [PATCH] remove bad typecheck --- vyper/semantics/analysis/local.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/vyper/semantics/analysis/local.py b/vyper/semantics/analysis/local.py index 9890cde0ec..647f01c299 100644 --- a/vyper/semantics/analysis/local.py +++ b/vyper/semantics/analysis/local.py @@ -762,15 +762,9 @@ def visit_Subscript(self, node: vy_ast.Subscript, typ: VyperType) -> None: # get the correct type for the index, it might # not be exactly base_type.key_type + # note: index_type is validated in types_from_Subscript index_types = get_possible_types_from_node(node.slice.value) - for possible_index_type in index_types: - if base_type.key_type.compare_type(possible_index_type): - index_type = possible_index_type - break - else: - raise TypeCheckFailure( - f"Expected {base_type.key_type} but it is not a possible type", node - ) + index_type = index_types.pop() self.visit(node.slice, index_type) self.visit(node.value, base_type)