[Pattern] improve error message when attempting to reference a Pattern
This commit is contained in:
parent
fa3dfa1e74
commit
2275bf415a
1 changed files with 3 additions and 2 deletions
|
|
@ -1576,8 +1576,9 @@ class Pattern(PortList, AnnotatableImpl, Mirrorable):
|
|||
self._log_port_removal(ki)
|
||||
map_out[vi] = None
|
||||
|
||||
if isinstance(other, Pattern):
|
||||
assert append or skip_geometry, 'Got a name (not an abstract) but was asked to reference (not append)'
|
||||
if isinstance(other, Pattern) and not (append or skip_geometry):
|
||||
raise PatternError('Must provide an `Abstract` (not a `Pattern`) when creating a reference. '
|
||||
'Use `append=True` if you intended to append the full geometry.')
|
||||
|
||||
self.place(
|
||||
other,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue