From 2275bf415a44e97de8829f617a52b72c5ef2cde9 Mon Sep 17 00:00:00 2001 From: jan Date: Tue, 10 Mar 2026 00:31:58 -0700 Subject: [PATCH] [Pattern] improve error message when attempting to reference a Pattern --- masque/pattern.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/masque/pattern.py b/masque/pattern.py index 94068c9..46b564a 100644 --- a/masque/pattern.py +++ b/masque/pattern.py @@ -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,