Fixes https://gitlab.gnome.org/GNOME/vala/issues/1036
add_constructor (c);
}
- if (base_class != null && base_class.is_sealed) {
+ if (!external_package && base_class != null && base_class.is_sealed) {
error = true;
Report.error (source_reference, "`%s' cannot inherit from sealed class `%s'", get_full_name (), base_class.get_full_name ());
}
pop_metadata ();
}
+ // There is no instance field therefore this type might be final/sealed
+ if (first_field && !cl.is_abstract && !(cl.is_opaque || cl.is_sealed)) {
+ if (!cl.is_compact
+ && !metadata.has_argument (ArgumentType.ABSTRACT)
+ && !metadata.has_argument (ArgumentType.COMPACT)
+ && !metadata.has_argument (ArgumentType.SEALED)) {
+ cl.is_sealed = true;
+ }
+ }
+
pop_node ();
end_element ("class");
}