gir/array-fixed-length.test \
annotations/deprecated.vala \
annotations/description.vala \
+ annotations/noaccessormethod.test \
$(NULL)
NON_NULL_TESTS = \
--- /dev/null
+Invalid Code
+
+public class Foo {
+ [NoAccessorMethod]
+ public string baz { get; set; }
+}
+
+void main () {
+}
}
foreach (Property prop in properties) {
+ if (prop.get_attribute ("NoAccessorMethod") != null && !is_subtype_of (context.analyzer.object_type)) {
+ error = true;
+ Report.error (prop.source_reference, "NoAccessorMethod is only allowed for properties in classes derived from GLib.Object");
+ return false;
+ }
prop.check (context);
}