If this happens, the author most probably just forgot to add the
[GtkTemplate] attribute and we throw an error.
base.visit_field (f);
var cl = current_class;
- if (cl == null || cl.error || !is_gtk_template (cl)) {
+ if (cl == null || cl.error) {
return;
}
return;
}
+ /* If the field has a [GtkChild] attribute but its class doesn'thave a
+ [GtkTemplate] attribute, we throw an error */
+ if (!is_gtk_template (cl)) {
+ Report.error (f.source_reference, "[GtkChild] is only allowed in classes with a [GtkTemplate] attribute");
+ return;
+ }
+
push_context (class_init_context);
/* Map ui widget to a class field */