From b33cc7ccd74b6d72650d42d03bb2d139834556b5 Mon Sep 17 00:00:00 2001 From: James Westman Date: Mon, 22 Jul 2024 20:31:15 -0500 Subject: [PATCH] adw-breakpoint: Fix bug when setting template prop When a breakpoint setter's target object was the template, the compiler failed with an assertion error. Fixed by allowing TemplateType objects there. The assertion is still needed to make the type checker happy. --- blueprintcompiler/language/adw_breakpoint.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/blueprintcompiler/language/adw_breakpoint.py b/blueprintcompiler/language/adw_breakpoint.py index aec4ab5..4927c11 100644 --- a/blueprintcompiler/language/adw_breakpoint.py +++ b/blueprintcompiler/language/adw_breakpoint.py @@ -98,7 +98,9 @@ class AdwBreakpointSetter(AstNode): and not isinstance(self.gir_class, ExternType) and self.property_name is not None ): - assert isinstance(self.gir_class, gir.Class) + assert isinstance(self.gir_class, gir.Class) or isinstance( + self.gir_class, gir.TemplateType + ) return self.gir_class.properties.get(self.property_name) else: return None