Skip to content

Commit

Permalink
remove bad typecheck
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Oct 19, 2023
1 parent dbb25cb commit 54c1908
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions vyper/semantics/analysis/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 54c1908

Please sign in to comment.