Skip to content

Commit

Permalink
[#240] AttributeError: 'ArrayLiteral' object has no attribute 'value'.
Browse files Browse the repository at this point in the history
Fixes bug [#240] by casting node.size into IntegerLiteral
  • Loading branch information
EuGig committed May 31, 2024
1 parent a4d7f98 commit 73171d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/braket/default_simulator/openqasm/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@ def _(self, node: Identifier) -> LiteralType:

@visit.register
def _(self, node: QubitDeclaration) -> None:
size = self.visit(node.size).value if node.size else 1
size_arg = self.visit(node.size)
size = cast_to(IntegerLiteral, size_arg).value if size_arg else 1
self.context.add_qubits(node.qubit.name, size)

@visit.register
Expand Down

0 comments on commit 73171d4

Please sign in to comment.