We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c88499f commit ee777e3Copy full SHA for ee777e3
oqpy/program.py
@@ -189,7 +189,11 @@ def _add_var(self, var: Var) -> None:
189
existing_var = self.declared_vars.get(name)
190
if existing_var is None:
191
existing_var = self.undeclared_vars.get(name)
192
- if existing_var is not None and var is not existing_var and not expr_matches(var, existing_var):
+ if (
193
+ existing_var is not None
194
+ and var is not existing_var
195
+ and not expr_matches(var, existing_var)
196
+ ):
197
raise RuntimeError(f"Program has conflicting variables with name {name}")
198
if name not in self.declared_vars:
199
self.undeclared_vars[name] = var
0 commit comments