process_deprecated_attribute (a);
} else if (a.name == "GIR") {
process_gir_attribute (a);
+ } else if (a.name == "Experimental") {
+ process_experimental_attribute (a);
}
}
}
if (sym is Method) {
// method is used as interface implementation, so it is not unused
sym.check_deprecated (source_reference);
+ sym.check_experimental (source_reference);
sym.used = true;
} else {
error = true;
if (sym is Property) {
// property is used as interface implementation, so it is not unused
sym.check_deprecated (source_reference);
+ sym.check_experimental (source_reference);
sym.used = true;
} else {
error = true;
}
}
+ private void emit_experimental_attribute (Symbol symbol) {
+ if (symbol.experimental) {
+ write_indent ();
+ write_string ("[Experimental]");
+ write_newline ();
+ }
+ }
+
public override void visit_class (Class cl) {
if (cl.external_package) {
return;
}
emit_deprecated_attribute (cl);
+ emit_experimental_attribute (cl);
write_indent ();
}
emit_deprecated_attribute (st);
+ emit_experimental_attribute (st);
write_indent ();
}
emit_deprecated_attribute (iface);
+ emit_experimental_attribute (iface);
write_indent ();
}
emit_deprecated_attribute (en);
+ emit_experimental_attribute (en);
write_indent ();
}
emit_deprecated_attribute (edomain);
+ emit_experimental_attribute (edomain);
write_indent ();
}
emit_deprecated_attribute (c);
+ emit_experimental_attribute (c);
bool custom_cname = (c.get_cname () != c.get_default_cname ());
bool custom_cheaders = (c.parent_symbol is Namespace);
}
emit_deprecated_attribute (f);
+ emit_experimental_attribute (f);
bool custom_cname = (f.get_cname () != f.get_default_cname ());
bool custom_ctype = (f.get_ctype () != null);
}
emit_deprecated_attribute (cb);
+ emit_experimental_attribute (cb);
write_indent ();
}
emit_deprecated_attribute (m);
+ emit_experimental_attribute (m);
var ccode_params = new StringBuilder ();
var separator = "";
}
emit_deprecated_attribute (prop);
+ emit_experimental_attribute (prop);
if (prop.no_accessor_method) {
write_indent ();
}
emit_deprecated_attribute (sig);
+ emit_experimental_attribute (sig);
write_indent ();
write_accessibility (sig);
process_ccode_attribute (a);
} else if (a.name == "Deprecated") {
process_deprecated_attribute (a);
+ } else if (a.name == "Experimental") {
+ process_experimental_attribute (a);
}
}
}
process_ccode_attribute (a);
} else if (a.name == "Deprecated") {
process_deprecated_attribute (a);
+ } else if (a.name == "Experimental") {
+ process_experimental_attribute (a);
}
}
}
process_ccode_attribute (a);
} else if (a.name == "Deprecated") {
process_deprecated_attribute (a);
+ } else if (a.name == "Experimental") {
+ process_experimental_attribute (a);
}
}
}
process_ccode_attribute (a);
} else if (a.name == "Deprecated") {
process_deprecated_attribute (a);
+ } else if (a.name == "Experimental") {
+ process_experimental_attribute (a);
}
}
}
process_ccode_attribute (a);
} else if (a.name == "Deprecated") {
process_deprecated_attribute (a);
+ } else if (a.name == "Experimental") {
+ process_experimental_attribute (a);
}
}
}
// track usage for flow analyzer
method.used = true;
method.check_deprecated (source_reference);
+ method.check_experimental (source_reference);
if (!cb.has_target || !context.analyzer.is_in_instance_method ()) {
method.binding = MemberBinding.STATIC;
member.used = true;
member.check_deprecated (source_reference);
+ member.check_experimental (source_reference);
if (access == SymbolAccessibility.PROTECTED) {
var target_type = (TypeSymbol) member.parent_symbol;
process_deprecated_attribute (a);
} else if (a.name == "NoThrow") {
get_error_types ().clear ();
+ } else if (a.name == "Experimental") {
+ process_experimental_attribute (a);
}
}
}
public static void deprecated (SourceReference? source, string message) {
CodeContext.get ().report.depr (source, message);
}
+ public static void experimental (SourceReference? source, string message) {
+ CodeContext.get ().report.depr (source, message);
+ }
public static void warning (SourceReference? source, string message) {
CodeContext.get ().report.warn (source, message);
}
process_signal_attribute (a);
} else if (a.name == "Deprecated") {
process_deprecated_attribute (a);
+ } else if (a.name == "Experimental") {
+ process_experimental_attribute (a);
}
}
}
process_deprecated_attribute (a);
} else if (a.name == "GIR") {
process_gir_attribute (a);
+ } else if (a.name == "Experimental") {
+ process_experimental_attribute (a);
}
}
}
*/
public string? replacement { get; set; default = null; }
+ /**
+ * Specifies whether this symbol is experimental.
+ */
+ public bool experimental { get; set; default = false; }
+
/**
* Specifies whether this symbol has been accessed.
*/
}
}
+ /**
+ * Process a [Experimental] attribute
+ */
+ public virtual void process_experimental_attribute (Attribute attr) {
+ if (attr.name != "Experimental") {
+ return;
+ }
+
+ experimental = true;
+ }
+
+ /**
+ * Check to see if the symbol is experimental, and emit a warning
+ * if it is.
+ */
+ public bool check_experimental (SourceReference? source_ref = null) {
+ if (experimental) {
+ if (!CodeContext.get ().experimental) {
+ Report.experimental (source_ref, "%s is experimental".printf (get_full_name ()));
+ }
+ return true;
+ } else {
+ return false;
+ }
+ }
+
/**
* Sets the C header filename of this namespace to the specified
* filename.
public bool urgency_hint { get; set; }
[NoAccessorMethod]
public Gtk.WindowPosition window_position { get; set; }
+ [Experimental]
public virtual signal void default_activated ();
+ [Experimental]
public virtual signal void focus_activated ();
public virtual signal bool frame_event (Gdk.Event event);
public virtual signal void keys_changed ();
public bool urgency_hint { get; set; }
[NoAccessorMethod]
public Gtk.WindowPosition window_position { get; set; }
+ [Experimental]
public virtual signal void default_activated ();
+ [Experimental]
public virtual signal void focus_activated ();
public virtual signal void keys_changed ();
[HasEmitter]
foreach (string type_param_name in eval (nv[1]).split (",")) {
cb.add_type_parameter (new TypeParameter (type_param_name, current_source_reference));
}
+ } else if (nv[0] == "experimental") {
+ if (eval (nv[1]) == "1") {
+ cb.experimental = true;
+ }
}
}
}
if (eval (nv[1]) == "0") {
st.has_destroy_function = false;
}
+ } else if (nv[0] == "experimental") {
+ if (eval (nv[1]) == "1") {
+ st.experimental = true;
+ }
}
}
}
foreach (string type_param_name in eval (nv[1]).split (",")) {
cl.add_type_parameter (new TypeParameter (type_param_name, current_source_reference));
}
+ } else if (nv[0] == "experimental") {
+ if (eval (nv[1]) == "1") {
+ cl.experimental = true;
+ }
}
}
}
if (eval (nv[1]) == "1") {
return;
}
+ } else if (nv[0] == "experimental") {
+ if (eval (nv[1]) == "1") {
+ st.experimental = true;
+ }
}
}
}
if (eval (nv[1]) == "0") {
st.has_destroy_function = false;
}
+ } else if (nv[0] == "experimental") {
+ if (eval (nv[1]) == "1") {
+ st.experimental = true;
+ }
}
}
}
if (eval (nv[1]) == "1") {
ref_function_void = true;
}
+ } else if (nv[0] == "experimental") {
+ if (eval (nv[1]) == "1") {
+ cl.experimental = true;
+ }
}
}
}
m.access = SymbolAccessibility.PUBLIC;
m.set_cname (eval(nv[1]));
en.add_method (m);
+ } else if (nv[0] == "experimental") {
+ if (eval (nv[1]) == "1") {
+ en.experimental = true;
+ }
}
}
}
if (eval (nv[1]) == "1") {
cl.is_abstract = true;
}
+ } else if (nv[0] == "experimental") {
+ if (eval (nv[1]) == "1") {
+ cl.experimental = true;
+ }
}
}
}
m.set_cname (m.name);
m.name = symbol.substring (prefix.length);
}
+ } else if (nv[0] == "experimental") {
+ if (eval (nv[1]) == "1") {
+ m.experimental = true;
+ }
}
}
}
}
} else if (nv[0] == "type_name") {
prop.property_type = parse_type_from_string (eval (nv[1]), false);
+ } else if (nv[0] == "experimental") {
+ if (eval (nv[1]) == "1") {
+ prop.experimental = true;
+ }
}
}
}
if (eval (nv[1]) == "1") {
return null;
}
+ } else if (nv[0] == "experimental") {
+ if (eval (nv[1]) == "1") {
+ c.experimental = true;
+ }
}
}
}
bool deprecated = false;
string deprecated_since = null;
string replacement = null;
+ bool experimental = false;
var attributes = get_attributes ("%s.%s".printf (current_data_type.get_cname (), node.name));
if (attributes != null) {
array_length_cname = eval (nv[1]);
} else if (nv[0] == "array_length_type") {
array_length_type = eval (nv[1]);
+ } else if (nv[0] == "experimental") {
+ if (eval (nv[1]) == "1") {
+ experimental = true;
+ }
}
}
}
}
}
+ if (experimental) {
+ field.experimental = true;
+ }
+
if (ctype != null) {
field.set_ctype (ctype);
}
sig.return_type = parse_type_from_string (eval (nv[1]), false);
} else if (nv[0] == "type_arguments") {
parse_type_arguments_from_string (sig.return_type, eval (nv[1]));
+ } else if (nv[0] == "experimental") {
+ if (eval (nv[1]) == "1") {
+ sig.experimental = true;
+ }
}
}
if (ns_name != null) {