public void add_function (CCodeFunction func) {
if (!definitions.add (func.name)) {
- Report.error (null, "internal: Redefinition of `%s'".printf (func.name));
+ Report.error (null, "internal: Redefinition of `%s'", func.name);
return;
}
int last_hyphen = gir_base.last_index_of_char ('-');
if (last_hyphen == -1 || !gir_base.has_suffix (".gir")) {
- Report.error (null, "GIR file name `%s' is not well-formed, expected NAME-VERSION.gir".printf (gir));
+ Report.error (null, "GIR file name `%s' is not well-formed, expected NAME-VERSION.gir", gir);
} else {
string gir_namespace = gir_base.substring (0, last_hyphen);
string gir_version = gir_base.substring (last_hyphen + 1, gir_len - last_hyphen - 5);
gir_version.canon ("0123456789.", '?');
if (gir_namespace == "" || gir_version == "" || !gir_version[0].isdigit () || gir_version.contains ("?")) {
- Report.error (null, "GIR file name `%s' is not well-formed, expected NAME-VERSION.gir".printf (gir));
+ Report.error (null, "GIR file name `%s' is not well-formed, expected NAME-VERSION.gir", gir);
} else {
var gir_writer = new GIRWriter ();
}
if (subsize >= 0 && subsize != size) {
il.error = true;
- Report.error (il.source_reference, "Expected initializer list of size %d, got size %d".printf (subsize, size));
+ Report.error (il.source_reference, "Expected initializer list of size %d, got size %d", subsize, size);
return -1;
} else {
subsize = size;
error = true;
var actual_type = new ArrayType (element_type, calc_sizes.size, source_reference);
((ArrayType) actual_type).length_type = length_type;
- Report.error (initlist.source_reference, "Expected initializer for `%s' but got `%s'".printf (target_type.to_string (), actual_type.to_string ()));
+ Report.error (initlist.source_reference, "Expected initializer for `%s' but got `%s'", target_type.to_string (), actual_type.to_string ());
}
}
}
if (ma.prototype_access) {
error = true;
- Report.error (source_reference, "Access to instance member `%s' denied".printf (ma.symbol_reference.get_full_name ()));
+ Report.error (source_reference, "Access to instance member `%s' denied", ma.symbol_reference.get_full_name ());
return false;
}
if (prop.set_accessor == null
|| (!prop.set_accessor.writable && !(context.analyzer.find_current_method () is CreationMethod || context.analyzer.is_in_constructor ()))) {
ma.error = true;
- Report.error (ma.source_reference, "Property `%s' is read-only".printf (prop.get_full_name ()));
+ Report.error (ma.source_reference, "Property `%s' is read-only", prop.get_full_name ());
return false;
} else if (!context.deprecated
&& !prop.set_accessor.writable
if (ma.inner.symbol_reference != context.analyzer.find_current_method ().this_parameter) {
// trying to set construct-only property in creation method for foreign instance
error = true;
- Report.error (ma.source_reference, "Property `%s' is read-only".printf (prop.get_full_name ()));
+ Report.error (ma.source_reference, "Property `%s' is read-only", prop.get_full_name ());
return false;
} else {
error = true;
unowned Method m = (Method) right.symbol_reference;
unowned Delegate cb = ((DelegateType) variable.variable_type).delegate_symbol;
error = true;
- Report.error (source_reference, "Declaration of method `%s' is not compatible with delegate `%s'".printf (m.get_full_name (), cb.get_full_name ()));
+ Report.error (source_reference, "Declaration of method `%s' is not compatible with delegate `%s'", m.get_full_name (), cb.get_full_name ());
return false;
}
} else {
if (!right.value_type.compatible (left.value_type)) {
error = true;
- Report.error (source_reference, "Assignment: Cannot convert from `%s' to `%s'".printf (right.value_type.to_string (), left.value_type.to_string ()));
+ Report.error (source_reference, "Assignment: Cannot convert from `%s' to `%s'", right.value_type.to_string (), left.value_type.to_string ());
return false;
}
if (!right.value_type.compatible (left.value_type)) {
error = true;
- Report.error (source_reference, "Assignment: Cannot convert from `%s' to `%s'".printf (right.value_type.to_string (), left.value_type.to_string ()));
+ Report.error (source_reference, "Assignment: Cannot convert from `%s' to `%s'", right.value_type.to_string (), left.value_type.to_string ());
return false;
}
if (left.value_type is FieldPrototype || left.value_type is PropertyPrototype) {
error = true;
- Report.error (left.source_reference, "Access to instance member `%s' denied".printf (left.symbol_reference.get_full_name ()));
+ Report.error (left.source_reference, "Access to instance member `%s' denied", left.symbol_reference.get_full_name ());
return false;
}
if (right.value_type is FieldPrototype || right.value_type is PropertyPrototype) {
error = true;
- Report.error (right.source_reference, "Access to instance member `%s' denied".printf (right.symbol_reference.get_full_name ()));
+ Report.error (right.source_reference, "Access to instance member `%s' denied", right.symbol_reference.get_full_name ());
return false;
}
if (value_type == null) {
error = true;
- Report.error (source_reference, "Arithmetic operation not supported for types `%s' and `%s'".printf (left.value_type.to_string (), right.value_type.to_string ()));
+ Report.error (source_reference, "Arithmetic operation not supported for types `%s' and `%s'", left.value_type.to_string (), right.value_type.to_string ());
return false;
}
break;
if (value_type == null) {
error = true;
- Report.error (source_reference, "Arithmetic operation not supported for types `%s' and `%s'".printf (left.value_type.to_string (), right.value_type.to_string ()));
+ Report.error (source_reference, "Arithmetic operation not supported for types `%s' and `%s'", left.value_type.to_string (), right.value_type.to_string ());
return false;
}
break;
if (resulting_type == null) {
error = true;
- Report.error (source_reference, "Relational operation not supported for types `%s' and `%s'".printf (left.value_type.to_string (), right.value_type.to_string ()));
+ Report.error (source_reference, "Relational operation not supported for types `%s' and `%s'", left.value_type.to_string (), right.value_type.to_string ());
return false;
}
if (!right.value_type.compatible (left.value_type)
&& !left.value_type.compatible (right.value_type)) {
- Report.error (source_reference, "Equality operation: `%s' and `%s' are incompatible".printf (right.value_type.to_string (), left.value_type.to_string ()));
+ Report.error (source_reference, "Equality operation: `%s' and `%s' are incompatible", right.value_type.to_string (), left.value_type.to_string ());
error = true;
return false;
}
} else if (right.value_type is ArrayType) {
if (!left.value_type.compatible (((ArrayType) right.value_type).element_type)) {
error = true;
- Report.error (source_reference, "Cannot look for `%s' in `%s'".printf (left.value_type.to_string (), right.value_type.to_string ()));
+ Report.error (source_reference, "Cannot look for `%s' in `%s'", left.value_type.to_string (), right.value_type.to_string ());
}
} else {
// otherwise require a bool contains () method
var contains_method = right.value_type.get_member ("contains") as Method;
if (contains_method == null) {
- Report.error (source_reference, "`%s' does not have a `contains' method".printf (right.value_type.to_string ()));
+ Report.error (source_reference, "`%s' does not have a `contains' method", right.value_type.to_string ());
error = true;
return false;
}
if (contains_method.get_parameters ().size != 1) {
- Report.error (source_reference, "`%s' must have one parameter".printf (contains_method.get_full_name ()));
+ Report.error (source_reference, "`%s' must have one parameter", contains_method.get_full_name ());
error = true;
return false;
}
if (!contains_method.return_type.compatible (context.analyzer.bool_type)) {
- Report.error (source_reference, "`%s' must return a boolean value".printf (contains_method.get_full_name ()));
+ Report.error (source_reference, "`%s' must return a boolean value", contains_method.get_full_name ());
error = true;
return false;
}
unowned Symbol? parent_block = parent_symbol;
while (parent_block is Block || parent_block is Method || parent_block is PropertyAccessor) {
if (parent_block.scope.lookup (local.name) != null) {
- Report.error (local.source_reference, "Local variable `%s' conflicts with a local variable or constant declared in a parent scope".printf (local.name));
+ Report.error (local.source_reference, "Local variable `%s' conflicts with a local variable or constant declared in a parent scope", local.name);
break;
}
parent_block = parent_block.parent_symbol;
unowned Symbol? parent_block = parent_symbol;
while (parent_block is Block || parent_block is Method || parent_block is PropertyAccessor) {
if (parent_block.scope.lookup (constant.name) != null) {
- Report.error (constant.source_reference, "Local constant `%s' conflicts with a local variable or constant declared in a parent scope".printf (constant.name));
+ Report.error (constant.source_reference, "Local constant `%s' conflicts with a local variable or constant declared in a parent scope", constant.name);
break;
}
parent_block = parent_block.parent_symbol;
value_type.value_owned = true;
if (value_type.get_type_signature () == null) {
error = true;
- Report.error (source_reference, "Casting of `GLib.Variant' to `%s' is not supported".printf (value_type.to_qualified_string ()));
+ Report.error (source_reference, "Casting of `GLib.Variant' to `%s' is not supported", value_type.to_qualified_string ());
}
}
if (error_type != null) {
if (!(error_type is ErrorType)) {
- Report.error (source_reference, "clause must catch a valid error type, found `%s' instead".printf (error_type.to_string ()));
+ Report.error (source_reference, "clause must catch a valid error type, found `%s' instead", error_type.to_string ());
error = true;
}
unowned CreationMethod cm = (CreationMethod) m;
if (cm.class_name != null && cm.class_name != name) {
// class_name is null for constructors generated by GIdlParser
- Report.error (m.source_reference, "missing return type in method `%s.%s´".printf (get_full_name (), cm.class_name));
+ Report.error (m.source_reference, "missing return type in method `%s.%s´", get_full_name (), cm.class_name);
m.error = true;
return;
}
if (!(base_type_reference is ObjectType)) {
error = true;
- Report.error (source_reference, "base type `%s' of class `%s' is not an object type".printf (base_type_reference.to_string (), get_full_name ()));
+ Report.error (source_reference, "base type `%s' of class `%s' is not an object type", base_type_reference.to_string (), get_full_name ());
return false;
}
// check whether base type is at least as accessible as the class
if (!context.analyzer.is_type_accessible (this, base_type_reference)) {
error = true;
- Report.error (source_reference, "base type `%s' is less accessible than class `%s'".printf (base_type_reference.to_string (), get_full_name ()));
+ Report.error (source_reference, "base type `%s' is less accessible than class `%s'", base_type_reference.to_string (), get_full_name ());
return false;
}
if (base_class != null && base_class.is_singleton) {
error = true;
- Report.error (source_reference, "`%s' cannot inherit from SingleInstance class `%s'".printf (get_full_name (), base_class.get_full_name ()));
+ Report.error (source_reference, "`%s' cannot inherit from SingleInstance class `%s'", get_full_name (), base_class.get_full_name ());
}
if (is_singleton && !is_subtype_of (context.analyzer.object_type)) {
error = true;
- Report.error (source_reference, "SingleInstance class `%s' requires inheritance from `GLib.Object'".printf (get_full_name ()));
+ Report.error (source_reference, "SingleInstance class `%s' requires inheritance from `GLib.Object'", get_full_name ());
}
/* singleton classes require an instance constructor */
if (base_class != null && base_class.is_sealed) {
error = true;
- Report.error (source_reference, "`%s' cannot inherit from sealed class `%s'".printf (get_full_name (), base_class.get_full_name ()));
+ Report.error (source_reference, "`%s' cannot inherit from sealed class `%s'", get_full_name (), base_class.get_full_name ());
}
if (is_sealed) {
if (is_compact) {
error = true;
- Report.error (source_reference, "Sealed class `%s' cannot be compact".printf (get_full_name ()));
+ Report.error (source_reference, "Sealed class `%s' cannot be compact", get_full_name ());
return false;
}
if (is_abstract) {
error = true;
- Report.error (source_reference, "Sealed class `%s' cannot be abstract".printf (get_full_name ()));
+ Report.error (source_reference, "Sealed class `%s' cannot be abstract", get_full_name ());
return false;
}
if (!external_package) {
foreach (DataType base_type in get_base_types ()) {
if (base_type.type_symbol is Interface) {
error = true;
- Report.error (source_reference, "compact classes `%s' may not implement interfaces".printf (get_full_name ()));
+ Report.error (source_reference, "compact classes `%s' may not implement interfaces", get_full_name ());
}
}
}
if (!implemented) {
error = true;
- Report.error (source_reference, "`%s' does not implement interface method `%s'".printf (get_full_name (), m.get_full_name ()));
+ Report.error (source_reference, "`%s' does not implement interface method `%s'", get_full_name (), m.get_full_name ());
}
}
}
// No check at all for "new" classified properties, really?
if (!base_prop.hides && !base_prop.compatible (prop, out invalid_match)) {
error = true;
- Report.error (source_reference, "Type and/or accessors of inherited properties `%s' and `%s' do not match: %s.".printf (prop.get_full_name (), base_prop.get_full_name (), invalid_match));
+ Report.error (source_reference, "Type and/or accessors of inherited properties `%s' and `%s' do not match: %s.", prop.get_full_name (), base_prop.get_full_name (), invalid_match);
}
// property is used as interface implementation, so it is not unused
sym.version.check (context, source_reference);
sym.used = true;
} else {
error = true;
- Report.error (source_reference, "`%s' does not implement interface property `%s'".printf (get_full_name (), prop.get_full_name ()));
+ Report.error (source_reference, "`%s' does not implement interface property `%s'", get_full_name (), prop.get_full_name ());
}
}
}
var override_method = SemanticAnalyzer.symbol_lookup_inherited (this, base_method.name) as Method;
if (override_method == null || !override_method.overrides) {
error = true;
- Report.error (source_reference, "`%s' does not implement abstract method `%s'".printf (get_full_name (), base_method.get_full_name ()));
+ Report.error (source_reference, "`%s' does not implement abstract method `%s'", get_full_name (), base_method.get_full_name ());
}
}
}
var override_property = SemanticAnalyzer.symbol_lookup_inherited (this, base_property.name) as Property;
if (override_property == null || !override_property.overrides) {
error = true;
- Report.error (source_reference, "`%s' does not implement abstract property `%s'".printf (get_full_name (), base_property.get_full_name ()));
+ Report.error (source_reference, "`%s' does not implement abstract property `%s'", get_full_name (), base_property.get_full_name ());
}
}
}
*/
public void add_source_file (SourceFile file) {
if (source_files_map.contains (file.filename)) {
- Report.warning (null, "Ignoring source file `%s', which was already added to this context".printf (file.filename));
+ Report.warning (null, "Ignoring source file `%s', which was already added to this context", file.filename);
return;
}
path = get_gir_path (pkg);
}
if (path == null) {
- Report.error (null, "Package `%s' not found in specified Vala API directories or GObject-Introspection GIR directories".printf (pkg));
+ Report.error (null, "Package `%s' not found in specified Vala API directories or GObject-Introspection GIR directories", pkg);
return false;
}
}
}
} catch (FileError e) {
- Report.error (null, "Unable to read dependency file: %s".printf (e.message));
+ Report.error (null, "Unable to read dependency file: %s", e.message);
return false;
}
*/
public bool add_source_filename (string filename, bool is_source = false, bool cmdline = false) {
if (!FileUtils.test (filename, FileTest.EXISTS)) {
- Report.error (null, "%s not found".printf (filename));
+ Report.error (null, "%s not found", filename);
return false;
}
} else if (filename.has_suffix (".h")) {
/* Ignore */
} else {
- Report.error (null, "%s is not a supported source file type. Only .vala, .vapi, .gs, and .c files are supported.".printf (filename));
+ Report.error (null, "%s is not a supported source file type. Only .vala, .vapi, .gs, and .c files are supported.", filename);
return false;
}
public void add_define (string define) {
if (is_defined (define)) {
- Report.warning (null, "`%s' is already defined".printf (define));
+ Report.warning (null, "`%s' is already defined", define);
if (/VALA_0_\d+/.match_all (define)) {
Report.warning (null, "`VALA_0_XX' defines are automatically added up to current compiler version in use");
} else if (/GLIB_2_\d+/.match_all (define)) {
var stream = FileStream.open (filename, "w");
if (stream == null) {
- Report.error (null, "unable to open `%s' for writing".printf (filename));
+ Report.error (null, "unable to open `%s' for writing", filename);
return;
}
var stream = FileStream.open (filename, "w");
if (stream == null) {
- Report.error (null, "unable to open `%s' for writing".printf (filename));
+ Report.error (null, "unable to open `%s' for writing", filename);
return;
}
try {
Process.spawn_command_line_sync (pc, out output, null, out exit_status);
if (exit_status != 0) {
- Report.error (null, "%s exited with status %d".printf (pkg_config_command, exit_status));
+ Report.error (null, "%s exited with status %d", pkg_config_command, exit_status);
return null;
}
} catch (SpawnError e) {
}
if (stream == null) {
- Report.error (null, "unable to open `%s' for writing".printf (filename));
+ Report.error (null, "unable to open `%s' for writing", filename);
return;
}
if (!check_const_type (type_reference, context)) {
error = true;
- Report.error (source_reference, "`%s' not supported as type for constants".printf (type_reference.to_string ()));
+ Report.error (source_reference, "`%s' not supported as type for constants", type_reference.to_string ());
return false;
}
if (!value.value_type.compatible (type_reference)) {
error = true;
- Report.error (source_reference, "Cannot convert from `%s' to `%s'".printf (value.value_type.to_string (), type_reference.to_string ()));
+ Report.error (source_reference, "Cannot convert from `%s' to `%s'", value.value_type.to_string (), type_reference.to_string ());
return false;
}
}
if (!external_package && !hides && get_hidden_member () != null) {
- Report.warning (source_reference, "%s hides inherited constant `%s'. Use the `new' keyword if hiding was intentional".printf (get_full_name (), get_hidden_member ().get_full_name ()));
+ Report.warning (source_reference, "%s hides inherited constant `%s'. Use the `new' keyword if hiding was intentional", get_full_name (), get_hidden_member ().get_full_name ());
}
context.analyzer.current_source_file = old_source_file;
body.get_error_types (body_errors);
foreach (DataType body_error_type in body_errors) {
if (!((ErrorType) body_error_type).dynamic_error) {
- Report.warning (body_error_type.source_reference, "unhandled error `%s'".printf (body_error_type.to_string()));
+ Report.warning (body_error_type.source_reference, "unhandled error `%s'", body_error_type.to_string());
}
}
}
if (class_name != null && class_name != parent_symbol.name) {
// class_name is null for constructors generated by GIdlParser
- Report.error (source_reference, "missing return type in method `%s.%s´".printf (context.analyzer.current_symbol.get_full_name (), class_name));
+ Report.error (source_reference, "missing return type in method `%s.%s´", context.analyzer.current_symbol.get_full_name (), class_name);
error = true;
return false;
}
// check whether error type is at least as accessible as the creation method
if (!context.analyzer.is_type_accessible (this, error_type)) {
error = true;
- Report.error (source_reference, "error type `%s' is less accessible than creation method `%s'".printf (error_type.to_string (), get_full_name ()));
+ Report.error (source_reference, "error type `%s' is less accessible than creation method `%s'", error_type.to_string (), get_full_name ());
return false;
}
}
if (is_abstract || is_virtual || overrides) {
error = true;
- Report.error (source_reference, "The creation method `%s' cannot be marked as override, virtual, or abstract".printf (get_full_name ()));
+ Report.error (source_reference, "The creation method `%s' cannot be marked as override, virtual, or abstract", get_full_name ());
return false;
}
}
}
if (!can_propagate_error && !((ErrorType) body_error_type).dynamic_error) {
- Report.warning (body_error_type.source_reference, "unhandled error `%s'".printf (body_error_type.to_string()));
+ Report.warning (body_error_type.source_reference, "unhandled error `%s'", body_error_type.to_string());
}
}
}
if (return_type.type_symbol == context.analyzer.va_list_type.type_symbol) {
error = true;
- Report.error (source_reference, "`%s' not supported as return type".printf (return_type.type_symbol.get_full_name ()));
+ Report.error (source_reference, "`%s' not supported as return type", return_type.type_symbol.get_full_name ());
return false;
}
// check whether error type is at least as accessible as the delegate
if (!context.analyzer.is_type_accessible (this, error_type)) {
error = true;
- Report.error (source_reference, "error type `%s' is less accessible than delegate `%s'".printf (error_type.to_string (), get_full_name ()));
+ Report.error (source_reference, "error type `%s' is less accessible than delegate `%s'", error_type.to_string (), get_full_name ());
return false;
}
}
if (!(expression.value_type is PointerType) && !(expression.value_type is ArrayType)) {
error = true;
- Report.error (source_reference, "delete operator not supported for `%s'".printf (expression.value_type.to_string ()));
+ Report.error (source_reference, "delete operator not supported for `%s'", expression.value_type.to_string ());
}
return !error;
if (array_type.rank < get_indices ().size) {
error = true;
- Report.error (source_reference, "%d extra indices for element access".printf (get_indices ().size - array_type.rank));
+ Report.error (source_reference, "%d extra indices for element access", get_indices ().size - array_type.rank);
} else if (array_type.rank > get_indices ().size) {
error = true;
- Report.error (source_reference, "%d missing indices for element access".printf (array_type.rank - get_indices ().size));
+ Report.error (source_reference, "%d missing indices for element access", array_type.rank - get_indices ().size);
}
} else if (pointer_type != null && !pointer_type.base_type.is_reference_type_or_type_parameter ()) {
value_type = pointer_type.base_type.copy ();
}
error = true;
- Report.error (source_reference, "The expression `%s' does not denote an array".printf (container.value_type.to_string ()));
+ Report.error (source_reference, "The expression `%s' does not denote an array", container.value_type.to_string ());
return false;
}
context.analyzer.current_symbol = this;
if (values.size <= 0) {
- Report.error (source_reference, "Enum `%s' requires at least one value".printf (get_full_name ()));
+ Report.error (source_reference, "Enum `%s' requires at least one value", get_full_name ());
error = true;
return false;
}
checked = true;
if (codes.size <= 0) {
- Report.error (source_reference, "Error domain `%s' requires at least one code".printf (get_full_name ()));
+ Report.error (source_reference, "Error domain `%s' requires at least one code", get_full_name ());
error = true;
return false;
}
if (variable_type.type_symbol == context.analyzer.va_list_type.type_symbol) {
error = true;
- Report.error (source_reference, "`%s' not supported as field type".printf (variable_type.type_symbol.get_full_name ()));
+ Report.error (source_reference, "`%s' not supported as field type", variable_type.type_symbol.get_full_name ());
return false;
}
// check whether field type is at least as accessible as the field
if (!context.analyzer.is_type_accessible (this, variable_type)) {
error = true;
- Report.error (source_reference, "field type `%s' is less accessible than field `%s'".printf (variable_type.to_string (), get_full_name ()));
+ Report.error (source_reference, "field type `%s' is less accessible than field `%s'", variable_type.to_string (), get_full_name ());
return false;
}
if (!initializer.value_type.compatible (variable_type)) {
error = true;
- Report.error (source_reference, "Cannot convert from `%s' to `%s'".printf (initializer.value_type.to_string (), variable_type.to_string ()));
+ Report.error (source_reference, "Cannot convert from `%s' to `%s'", initializer.value_type.to_string (), variable_type.to_string ());
return false;
}
}
if (!external_package && !hides && get_hidden_member () != null) {
- Report.warning (source_reference, "%s hides inherited field `%s'. Use the `new' keyword if hiding was intentional".printf (get_full_name (), get_hidden_member ().get_full_name ()));
+ Report.warning (source_reference, "%s hides inherited field `%s'. Use the `new' keyword if hiding was intentional", get_full_name (), get_hidden_member ().get_full_name ());
}
context.analyzer.current_source_file = old_source_file;
if (!f.is_private_symbol () && (context.internal_header_filename != null || context.use_fast_vapi)) {
// do not warn if internal member may be used outside this compilation unit
} else {
- Report.warning (f.source_reference, "field `%s' never used".printf (f.get_full_name ()));
+ Report.warning (f.source_reference, "Field `%s' never used", f.get_full_name ());
}
}
}
&& m.get_attribute_bool ("DBus", "visible", true)) {
// do not warn if internal member is a visible DBus method
} else {
- Report.warning (m.source_reference, "method `%s' never used".printf (m.get_full_name ()));
+ Report.warning (m.source_reference, "Method `%s' never used", m.get_full_name ());
}
}
foreach (Variable variable in phi.operands) {
if (variable == null) {
if (used_var is LocalVariable) {
- Report.error (used_var.source_reference, "use of possibly unassigned local variable `%s'".printf (used_var.name));
+ Report.error (used_var.source_reference, "Use of possibly unassigned local variable `%s'", used_var.name);
} else {
// parameter
- Report.warning (used_var.source_reference, "use of possibly unassigned parameter `%s'".printf (used_var.name));
+ Report.warning (used_var.source_reference, "Use of possibly unassigned parameter `%s'", used_var.name);
}
continue;
}
var variable_stack = var_map.get (var_symbol);
if (variable_stack == null || variable_stack.size == 0) {
if (var_symbol is LocalVariable) {
- Report.error (node.source_reference, "use of possibly unassigned local variable `%s'".printf (var_symbol.name));
+ Report.error (node.source_reference, "Use of possibly unassigned local variable `%s'", var_symbol.name);
} else {
// parameter
- Report.warning (node.source_reference, "use of possibly unassigned parameter `%s'".printf (var_symbol.name));
+ Report.warning (node.source_reference, "Use of possibly unassigned parameter `%s'", var_symbol.name);
}
continue;
}
}
if (!stmt.declaration.used) {
- Report.warning (stmt.declaration.source_reference, "local variable `%s' declared but never used".printf (stmt.declaration.name));
+ Report.warning (stmt.declaration.source_reference, "Local variable `%s' declared but never used", stmt.declaration.name);
}
current_block.add_node (stmt);
foreach (var val in remaining_values) {
missing_vals += val.name;
}
- Report.warning (stmt.source_reference, "switch does not handle `%s' of enum `%s'".printf (string.joinv ("', `", missing_vals), en.get_full_name ()));
+ Report.warning (stmt.source_reference, "Switch does not handle `%s' of enum `%s'", string.joinv ("', `", missing_vals), en.get_full_name ());
}
}
var iterator_method = collection_type.get_member ("iterator") as Method;
if (iterator_method == null) {
- Report.error (collection.source_reference, "`%s' does not have an `iterator' method".printf (collection_type.to_string ()));
+ Report.error (collection.source_reference, "`%s' does not have an `iterator' method", collection_type.to_string ());
error = true;
return false;
}
if (iterator_method.get_parameters ().size != 0) {
- Report.error (collection.source_reference, "`%s' must not have any parameters".printf (iterator_method.get_full_name ()));
+ Report.error (collection.source_reference, "`%s' must not have any parameters", iterator_method.get_full_name ());
error = true;
return false;
}
var iterator_type = iterator_method.return_type.get_actual_type (collection_type, null, this);
if (iterator_type is VoidType) {
- Report.error (collection.source_reference, "`%s' must return an iterator".printf (iterator_method.get_full_name ()));
+ Report.error (collection.source_reference, "`%s' must return an iterator", iterator_method.get_full_name ());
error = true;
return false;
}
var next_method = iterator_type.get_member ("next") as Method;
if (next_value_method != null) {
if (next_value_method.get_parameters ().size != 0) {
- Report.error (collection.source_reference, "`%s' must not have any parameters".printf (next_value_method.get_full_name ()));
+ Report.error (collection.source_reference, "`%s' must not have any parameters", next_value_method.get_full_name ());
error = true;
return false;
}
var element_type = next_value_method.return_type.get_actual_type (iterator_type, null, this);
if (!element_type.nullable) {
- Report.error (collection.source_reference, "return type of `%s' must be nullable".printf (next_value_method.get_full_name ()));
+ Report.error (collection.source_reference, "return type of `%s' must be nullable", next_value_method.get_full_name ());
error = true;
return false;
}
add_statement (loop);
} else if (next_method != null) {
if (next_method.get_parameters ().size != 0) {
- Report.error (collection.source_reference, "`%s' must not have any parameters".printf (next_method.get_full_name ()));
+ Report.error (collection.source_reference, "`%s' must not have any parameters", next_method.get_full_name ());
error = true;
return false;
}
if (!next_method.return_type.compatible (context.analyzer.bool_type)) {
- Report.error (collection.source_reference, "`%s' must return a boolean value".printf (next_method.get_full_name ()));
+ Report.error (collection.source_reference, "`%s' must return a boolean value", next_method.get_full_name ());
error = true;
return false;
}
var get_method = iterator_type.get_member ("get") as Method;
if (get_method == null) {
- Report.error (collection.source_reference, "`%s' does not have a `get' method".printf (iterator_type.to_string ()));
+ Report.error (collection.source_reference, "`%s' does not have a `get' method", iterator_type.to_string ());
error = true;
return false;
}
if (get_method.get_parameters ().size != 0) {
- Report.error (collection.source_reference, "`%s' must not have any parameters".printf (get_method.get_full_name ()));
+ Report.error (collection.source_reference, "`%s' must not have any parameters", get_method.get_full_name ());
error = true;
return false;
}
var element_type = get_method.return_type.get_actual_type (iterator_type, null, this);
if (element_type is VoidType) {
- Report.error (collection.source_reference, "`%s' must return an element".printf (get_method.get_full_name ()));
+ Report.error (collection.source_reference, "`%s' must return an element", get_method.get_full_name ());
error = true;
return false;
}
var get_call = new MethodCall (new MemberAccess (new MemberAccess.simple ("_%s_it".printf (variable_name), source_reference), "get", source_reference), source_reference);
body.insert_statement (0, new DeclarationStatement (new LocalVariable (type_reference, variable_name, get_call, source_reference), source_reference));
} else {
- Report.error (collection.source_reference, "`%s' does not have a `next_value' or `next' method".printf (iterator_type.to_string ()));
+ Report.error (collection.source_reference, "`%s' does not have a `next_value' or `next' method", iterator_type.to_string ());
error = true;
return false;
}
type_reference = element_type.copy ();
} else if (!element_type.compatible (type_reference)) {
error = true;
- Report.error (source_reference, "Foreach: Cannot convert from `%s' to `%s'".printf (element_type.to_string (), type_reference.to_string ()));
+ Report.error (source_reference, "Foreach: Cannot convert from `%s' to `%s'", element_type.to_string (), type_reference.to_string ());
return false;
} else if (element_type.is_disposable () && element_type.value_owned && !type_reference.value_owned) {
error = true;
type_reference = element_type.copy ();
} else if (!element_type.compatible (type_reference)) {
error = true;
- Report.error (source_reference, "Foreach: Cannot convert from `%s' to `%s'".printf (element_type.to_string (), type_reference.to_string ()));
+ Report.error (source_reference, "Foreach: Cannot convert from `%s' to `%s'", element_type.to_string (), type_reference.to_string ());
return false;
}
void report_parse_error (ParseError e) {
var begin = get_location ();
next ();
- Report.error (get_src (begin), "syntax error, " + e.message);
+ Report.error (get_src (begin), "syntax error, %s", e.message);
}
inline bool expect (TokenType type) throws ParseError {
if (attributes != null) {
foreach (Attribute attr in (List<Attribute>) attributes) {
if (node.get_attribute (attr.name) != null) {
- Report.error (attr.source_reference, "duplicate attribute `%s'".printf (attr.name));
+ Report.error (attr.source_reference, "duplicate attribute `%s'", attr.name);
}
node.attributes.append (attr);
}
if (current < end) {
current++;
} else {
- Report.error (get_source_reference (token_length_in_chars), "syntax error, expected %c".printf (begin[0]));
+ Report.error (get_source_reference (token_length_in_chars), "syntax error, expected %c", begin[0]);
}
break;
default:
} else {
// relative pattern
if (current != TokenType.DOT) {
- Report.error (get_current_src (), "expected pattern or `.', got %s".printf (current.to_string ()));
+ Report.error (get_current_src (), "expected pattern or `.', got `%s'", current.to_string ());
return null;
}
next ();
while (current != TokenType.EOF && !has_space ()) {
if (current != TokenType.DOT) {
- Report.error (get_current_src (), "expected `.' got %s".printf (current.to_string ()));
+ Report.error (get_current_src (), "expected `.' got `%s'", current.to_string ());
break;
}
next ();
next ();
var inner = parse_expression ();
if (inner == null) {
- Report.error (src, "expected expression after `-', got %s".printf (current.to_string ()));
+ Report.error (src, "expected expression after `-', got `%s'", current.to_string ());
} else {
expr = new UnaryExpression (UnaryOperator.MINUS, inner, get_src (begin));
}
expr = new MemberAccess (null, get_string (), src);
while (next () == TokenType.DOT) {
if (next () != TokenType.IDENTIFIER) {
- Report.error (get_current_src (), "expected identifier got %s".printf (current.to_string ()));
+ Report.error (get_current_src (), "expected identifier got `%s'", current.to_string ());
break;
}
expr = new MemberAccess (expr, get_string (), get_current_src ());
case TokenType.OPEN_PARENS:
// empty tuple => no expression
if (next () != TokenType.CLOSE_PARENS) {
- Report.error (get_current_src (), "expected `)', got %s".printf (current.to_string ()));
+ Report.error (get_current_src (), "expected `)', got `%s'", current.to_string ());
break;
}
expr = new Tuple (src);
break;
default:
- Report.error (src, "expected literal or symbol got %s".printf (current.to_string ()));
+ Report.error (src, "expected literal or symbol got %s", current.to_string ());
break;
}
next ();
}
var arg_type = ArgumentType.from_string (id);
if (arg_type == null) {
- Report.warning (get_src (begin, old_end), "unknown argument `%s'".printf (id));
+ Report.warning (get_src (begin, old_end), "unknown argument `%s'", id);
continue;
}
}
parser.assume_parameter_names (sig, m, false);
if (m.get_parameters().size != sig.get_parameters().size) {
- Report.warning (symbol.source_reference, "Signal `%s' conflicts with method of the same name".printf (get_full_name ()));
+ Report.warning (symbol.source_reference, "Signal `%s' conflicts with method of the same name", get_full_name ());
}
merged = true;
} else if (sym is Method && !(sym is CreationMethod) && node != this) {
}
if (!different_invoker) {
if (attr != null) {
- Report.warning (symbol.source_reference, "Virtual method `%s' conflicts with method of the same name".printf (get_full_name ()));
+ Report.warning (symbol.source_reference, "Virtual method `%s' conflicts with method of the same name", get_full_name ());
}
node.merged = true;
}
} else if (m.is_class_member ()) {
- Report.warning (symbol.source_reference, "Class method `%s' conflicts with method of the same name".printf (get_full_name ()));
+ Report.warning (symbol.source_reference, "Class method `%s' conflicts with method of the same name", get_full_name ());
node.merged = true;
}
}
// properties take precedence
node.processed = true;
node.merged = true;
- Report.warning (symbol.source_reference, "Signal `%s' conflicts with property of the same name".printf (get_full_name ()));
+ Report.warning (symbol.source_reference, "Signal `%s' conflicts with property of the same name", get_full_name ());
} else if (node.symbol is Method) {
// getter in C, but not in Vala
node.merged = true;
void start_element (string name) {
if (current_token != MarkupTokenType.START_ELEMENT || reader.name != name) {
// error
- Report.error (get_current_src (), "expected start element of `%s'".printf (name));
+ Report.error (get_current_src (), "expected start element of `%s'", name);
}
}
void end_element (string name) {
while (current_token != MarkupTokenType.END_ELEMENT || reader.name != name) {
- Report.warning (get_current_src (), "expected end element of `%s'".printf (name));
+ Report.warning (get_current_src (), "expected end element of `%s'", name);
skip_element ();
}
next ();
ed.add_method ((Method) sym);
}
} else {
- Report.error (sym.source_reference, "impossible to add `%s' to container `%s'".printf (sym.name, container.name));
+ Report.error (sym.source_reference, "impossible to add `%s' to container `%s'", sym.name, container.name);
}
}
void parse_repository () {
start_element ("repository");
if (reader.get_attribute ("version") != GIR_VERSION) {
- Report.error (get_current_src (), "unsupported GIR version %s (supported: %s)".printf (reader.get_attribute ("version"), GIR_VERSION));
+ Report.error (get_current_src (), "unsupported GIR version %s (supported: %s)", reader.get_attribute ("version"), GIR_VERSION);
return;
}
next ();
parse_c_include ();
} else {
// error
- Report.error (get_current_src (), "unknown child element `%s' in `repository'".printf (reader.name));
+ Report.error (get_current_src (), "unknown child element `%s' in `repository'", reader.name);
skip_element ();
}
}
skip_element ();
} else {
// error
- Report.error (get_current_src (), "unknown child element `%s' in `namespace'".printf (reader.name));
+ Report.error (get_current_src (), "unknown child element `%s' in `namespace'", reader.name);
skip_element ();
}
skip_element ();
} else {
// error
- Report.error (get_current_src (), "unknown child element `%s' in `%s'".printf (reader.name, element_name));
+ Report.error (get_current_src (), "unknown child element `%s' in `%s'", reader.name, element_name);
skip_element ();
}
}
if (!has_member) {
- Report.error (get_current_src (), "%s `%s' has no members".printf (element_name, current.name));
+ Report.error (get_current_src (), "%s `%s' has no members", element_name, current.name);
}
if (common_prefix != null) {
parse_union ();
} else {
// error
- Report.error (get_current_src (), "unknown child element `%s' in `record'".printf (reader.name));
+ Report.error (get_current_src (), "unknown child element `%s' in `record'", reader.name);
skip_element ();
}
parse_signal ();
} else {
// error
- Report.error (get_current_src (), "unknown child element `%s' in `class'".printf (reader.name));
+ Report.error (get_current_src (), "unknown child element `%s' in `class'", reader.name);
skip_element ();
}
parse_signal ();
} else {
// error
- Report.error (get_current_src (), "unknown child element `%s' in `interface'".printf (reader.name));
+ Report.error (get_current_src (), "unknown child element `%s' in `interface'", reader.name);
skip_element ();
}
parse_union ();
} else {
// error
- Report.error (get_current_src (), "unknown child element `%s' in `class'".printf (reader.name));
+ Report.error (get_current_src (), "unknown child element `%s' in `class'", reader.name);
skip_element ();
}
parse_field ();
} else {
// error
- Report.error (get_current_src (), "unknown child element `%s' in `transparent union'".printf (reader.name));
+ Report.error (get_current_src (), "unknown child element `%s' in `transparent union'", reader.name);
skip_element ();
}
parse_record ();
} else {
// error
- Report.error (get_current_src (), "unknown child element `%s' in `union'".printf (reader.name));
+ Report.error (get_current_src (), "unknown child element `%s' in `union'", reader.name);
skip_element ();
}
alias.symbol = deleg;
} else if (type_sym != null) {
- Report.warning (alias.source_reference, "alias `%s' for `%s' is not supported".printf (alias.get_full_name (), type_sym.get_full_name ()));
+ Report.warning (alias.source_reference, "alias `%s' for `%s' is not supported", alias.get_full_name (), type_sym.get_full_name ());
alias.symbol = type_sym;
alias.merged = true;
}
void process_virtual_method_field (Node node, Delegate d, UnresolvedSymbol gtype_struct_for) {
var gtype_node = resolve_node (node.parent, gtype_struct_for);
if (gtype_node == null || !(gtype_node.symbol is ObjectTypeSymbol)) {
- Report.error (gtype_struct_for.source_reference, "Unknown symbol `%s' for virtual method field `%s'".printf (gtype_struct_for.to_string (), node.to_string ()));
+ Report.error (gtype_struct_for.source_reference, "Unknown symbol `%s' for virtual method field `%s'", gtype_struct_for.to_string (), node.to_string ());
}
var nodes = gtype_node.lookup_all (d.name);
if (nodes == null) {
while (field == null) {
if (!field_it.next ()) {
error = true;
- Report.error (e.source_reference, "too many expressions in initializer list for `%s'".printf (target_type.to_string ()));
+ Report.error (e.source_reference, "too many expressions in initializer list for `%s'", target_type.to_string ());
return false;
}
field = field_it.get ();
}
} else {
error = true;
- Report.error (source_reference, "initializer list used for `%s', which is neither array nor struct".printf (target_type.to_string ()));
+ Report.error (source_reference, "initializer list used for `%s', which is neither array nor struct", target_type.to_string ());
return false;
}
} else if (!e.value_type.compatible (e.target_type)) {
error = true;
e.error = true;
- Report.error (e.source_reference, "Expected initializer of type `%s' but got `%s'".printf (e.target_type.to_string (), e.value_type.to_string ()));
+ Report.error (e.source_reference, "Expected initializer of type `%s' but got `%s'", e.target_type.to_string (), e.value_type.to_string ());
}
}
// check whether prerequisite is at least as accessible as the interface
if (!context.analyzer.is_type_accessible (this, prerequisite_reference)) {
error = true;
- Report.error (source_reference, "prerequisite `%s' is less accessible than interface `%s'".printf (prerequisite_reference.to_string (), get_full_name ()));
+ Report.error (source_reference, "prerequisite `%s' is less accessible than interface `%s'", prerequisite_reference.to_string (), get_full_name ());
return false;
}
}
foreach (DataType prereq in get_prerequisites ()) {
if (!(prereq is ObjectType)) {
error = true;
- Report.error (source_reference, "Prerequisite `%s' of interface `%s' is not a class or interface".printf (prereq.to_string (), get_full_name ()));
+ Report.error (source_reference, "Prerequisite `%s' of interface `%s' is not a class or interface", prereq.to_string (), get_full_name ());
return false;
}
if (prereq.type_symbol is Class) {
if (prereq_class != null) {
error = true;
- Report.error (source_reference, "%s: Interfaces cannot have multiple instantiable prerequisites (`%s' and `%s')".printf (get_full_name (), prereq.type_symbol.get_full_name (), prereq_class.get_full_name ()));
+ Report.error (source_reference, "%s: Interfaces cannot have multiple instantiable prerequisites (`%s' and `%s')", get_full_name (), prereq.type_symbol.get_full_name (), prereq_class.get_full_name ());
return false;
}
foreach (Symbol sym in virtuals) {
int ordering = sym.get_attribute_integer ("CCode", "ordering", -1);
if (ordering < -1) {
- Report.error (sym.source_reference, "%s: Invalid ordering".printf (sym.get_full_name ()));
+ Report.error (sym.source_reference, "%s: Invalid ordering", sym.get_full_name ());
// Mark state as invalid
error = true;
ordered_seen = true;
}
bool ordered = ordering != -1;
if (ordered && unordered_seen && !ordered_seen) {
- Report.error (sym.source_reference, "%s: Cannot mix ordered and unordered virtuals".printf (sym.get_full_name ()));
+ Report.error (sym.source_reference, "%s: Cannot mix ordered and unordered virtuals", sym.get_full_name ());
error = true;
}
ordered_seen = ordered_seen || ordered;
if (!ordered && !unordered_seen && ordered_seen) {
- Report.error (sym.source_reference, "%s: Cannot mix ordered and unordered virtuals".printf (sym.get_full_name ()));
+ Report.error (sym.source_reference, "%s: Cannot mix ordered and unordered virtuals", sym.get_full_name ());
error = true;
}
unordered_seen = unordered_seen || !ordered;
if (ordered) {
Symbol? prev = positions[ordering];
if (prev != null) {
- Report.error (sym.source_reference, "%s: Duplicate ordering (previous virtual with the same position is %s)".printf (sym.get_full_name (), prev.name));
+ Report.error (sym.source_reference, "%s: Duplicate ordering (previous virtual with the same position is %s)", sym.get_full_name (), prev.name);
error = true;
}
positions[ordering] = sym;
for (int i = 0; i < virtuals.size; i++) {
Symbol? sym = positions[i];
if (sym == null) {
- Report.error (source_reference, "%s: Gap in ordering in position %d".printf (get_full_name (), i));
+ Report.error (source_reference, "%s: Gap in ordering in position %d", get_full_name (), i);
error = true;
}
if (!error) {
if (!(target_type is DelegateType)) {
error = true;
if (target_type != null) {
- Report.error (source_reference, "Cannot convert lambda expression to `%s'".printf (target_type.to_string ()));
+ Report.error (source_reference, "Cannot convert lambda expression to `%s'", target_type.to_string ());
} else {
Report.error (source_reference, "lambda expression not allowed in this context");
}
if (lambda_param.direction != cb_param.direction) {
error = true;
- Report.error (lambda_param.source_reference, "direction of parameter `%s' is incompatible with the target delegate".printf (lambda_param.name));
+ Report.error (lambda_param.source_reference, "direction of parameter `%s' is incompatible with the target delegate", lambda_param.name);
}
lambda_param.variable_type = cb_param.variable_type.get_actual_type (target_type, null, this);
}
if (initializer.value_type is FieldPrototype || initializer.value_type is PropertyPrototype) {
error = true;
- Report.error (initializer.source_reference, "Access to instance member `%s' denied".printf (initializer.symbol_reference.get_full_name ()));
+ Report.error (initializer.source_reference, "Access to instance member `%s' denied", initializer.symbol_reference.get_full_name ());
return false;
}
unowned Method m = (Method) initializer.symbol_reference;
unowned Delegate cb = ((DelegateType) variable_type).delegate_symbol;
error = true;
- Report.error (source_reference, "Declaration of method `%s' is not compatible with delegate `%s'".printf (m.get_full_name (), cb.get_full_name ()));
+ Report.error (source_reference, "Declaration of method `%s' is not compatible with delegate `%s'", m.get_full_name (), cb.get_full_name ());
return false;
}
} else {
if (!initializer.value_type.compatible (variable_type)) {
error = true;
- Report.error (source_reference, "Assignment: Cannot convert from `%s' to `%s'".printf (initializer.value_type.to_string (), variable_type.to_string ()));
+ Report.error (source_reference, "Assignment: Cannot convert from `%s' to `%s'", initializer.value_type.to_string (), variable_type.to_string ());
return false;
}
line = 1;
column = 1;
} catch (FileError e) {
- Report.error (null, "Unable to map file `%s': %s".printf (filename, e.message));
+ Report.error (null, "Unable to map file `%s': %s", filename, e.message);
}
}
if (local_sym != null) {
if (symbol_reference != null && symbol_reference != local_sym) {
error = true;
- Report.error (source_reference, "`%s' is an ambiguous reference between `%s' and `%s'".printf (member_name, symbol_reference.get_full_name (), local_sym.get_full_name ()));
+ Report.error (source_reference, "`%s' is an ambiguous reference between `%s' and `%s'", member_name, symbol_reference.get_full_name (), local_sym.get_full_name ());
return false;
}
unowned MemberAccess ma = (MemberAccess) inner;
if (ma.prototype_access) {
error = true;
- Report.error (source_reference, "Access to instance member `%s' denied".printf (inner.symbol_reference.get_full_name ()));
+ Report.error (source_reference, "Access to instance member `%s' denied", inner.symbol_reference.get_full_name ());
return false;
}
}
unowned MemberAccess? arg = s.handler as MemberAccess;
if (arg == null || !arg.check (context) || !(arg.symbol_reference is Method)) {
error = true;
- Report.error (s.handler.source_reference, "Invalid handler for `%s'".printf (s.get_full_name ()));
+ Report.error (s.handler.source_reference, "Invalid handler for `%s'", s.get_full_name ());
}
}
s.access = SymbolAccessibility.PUBLIC;
visited_types_string += " or `%s'".printf (type.to_string ());
}
- Report.error (source_reference, "The name `%s' does not exist in the context of `%s'%s%s".printf (member_name, base_type_name, base_type_package, visited_types_string));
+ Report.error (source_reference, "The name `%s' does not exist in the context of `%s'%s%s", member_name, base_type_name, base_type_package, visited_types_string);
value_type = new InvalidType ();
return false;
} else if (symbol_reference.error) {
symbol_reference = sig.emitter;
} else {
error = true;
- Report.error (source_reference, "Signal `%s' requires emitter in this context".printf (symbol_reference.get_full_name ()));
+ Report.error (source_reference, "Signal `%s' requires emitter in this context", symbol_reference.get_full_name ());
return false;
}
}
if (param.direction != ParameterDirection.IN) {
error = true;
- Report.error (source_reference, "Cannot capture reference or output parameter `%s'".printf (param.get_full_name ()));
+ Report.error (source_reference, "Cannot capture reference or output parameter `%s'", param.get_full_name ());
}
} else {
unowned PropertyAccessor? acc = param.parent_symbol.parent_symbol as PropertyAccessor;
}
if (!is_valid_access) {
error = true;
- Report.error (source_reference, "Access to async callback `%s' not allowed in this context".printf (m.get_full_name ()));
+ Report.error (source_reference, "Access to async callback `%s' not allowed in this context", m.get_full_name ());
return false;
}
if (lvalue) {
if (prop.set_accessor == null) {
error = true;
- Report.error (source_reference, "Property `%s' is read-only".printf (prop.get_full_name ()));
+ Report.error (source_reference, "Property `%s' is read-only", prop.get_full_name ());
return false;
}
if (prop.access == SymbolAccessibility.PUBLIC) {
} else {
if (prop.get_accessor == null) {
error = true;
- Report.error (source_reference, "Property `%s' is write-only".printf (prop.get_full_name ()));
+ Report.error (source_reference, "Property `%s' is write-only", prop.get_full_name ());
return false;
}
if (prop.access == SymbolAccessibility.PUBLIC) {
if (!in_subtype) {
error = true;
- Report.error (source_reference, "Access to protected member `%s' denied".printf (member.get_full_name ()));
+ Report.error (source_reference, "Access to protected member `%s' denied", member.get_full_name ());
return false;
}
} else if (access == SymbolAccessibility.PRIVATE) {
if (!in_target_type) {
error = true;
- Report.error (source_reference, "Access to private member `%s' denied".printf (member.get_full_name ()));
+ Report.error (source_reference, "Access to private member `%s' denied", member.get_full_name ());
return false;
}
}
if (inner.symbol_reference is Method) {
// do not warn when calling .begin or .end on static async method
} else {
- Report.warning (source_reference, "Access to static member `%s' with an instance reference".printf (symbol_reference.get_full_name ()));
+ Report.warning (source_reference, "Access to static member `%s' with an instance reference", symbol_reference.get_full_name ());
// Transform to static member access
unowned Symbol? inner_sym = symbol_reference.parent_symbol;
if (context.experimental_non_null && instance && inner.value_type.nullable &&
!(inner.value_type is PointerType) && !(inner.value_type is GenericType) &&
!(inner.value_type is ArrayType)) {
- Report.error (source_reference, "Access to instance member `%s' from nullable reference denied".printf (symbol_reference.get_full_name ()));
+ Report.error (source_reference, "Access to instance member `%s' from nullable reference denied", symbol_reference.get_full_name ());
}
unowned Method? m = symbol_reference as Method;
if (!compatible (base_method, out invalid_match)) {
error = true;
var base_method_type = new MethodType (base_method);
- Report.error (source_reference, "overriding method `%s' is incompatible with base method `%s': %s.".printf (get_full_name (), base_method_type.to_prototype_string (), invalid_match));
+ Report.error (source_reference, "overriding method `%s' is incompatible with base method `%s': %s.", get_full_name (), base_method_type.to_prototype_string (), invalid_match);
return;
}
} else if (!hides && invalid_base_match != null) {
error = true;
var base_method_type = new MethodType (invalid_base_match);
- Report.error (source_reference, "overriding method `%s' is incompatible with base method `%s': %s.".printf (get_full_name (), base_method_type.to_prototype_string (), invalid_error));
+ Report.error (source_reference, "overriding method `%s' is incompatible with base method `%s': %s.", get_full_name (), base_method_type.to_prototype_string (), invalid_error);
return;
}
if (base_interface_type != null) {
- Report.error (source_reference, "`%s': no suitable interface method found to implement".printf (get_full_name ()));
+ Report.error (source_reference, "`%s': no suitable interface method found to implement", get_full_name ());
}
}
if (return_type.type_symbol == context.analyzer.va_list_type.type_symbol) {
error = true;
- Report.error (source_reference, "`%s' not supported as return type".printf (return_type.type_symbol.get_full_name ()));
+ Report.error (source_reference, "`%s' not supported as return type", return_type.type_symbol.get_full_name ());
return false;
}
// check whether error type is at least as accessible as the method
if (!context.analyzer.is_type_accessible (this, error_type)) {
error = true;
- Report.error (source_reference, "error type `%s' is less accessible than method `%s'".printf (error_type.to_string (), get_full_name ()));
+ Report.error (source_reference, "error type `%s' is less accessible than method `%s'", error_type.to_string (), get_full_name ());
return false;
}
}
if (context.analyzer.current_struct != null) {
if (is_abstract || is_virtual || overrides) {
error = true;
- Report.error (source_reference, "A struct member `%s' cannot be marked as override, virtual, or abstract".printf (get_full_name ()));
+ Report.error (source_reference, "A struct member `%s' cannot be marked as override, virtual, or abstract", get_full_name ());
return false;
}
} else if (overrides && base_method == null && base_interface_method != null && base_interface_method.is_abstract) {
- Report.warning (source_reference, "`override' not required to implement `abstract' interface method `%s'".printf (base_interface_method.get_full_name ()));
+ Report.warning (source_reference, "`override' not required to implement `abstract' interface method `%s'", base_interface_method.get_full_name ());
overrides = false;
} else if (overrides && base_method == null && base_interface_method == null) {
- Report.error (source_reference, "`%s': no suitable method found to override".printf (get_full_name ()));
+ Report.error (source_reference, "`%s': no suitable method found to override", get_full_name ());
} else if ((is_abstract || is_virtual || overrides) && access == SymbolAccessibility.PRIVATE) {
error = true;
- Report.error (source_reference, "Private member `%s' cannot be marked as override, virtual, or abstract".printf (get_full_name ()));
+ Report.error (source_reference, "Private member `%s' cannot be marked as override, virtual, or abstract", get_full_name ());
return false;
}
m.checked = true;
m.error = true;
error = true;
- Report.error (source_reference, "`%s' already contains an implementation for `%s'".printf (cl.get_full_name (), base_interface_method.get_full_name ()));
- Report.notice (m.source_reference, "previous implementation of `%s' was here".printf (base_interface_method.get_full_name ()));
+ Report.error (source_reference, "`%s' already contains an implementation for `%s'", cl.get_full_name (), base_interface_method.get_full_name ());
+ Report.notice (m.source_reference, "previous implementation of `%s' was here", base_interface_method.get_full_name ());
return false;
}
}
context.analyzer.current_symbol = old_symbol;
if (!external_package && !overrides && !hides && get_hidden_member () != null) {
- Report.warning (source_reference, "%s hides inherited method `%s'. Use the `new' keyword if hiding was intentional".printf (get_full_name (), get_hidden_member ().get_full_name ()));
+ Report.warning (source_reference, "%s hides inherited method `%s'. Use the `new' keyword if hiding was intentional", get_full_name (), get_hidden_member ().get_full_name ());
}
// check whether return type is at least as accessible as the method
if (!context.analyzer.is_type_accessible (this, return_type)) {
error = true;
- Report.error (source_reference, "return type `%s' is less accessible than method `%s'".printf (return_type.to_string (), get_full_name ()));
+ Report.error (source_reference, "return type `%s' is less accessible than method `%s'", return_type.to_string (), get_full_name ());
return false;
}
}
bool is_dynamic_error = body_error_type is ErrorType && ((ErrorType) body_error_type).dynamic_error;
if (!can_propagate_error && !is_dynamic_error) {
- Report.warning (body_error_type.source_reference, "unhandled error `%s'".printf (body_error_type.to_string()));
+ Report.warning (body_error_type.source_reference, "unhandled error `%s'", body_error_type.to_string());
}
}
}
if (is_possible_entry_point (context)) {
if (context.entry_point != null) {
error = true;
- Report.error (source_reference, "program already has an entry point `%s'".printf (context.entry_point.get_full_name ()));
+ Report.error (source_reference, "program already has an entry point `%s'", context.entry_point.get_full_name ());
return false;
}
entry_point = true;
unowned MemberAccess ma = (MemberAccess) call;
if (ma.prototype_access) {
error = true;
- Report.error (source_reference, "Access to instance member `%s' denied".printf (call.symbol_reference.get_full_name ()));
+ Report.error (source_reference, "Access to instance member `%s' denied", call.symbol_reference.get_full_name ());
return false;
}
base_cm = cl.default_construction_method;
if (base_cm == null) {
error = true;
- Report.error (source_reference, "chain up to `%s' not supported".printf (cl.get_full_name ()));
+ Report.error (source_reference, "chain up to `%s' not supported", cl.get_full_name ());
return false;
} else if (!base_cm.has_construct_function) {
error = true;
- Report.error (source_reference, "chain up to `%s' not supported".printf (base_cm.get_full_name ()));
+ Report.error (source_reference, "chain up to `%s' not supported", base_cm.get_full_name ());
return false;
}
} else if (call.symbol_reference is CreationMethod && call.symbol_reference.parent_symbol is Class) {
base_cm = (CreationMethod) call.symbol_reference;
if (!base_cm.has_construct_function) {
error = true;
- Report.error (source_reference, "chain up to `%s' not supported".printf (base_cm.get_full_name ()));
+ Report.error (source_reference, "chain up to `%s' not supported", base_cm.get_full_name ());
return false;
}
} else if (gobject_chainup) {
}
} else if (ma.member_name == "begin" || ma.member_name == "end") {
error = true;
- Report.error (ma.source_reference, "use of `%s' not allowed in yield statement".printf (ma.member_name));
+ Report.error (ma.source_reference, "use of `%s' not allowed in yield statement", ma.member_name);
}
}
unowned Property? prop = inner.symbol_reference as Property;
if (prop != null && (prop.set_accessor == null || !prop.set_accessor.writable)) {
error = true;
- Report.error (inner.source_reference, "Property `%s' is read-only".printf (prop.get_full_name ()));
+ Report.error (inner.source_reference, "Property `%s' is read-only", prop.get_full_name ());
}
}
// avoid passing possible null to ref_sink_function without checking
if (type_arg == null) {
error = true;
- Report.error (ma.source_reference, "cannot infer generic type argument for type parameter `%s'".printf (type_param.get_full_name ()));
+ Report.error (ma.source_reference, "cannot infer generic type argument for type parameter `%s'", type_param.get_full_name ());
return false;
}
var constructor = (Method) constructor_sym;
if (!(constructor_sym is CreationMethod)) {
error = true;
- Report.error (source_reference, "`%s' is not a creation method".printf (constructor.get_full_name ()));
+ Report.error (source_reference, "`%s' is not a creation method", constructor.get_full_name ());
return false;
}
symbol_reference = type_sym;
} else {
error = true;
- Report.error (source_reference, "`%s' is not a class, struct, or error code".printf (type_sym.get_full_name ()));
+ Report.error (source_reference, "`%s' is not a class, struct, or error code", type_sym.get_full_name ());
return false;
}
if (cl.is_abstract) {
value_type = null;
error = true;
- Report.error (source_reference, "Can't create instance of abstract class `%s'".printf (cl.get_full_name ()));
+ Report.error (source_reference, "Can't create instance of abstract class `%s'", cl.get_full_name ());
return false;
}
if (symbol_reference == null) {
error = true;
- Report.error (source_reference, "`%s' does not have a default constructor".printf (cl.get_full_name ()));
+ Report.error (source_reference, "`%s' does not have a default constructor", cl.get_full_name ());
return false;
}
if (!in_target_type) {
error = true;
- Report.error (source_reference, "Access to non-public constructor `%s' denied".printf (symbol_reference.get_full_name ()));
+ Report.error (source_reference, "Access to non-public constructor `%s' denied", symbol_reference.get_full_name ());
return false;
}
}
if (context.profile == Profile.GOBJECT && st.is_simple_type () && symbol_reference == null && object_initializer.size == 0) {
error = true;
- Report.error (source_reference, "`%s' does not have a default constructor".printf (st.get_full_name ()));
+ Report.error (source_reference, "`%s' does not have a default constructor", st.get_full_name ());
return false;
}
}
if (symbol_reference == null && argument_list.size != 0) {
value_type = null;
error = true;
- Report.error (source_reference, "No arguments allowed when constructing type `%s'".printf (type.get_full_name ()));
+ Report.error (source_reference, "No arguments allowed when constructing type `%s'", type.get_full_name ());
return false;
}
if (initializer is NullLiteral
&& !variable_type.nullable
&& direction != ParameterDirection.OUT) {
- Report.warning (source_reference, "`null' incompatible with parameter type `%s'".printf (variable_type.to_string ()));
+ Report.warning (source_reference, "`null' incompatible with parameter type `%s'", variable_type.to_string ());
} else if (!(initializer is NullLiteral) && direction == ParameterDirection.OUT) {
error = true;
Report.error (source_reference, "only `null' is allowed as default value for out parameters");
} else if (direction == ParameterDirection.IN && !initializer.value_type.compatible (variable_type)) {
error = true;
- Report.error (initializer.source_reference, "Cannot convert from `%s' to `%s'".printf (initializer.value_type.to_string (), variable_type.to_string ()));
+ Report.error (initializer.source_reference, "Cannot convert from `%s' to `%s'", initializer.value_type.to_string (), variable_type.to_string ());
} else if (direction == ParameterDirection.REF) {
error = true;
Report.error (source_reference, "default value not allowed for ref parameter");
} else if (!initializer.is_accessible (this)) {
error = true;
- Report.error (initializer.source_reference, "default value is less accessible than method `%s'".printf (parent_symbol.get_full_name ()));
+ Report.error (initializer.source_reference, "default value is less accessible than method `%s'", parent_symbol.get_full_name ());
}
}
// check whether parameter type is at least as accessible as the method
if (!context.analyzer.is_type_accessible (this, variable_type)) {
error = true;
- Report.error (source_reference, "parameter type `%s' is less accessible than method `%s'".printf (variable_type.to_string (), parent_symbol.get_full_name ()));
+ Report.error (source_reference, "parameter type `%s' is less accessible than method `%s'", variable_type.to_string (), parent_symbol.get_full_name ());
}
}
void report_parse_error (ParseError e) {
var begin = get_location ();
next ();
- Report.error (get_src (begin), "syntax error, " + e.message);
+ Report.error (get_src (begin), "syntax error, %s", e.message);
}
inline bool expect (TokenType type) throws ParseError {
try {
rollback (begin);
stmt = parse_expression_statement ();
- Report.warning (get_src (begin), "`%s' is a syntax keyword, replace with `@%s'".printf (token, token));
+ Report.warning (get_src (begin), "`%s' is a syntax keyword, replace with `@%s'", token, token);
} catch (ParseError e2) {
var e2_begin = get_location ();
rollback (e_begin);
next ();
- Report.error (get_src (e_begin), "Possible `%s-statement' syntax error, %s".printf (token, e.message));
+ Report.error (get_src (e_begin), "Possible `%s-statement' syntax error, %s", token, e.message);
rollback (e2_begin);
throw e2;
}
switch (current ()) {
case TokenType.SEMICOLON:
if (!accept_empty_body) {
- Report.warning (get_current_src (), "%s-statement without body".printf (statement_name));
+ Report.warning (get_current_src (), "%s-statement without body", statement_name);
}
return parse_empty_statement ();
case TokenType.IF:
if (attributes != null) {
foreach (Attribute attr in (List<Attribute>) attributes) {
if (node.get_attribute (attr.name) != null) {
- Report.error (attr.source_reference, "duplicate attribute `%s'".printf (attr.name));
+ Report.error (attr.source_reference, "duplicate attribute `%s'", attr.name);
}
node.attributes.append (attr);
}
if (ma.prototype_access) {
error = true;
- Report.error (source_reference, "Access to instance member `%s' denied".printf (ma.symbol_reference.get_full_name ()));
+ Report.error (source_reference, "Access to instance member `%s' denied", ma.symbol_reference.get_full_name ());
return false;
}
if (prop.set_accessor == null || !prop.set_accessor.writable) {
ma.error = true;
- Report.error (ma.source_reference, "Property `%s' is read-only".printf (prop.get_full_name ()));
+ Report.error (ma.source_reference, "Property `%s' is read-only", prop.get_full_name ());
return false;
}
}
string invalid_match;
if (!compatible (base_property, out invalid_match)) {
error = true;
- Report.error (source_reference, "Type and/or accessors of overriding property `%s' do not match overridden property `%s': %s.".printf (get_full_name (), base_property.get_full_name (), invalid_match));
+ Report.error (source_reference, "Type and/or accessors of overriding property `%s' do not match overridden property `%s': %s.", get_full_name (), base_property.get_full_name (), invalid_match);
return;
}
string invalid_match;
if (!compatible (base_property, out invalid_match)) {
error = true;
- Report.error (source_reference, "Type and/or accessors of overriding property `%s' do not match overridden property `%s': %s.".printf (get_full_name (), base_property.get_full_name (), invalid_match));
+ Report.error (source_reference, "Type and/or accessors of overriding property `%s' do not match overridden property `%s': %s.", get_full_name (), base_property.get_full_name (), invalid_match);
return;
}
if (get_accessor == null && set_accessor == null) {
error = true;
- Report.error (source_reference, "Property `%s' must have a `get' accessor and/or a `set' mutator".printf (get_full_name ()));
+ Report.error (source_reference, "Property `%s' must have a `get' accessor and/or a `set' mutator", get_full_name ());
return false;
}
}
if (initializer != null && field == null && !is_abstract) {
- Report.error (source_reference, "Property `%s' with custom `get' accessor and/or `set' mutator cannot have `default' value".printf (get_full_name ()));
+ Report.error (source_reference, "Property `%s' with custom `get' accessor and/or `set' mutator cannot have `default' value", get_full_name ());
}
if (initializer != null) {
// check whether property type is at least as accessible as the property
if (!context.analyzer.is_type_accessible (this, property_type)) {
error = true;
- Report.error (source_reference, "property type `%s' is less accessible than property `%s'".printf (property_type.to_string (), get_full_name ()));
+ Report.error (source_reference, "property type `%s' is less accessible than property `%s'", property_type.to_string (), get_full_name ());
}
if (overrides && base_property == null && base_interface_property == null) {
- Report.error (source_reference, "%s: no suitable property found to override".printf (get_full_name ()));
+ Report.error (source_reference, "%s: no suitable property found to override", get_full_name ());
}
if (!external_package && !overrides && !hides && get_hidden_member () != null) {
- Report.warning (source_reference, "%s hides inherited property `%s'. Use the `new' keyword if hiding was intentional".printf (get_full_name (), get_hidden_member ().get_full_name ()));
+ Report.warning (source_reference, "%s hides inherited property `%s'. Use the `new' keyword if hiding was intentional", get_full_name (), get_hidden_member ().get_full_name ());
}
/* construct properties must be public */
if (set_accessor != null && set_accessor.construction) {
if (access != SymbolAccessibility.PUBLIC) {
error = true;
- Report.error (source_reference, "%s: construct properties must be public".printf (get_full_name ()));
+ Report.error (source_reference, "%s: construct properties must be public", get_full_name ());
}
}
if (initializer != null && !initializer.error && initializer.value_type != null && !(initializer.value_type.compatible (property_type))) {
error = true;
- Report.error (initializer.source_reference, "Expected initializer of type `%s' but got `%s'".printf (property_type.to_string (), initializer.value_type.to_string ()));
+ Report.error (initializer.source_reference, "Expected initializer of type `%s' but got `%s'", property_type.to_string (), initializer.value_type.to_string ());
}
context.analyzer.current_source_file = old_source_file;
// Hopefully good as is
} else if (!value_type.value_owned && source_reference.file.file_type == SourceFileType.SOURCE) {
error = true;
- Report.error (source_reference, "unowned return value for getter of property `%s' not supported without accessor".printf (prop.get_full_name ()));
+ Report.error (source_reference, "unowned return value for getter of property `%s' not supported without accessor", prop.get_full_name ());
}
} else if (value_type.value_owned && (source_reference == null || source_reference.file == null)) {
if (value_type is DelegateType || value_type is PointerType || (value_type is ValueType && !value_type.nullable)) {
if ((prop.is_abstract || prop.is_virtual || prop.overrides) && access == SymbolAccessibility.PRIVATE) {
error = true;
- Report.error (source_reference, "Property `%s' with private accessor cannot be marked as abstract, virtual or override".printf (prop.get_full_name ()));
+ Report.error (source_reference, "Property `%s' with private accessor cannot be marked as abstract, virtual or override", prop.get_full_name ());
return false;
}
if (body != null && prop.is_abstract) {
error = true;
- Report.error (source_reference, "Accessor of abstract property `%s' cannot have body".printf (prop.get_full_name ()));
+ Report.error (source_reference, "Accessor of abstract property `%s' cannot have body", prop.get_full_name ());
return false;
}
body.get_error_types (error_types);
foreach (DataType body_error_type in error_types) {
if (!((ErrorType) body_error_type).dynamic_error) {
- Report.warning (body_error_type.source_reference, "unhandled error `%s'".printf (body_error_type.to_string()));
+ Report.warning (body_error_type.source_reference, "unhandled error `%s'", body_error_type.to_string ());
}
}
}
if (regex != null) { /* Regex is valid. */ }
} catch (RegexError err) {
error = true;
- Report.error (source_reference, "Invalid regular expression `%s'.".printf (value));
+ Report.error (source_reference, "Invalid regular expression `%s'.", value);
return false;
}
if (!return_expression.value_type.compatible (context.analyzer.current_return_type)) {
error = true;
- Report.error (source_reference, "Return: Cannot convert from `%s' to `%s'".printf (return_expression.value_type.to_string (), context.analyzer.current_return_type.to_string ()));
+ Report.error (source_reference, "Return: Cannot convert from `%s' to `%s'", return_expression.value_type.to_string (), context.analyzer.current_return_type.to_string ());
return false;
}
if (return_expression is NullLiteral
&& !context.analyzer.current_return_type.nullable) {
- Report.warning (source_reference, "`null' incompatible with return type `%s'".printf (context.analyzer.current_return_type.to_string ()));
+ Report.warning (source_reference, "`null' incompatible with return type `%s'", context.analyzer.current_return_type.to_string ());
}
return !error;
if (current < end) {
current++;
} else {
- Report.error (get_source_reference (token_length_in_chars), "syntax error, expected %c".printf (begin[0]));
+ Report.error (get_source_reference (token_length_in_chars), "syntax error, expected %c", begin[0]);
}
break;
default:
} else if (lookup (name) != null) {
owner.error = true;
if (owner.name == null && owner.parent_symbol == null) {
- Report.error (sym.source_reference, "The root namespace already contains a definition for `%s'".printf (name));
+ Report.error (sym.source_reference, "The root namespace already contains a definition for `%s'", name);
} else {
- Report.error (sym.source_reference, "`%s' already contains a definition for `%s'".printf (owner.get_full_name (), name));
+ Report.error (sym.source_reference, "`%s' already contains a definition for `%s'", owner.get_full_name (), name);
}
- Report.notice (lookup (name).source_reference, "previous definition of `%s' was here".printf (name));
+ Report.notice (lookup (name).source_reference, "previous definition of `%s' was here", name);
return;
}
} else if (sym is ErrorCode) {
type = new ErrorType ((ErrorDomain) sym.parent_symbol, (ErrorCode) sym);
} else {
- Report.error (null, "internal error: `%s' is not a supported type".printf (sym.get_full_name ()));
+ Report.error (null, "internal error: `%s' is not a supported type", sym.get_full_name ());
return new InvalidType ();
}
expr.error = true;
unowned MethodType? m = mtype as MethodType;
if (m != null) {
- Report.error (expr.source_reference, "%d missing arguments for `%s'".printf (m.get_parameters ().size - args.size, m.to_prototype_string ()));
+ Report.error (expr.source_reference, "%d missing arguments for `%s'", m.get_parameters ().size - args.size, m.to_prototype_string ());
} else {
- Report.error (expr.source_reference, "Too few arguments, method `%s' does not take %d arguments".printf (mtype.to_string (), args.size));
+ Report.error (expr.source_reference, "Too few arguments, method `%s' does not take %d arguments", mtype.to_string (), args.size);
}
error = true;
} else {
expr.error = true;
unowned MethodType? m = mtype as MethodType;
if (m != null) {
- Report.error (expr.source_reference, "%d extra arguments for `%s'".printf (args.size - m.get_parameters ().size, m.to_prototype_string ()));
+ Report.error (expr.source_reference, "%d extra arguments for `%s'", args.size - m.get_parameters ().size, m.to_prototype_string ());
} else {
- Report.error (expr.source_reference, "Too many arguments, method `%s' does not take %d arguments".printf (mtype.to_string (), args.size));
+ Report.error (expr.source_reference, "Too many arguments, method `%s' does not take %d arguments", mtype.to_string (), args.size);
}
error = true;
}
} else if (arg.value_type == null) {
// disallow untyped arguments except for type inference of callbacks
if (!(arg.target_type is DelegateType) || !(arg.symbol_reference is Method)) {
- Report.error (arg.source_reference, "Invalid type for argument %d".printf (i + 1));
+ Report.error (arg.source_reference, "Invalid type for argument %d", i + 1);
return false;
}
} else {
if (arg_type == 0) {
if (direction == ParameterDirection.REF) {
- Report.error (arg.source_reference, "Argument %d: Cannot pass null to reference parameter".printf (i + 1));
+ Report.error (arg.source_reference, "Argument %d: Cannot pass null to reference parameter", i + 1);
return false;
} else if (direction != ParameterDirection.OUT && !arg.target_type.nullable) {
- Report.warning (arg.source_reference, "Argument %d: Cannot pass null to non-null parameter type".printf (i + 1));
+ Report.warning (arg.source_reference, "Argument %d: Cannot pass null to non-null parameter type", i + 1);
}
} else if (arg_type == 1) {
if (direction != ParameterDirection.IN) {
- Report.error (arg.source_reference, "Argument %d: Cannot pass value to reference or output parameter".printf (i + 1));
+ Report.error (arg.source_reference, "Argument %d: Cannot pass value to reference or output parameter", i + 1);
return false;
}
} else if (arg_type == 2) {
if (direction != ParameterDirection.REF) {
- Report.error (arg.source_reference, "Argument %d: Cannot pass ref argument to non-reference parameter".printf (i + 1));
+ Report.error (arg.source_reference, "Argument %d: Cannot pass ref argument to non-reference parameter", i + 1);
return false;
}
if (arg.target_type.is_disposable ()) {
if (!(arg.value_type is PointerType) && !arg.value_type.value_owned) {
/* variable doesn't own the value */
- Report.error (arg.source_reference, "Argument %d: Cannot pass unowned ref argument to owned reference parameter".printf (i + 1));
+ Report.error (arg.source_reference, "Argument %d: Cannot pass unowned ref argument to owned reference parameter", i + 1);
return false;
}
}
if (arg.value_type.is_disposable ()) {
if (!arg.target_type.value_owned) {
/* parameter doesn't own the value */
- Report.error (arg.source_reference, "Argument %d: Cannot pass owned ref argument to unowned reference parameter".printf (i + 1));
+ Report.error (arg.source_reference, "Argument %d: Cannot pass owned ref argument to unowned reference parameter", i + 1);
return false;
}
}
} else if (arg_type == 3) {
if (direction != ParameterDirection.OUT) {
- Report.error (arg.source_reference, "Argument %d: Cannot pass out argument to non-output parameter".printf (i + 1));
+ Report.error (arg.source_reference, "Argument %d: Cannot pass out argument to non-output parameter", i + 1);
return false;
}
if (arg.target_type != null) {
if ((direction == ParameterDirection.IN || direction == ParameterDirection.REF)
&& !arg.value_type.compatible (arg.target_type)) {
- Report.error (arg.source_reference, "Argument %d: Cannot convert from `%s' to `%s'".printf (i + 1, arg.value_type.to_prototype_string (), arg.target_type.to_prototype_string ()));
+ Report.error (arg.source_reference, "Argument %d: Cannot convert from `%s' to `%s'", i + 1, arg.value_type.to_prototype_string (), arg.target_type.to_prototype_string ());
return false;
} else if ((direction == ParameterDirection.REF || direction == ParameterDirection.OUT)
&& !arg.target_type.compatible (arg.value_type)
&& !(arg is NullLiteral)) {
- Report.error (arg.source_reference, "Argument %d: Cannot convert from `%s' to `%s'".printf (i + 1, arg.target_type.to_prototype_string (), arg.value_type.to_prototype_string ()));
+ Report.error (arg.source_reference, "Argument %d: Cannot convert from `%s' to `%s'", i + 1, arg.target_type.to_prototype_string (), arg.value_type.to_prototype_string ());
return false;
}
}
// allow prototype access if target type is delegate without target
unowned DelegateType? deleg_type = arg.target_type as DelegateType;
if (deleg_type == null || deleg_type.delegate_symbol.has_target) {
- Report.error (arg.source_reference, "Access to instance member `%s' denied".printf (arg.symbol_reference.get_full_name ()));
+ Report.error (arg.source_reference, "Access to instance member `%s' denied", arg.symbol_reference.get_full_name ());
return false;
}
}
} else if (arg.value_type == null) {
// disallow untyped arguments except for type inference of callbacks
if (!(arg.symbol_reference is Method)) {
- Report.error (source_reference, "Invalid type for argument %d".printf (i + 1));
+ Report.error (source_reference, "Invalid type for argument %d", i + 1);
return false;
}
} else if (arg.target_type != null && !arg.value_type.compatible (arg.target_type)) {
// target_type known for printf arguments
- Report.error (arg.source_reference, "Argument %d: Cannot convert from `%s' to `%s'".printf (i + 1, arg.value_type.to_string (), arg.target_type.to_string ()));
+ Report.error (arg.source_reference, "Argument %d: Cannot convert from `%s' to `%s'", i + 1, arg.value_type.to_string (), arg.target_type.to_string ());
return false;
}
if (instance_type == null) {
if (node_reference != null) {
CodeNode? reference = get_symbol_for_data_type (derived_instance_type);
- Report.error ((reference ?? node_reference).source_reference, "The type-parameter `%s' is missing".printf (generic_type.to_string ()));
+ Report.error ((reference ?? node_reference).source_reference, "The type-parameter `%s' is missing", generic_type.to_string ());
node_reference.error = true;
}
return new InvalidType ();
}
if (param_index == -1) {
if (node_reference != null) {
- Report.error (node_reference.source_reference, "internal error: unknown type parameter %s".printf (generic_type.type_parameter.name));
+ Report.error (node_reference.source_reference, "internal error: unknown type parameter %s", generic_type.type_parameter.name);
node_reference.error = true;
}
return new InvalidType ();
int param_index = m.get_type_parameter_index (generic_type.type_parameter.name);
if (param_index == -1) {
if (node_reference != null) {
- Report.error (node_reference.source_reference, "internal error: unknown type parameter %s".printf (generic_type.type_parameter.name));
+ Report.error (node_reference.source_reference, "internal error: unknown type parameter %s", generic_type.type_parameter.name);
node_reference.error = true;
}
return new InvalidType ();
init.symbol_reference = symbol_lookup_inherited (type.type_symbol, init.name);
if (!(init.symbol_reference is Field || init.symbol_reference is Property)) {
init.error = true;
- Report.error (init.source_reference, "Invalid member `%s' in `%s'".printf (init.name, type.type_symbol.get_full_name ()));
+ Report.error (init.source_reference, "Invalid member `%s' in `%s'", init.name, type.type_symbol.get_full_name ());
return;
}
if (init.symbol_reference.access != SymbolAccessibility.PUBLIC) {
init.error = true;
- Report.error (init.source_reference, "Access to private member `%s' denied".printf (init.symbol_reference.get_full_name ()));
+ Report.error (init.source_reference, "Access to private member `%s' denied", init.symbol_reference.get_full_name ());
return;
}
DataType member_type = null;
member_type = prop.property_type;
if (prop.set_accessor == null || !prop.set_accessor.writable) {
init.error = true;
- Report.error (init.source_reference, "Property `%s' is read-only".printf (prop.get_full_name ()));
+ Report.error (init.source_reference, "Property `%s' is read-only", prop.get_full_name ());
return;
}
}
if (init.initializer.value_type == null || !init.initializer.value_type.compatible (init.initializer.target_type)) {
init.error = true;
- Report.error (init.source_reference, "Invalid type for member `%s'".printf (init.name));
+ Report.error (init.source_reference, "Invalid type for member `%s'", init.name);
return;
}
}
} else if (type_arg is ArrayType) {
Report.error (type_arg.source_reference, "Arrays are not supported as generic type arguments");
} else {
- Report.error (type_arg.source_reference, "`%s' is not a supported generic type argument, use `?' to box value types".printf (type_arg.to_string ()));
+ Report.error (type_arg.source_reference, "`%s' is not a supported generic type argument, use `?' to box value types", type_arg.to_string ());
}
}
}
if (return_type.type_symbol == context.analyzer.va_list_type.type_symbol) {
error = true;
- Report.error (source_reference, "`%s' not supported as return type".printf (return_type.type_symbol.get_full_name ()));
+ Report.error (source_reference, "`%s' not supported as return type", return_type.type_symbol.get_full_name ());
return false;
}
if (!external_package && !hides && get_hidden_member () != null) {
- Report.warning (source_reference, "%s hides inherited signal `%s'. Use the `new' keyword if hiding was intentional".printf (get_full_name (), get_hidden_member ().get_full_name ()));
+ Report.warning (source_reference, "%s hides inherited signal `%s'. Use the `new' keyword if hiding was intentional", get_full_name (), get_hidden_member ().get_full_name ());
}
return !error;
}
error = true;
- Report.error (source_reference, "The expression `%s' does not denote an array".printf (container.value_type.to_string ()));
+ Report.error (source_reference, "The expression `%s' does not denote an array", container.value_type.to_string ());
}
return !error;
try {
mapped_file = new MappedFile (filename, false);
} catch (FileError e) {
- Report.error (null, "Unable to map file `%s': %s".printf (filename, e.message));
+ Report.error (null, "Unable to map file `%s': %s", filename, e.message);
return null;
}
}
var cm = (CreationMethod) m;
if (cm.class_name != null && cm.class_name != name) {
// type_name is null for constructors generated by GIdlParser
- Report.error (m.source_reference, "missing return type in method `%s.%s´".printf (get_full_name (), cm.class_name));
+ Report.error (m.source_reference, "missing return type in method `%s.%s´", get_full_name (), cm.class_name);
m.error = true;
return;
}
if (!(base_type is ValueType)) {
error = true;
- Report.error (source_reference, "The base type `%s' of struct `%s' is not a struct".printf (base_type.to_string (), get_full_name ()));
+ Report.error (source_reference, "The base type `%s' of struct `%s' is not a struct", base_type.to_string (), get_full_name ());
return false;
}
}
}
if (base_type == null && !has_instance_field && !is_boolean_type () && !is_integer_type () && !is_floating_type ()) {
error = true;
- Report.error (source_reference, "struct `%s' cannot be empty".printf (get_full_name ()));
+ Report.error (source_reference, "struct `%s' cannot be empty", get_full_name ());
} else if (base_type != null && has_instance_field) {
error = true;
- Report.error (source_reference, "derived struct `%s' may not have instance fields".printf (get_full_name ()));
+ Report.error (source_reference, "derived struct `%s' may not have instance fields", get_full_name ());
}
}
}
if (!expression.value_type.compatible (switch_statement.expression.value_type)) {
error = true;
- Report.error (expression.source_reference, "Cannot convert from `%s' to `%s'".printf (expression.value_type.to_string (), switch_statement.expression.value_type.to_string ()));
+ Report.error (expression.source_reference, "Cannot convert from `%s' to `%s'", expression.value_type.to_string (), switch_statement.expression.value_type.to_string ());
return false;
}
}
}
public virtual void add_namespace (Namespace ns) {
- Report.error (ns.source_reference, "inner `%s' is not supported in `%s'".printf ("namespace", get_full_name ()));
+ Report.error (ns.source_reference, "inner `%s' is not supported in `%s'", "namespace", get_full_name ());
}
public virtual void add_class (Class cl) {
- Report.error (cl.source_reference, "inner `%s' types are not supported in `%s'".printf ("class", get_full_name ()));
+ Report.error (cl.source_reference, "inner `%s' types are not supported in `%s'", "class", get_full_name ());
}
public virtual void add_interface (Interface iface) {
- Report.error (iface.source_reference, "inner `%s' types are not supported in `%s'".printf ("interface", get_full_name ()));
+ Report.error (iface.source_reference, "inner `%s' types are not supported in `%s'", "interface", get_full_name ());
}
public virtual void add_struct (Struct st) {
- Report.error (st.source_reference, "inner `%s' types are not supported in `%s'".printf ("struct", get_full_name ()));
+ Report.error (st.source_reference, "inner `%s' types are not supported in `%s'", "struct", get_full_name ());
}
public virtual void add_enum (Enum en) {
- Report.error (en.source_reference, "inner `%s' types are not supported in `%s'".printf ("enum", get_full_name ()));
+ Report.error (en.source_reference, "inner `%s' types are not supported in `%s'", "enum", get_full_name ());
}
public virtual void add_error_domain (ErrorDomain edomain) {
- Report.error (edomain.source_reference, "inner `%s' types are not supported in `%s'".printf ("errordomain", get_full_name ()));
+ Report.error (edomain.source_reference, "inner `%s' types are not supported in `%s'", "errordomain", get_full_name ());
}
public virtual void add_delegate (Delegate d) {
- Report.error (d.source_reference, "inner `%s' types are not supported in `%s'".printf ("delegate", get_full_name ()));
+ Report.error (d.source_reference, "inner `%s' types are not supported in `%s'", "delegate", get_full_name ());
}
public virtual void add_constant (Constant constant) {
- Report.error (constant.source_reference, "constants are not allowed in `%s'".printf (get_full_name ()));
+ Report.error (constant.source_reference, "constants are not allowed in `%s'", get_full_name ());
}
public virtual void add_field (Field f) {
- Report.error (f.source_reference, "fields are not allowed in `%s'".printf (get_full_name ()));
+ Report.error (f.source_reference, "fields are not allowed in `%s'", get_full_name ());
}
public virtual void add_method (Method m) {
- Report.error (m.source_reference, "methods are not allowed in `%s'".printf (get_full_name ()));
+ Report.error (m.source_reference, "methods are not allowed in `%s'", get_full_name ());
}
public virtual void add_property (Property prop) {
- Report.error (prop.source_reference, "properties are not allowed in `%s'".printf (get_full_name ()));
+ Report.error (prop.source_reference, "properties are not allowed in `%s'", get_full_name ());
}
public virtual void add_signal (Signal sig) {
- Report.error (sig.source_reference, "signals are not allowed in `%s'".printf (get_full_name ()));
+ Report.error (sig.source_reference, "signals are not allowed in `%s'", get_full_name ());
}
public virtual void add_constructor (Constructor c) {
- Report.error (c.source_reference, "constructors are not allowed in `%s'".printf (get_full_name ()));
+ Report.error (c.source_reference, "constructors are not allowed in `%s'", get_full_name ());
}
public virtual void add_destructor (Destructor d) {
- Report.error (d.source_reference, "destructors are not allowed in `%s'".printf (get_full_name ()));
+ Report.error (d.source_reference, "destructors are not allowed in `%s'", get_full_name ());
}
public override string to_string () {
if (type.type_symbol is Class) {
if (cl.base_class != null) {
cl.error = true;
- Report.error (type.source_reference, "%s: Classes cannot have multiple base classes (`%s' and `%s')".printf (cl.get_full_name (), cl.base_class.get_full_name (), type.type_symbol.get_full_name ()));
+ Report.error (type.source_reference, "%s: Classes cannot have multiple base classes (`%s' and `%s')", cl.get_full_name (), cl.base_class.get_full_name (), type.type_symbol.get_full_name ());
return;
}
cl.base_class = (Class) type.type_symbol;
if (cl.base_class.is_subtype_of (cl)) {
cl.error = true;
- Report.error (type.source_reference, "Base class cycle (`%s' and `%s')".printf (cl.get_full_name (), cl.base_class.get_full_name ()));
+ Report.error (type.source_reference, "Base class cycle (`%s' and `%s')", cl.get_full_name (), cl.base_class.get_full_name ());
return;
}
}
if (base_type != null) {
if (base_type.is_subtype_of (st)) {
st.error = true;
- Report.error (st.source_reference, "Base struct cycle (`%s' and `%s')".printf (st.get_full_name (), base_type.get_full_name ()));
+ Report.error (st.source_reference, "Base struct cycle (`%s' and `%s')", st.get_full_name (), base_type.get_full_name ());
return;
}
}
foreach (DataType type in iface.get_prerequisites ()) {
if (type.type_symbol != null && type.type_symbol.is_subtype_of (iface)) {
iface.error = true;
- Report.error (type.source_reference, "Prerequisite cycle (`%s' and `%s')".printf (iface.get_full_name (), type.type_symbol.get_full_name ()));
+ Report.error (type.source_reference, "Prerequisite cycle (`%s' and `%s')", iface.get_full_name (), type.type_symbol.get_full_name ());
return;
}
}
ns.namespace_symbol = resolve_symbol (unresolved_symbol);
if (!(ns.namespace_symbol is Namespace)) {
ns.error = true;
- Report.error (ns.source_reference, "The namespace name `%s' could not be found".printf (unresolved_symbol.to_string ()));
+ Report.error (ns.source_reference, "The namespace name `%s' could not be found", unresolved_symbol.to_string ());
return;
}
}
if (local_sym != null && local_sym.access == SymbolAccessibility.PUBLIC) {
if (sym != null && sym != local_sym) {
unresolved_symbol.error = true;
- Report.error (unresolved_symbol.source_reference, "`%s' is an ambiguous reference between `%s' and `%s'".printf (unresolved_symbol.name, sym.get_full_name (), local_sym.get_full_name ()));
+ Report.error (unresolved_symbol.source_reference, "`%s' is an ambiguous reference between `%s' and `%s'", unresolved_symbol.name, sym.get_full_name (), local_sym.get_full_name ());
return null;
}
sym = local_sym;
if (local_sym != null) {
if (sym != null && sym != local_sym) {
unresolved_symbol.error = true;
- Report.error (unresolved_symbol.source_reference, "`%s' is an ambiguous reference between `%s' and `%s'".printf (unresolved_symbol.name, sym.get_full_name (), local_sym.get_full_name ()));
+ Report.error (unresolved_symbol.source_reference, "`%s' is an ambiguous reference between `%s' and `%s'", unresolved_symbol.name, sym.get_full_name (), local_sym.get_full_name ());
return null;
}
sym = local_sym;
var parent_symbol = resolve_symbol (unresolved_symbol.inner);
if (parent_symbol == null) {
unresolved_symbol.error = true;
- Report.error (unresolved_symbol.inner.source_reference, "The symbol `%s' could not be found".printf (unresolved_symbol.inner.name));
+ Report.error (unresolved_symbol.inner.source_reference, "The symbol `%s' could not be found", unresolved_symbol.inner.name);
return null;
}
parent_symbol.used = true;
if (sym == null) {
// don't report same error twice
if (!unresolved_type.unresolved_symbol.error) {
- Report.error (unresolved_type.source_reference, "The type name `%s' could not be found".printf (unresolved_type.unresolved_symbol.to_string ()));
+ Report.error (unresolved_type.source_reference, "The type name `%s' could not be found", unresolved_type.unresolved_symbol.to_string ());
}
return new InvalidType ();
}
} else if (sym is ErrorCode) {
type = new ErrorType ((ErrorDomain) sym.parent_symbol, (ErrorCode) sym, unresolved_type.source_reference);
} else {
- Report.error (unresolved_type.source_reference, "internal error: `%s' is not a supported type".printf (sym.get_full_name ()));
+ Report.error (unresolved_type.source_reference, "internal error: `%s' is not a supported type", sym.get_full_name ());
return new InvalidType ();
}
} else {
- Report.error (unresolved_type.source_reference, "`%s' is not a type".printf (sym.get_full_name ()));
+ Report.error (unresolved_type.source_reference, "`%s' is not a type", sym.get_full_name ());
return new InvalidType ();
}
}
if (context.profile == Profile.GOBJECT && !(error_expression.value_type is ErrorType)) {
- Report.error (error_expression.source_reference, "`%s' is not an error type".printf (error_expression.value_type.to_string ()));
+ Report.error (error_expression.source_reference, "`%s' is not an error type", error_expression.value_type.to_string ());
error = true;
return false;
}
}
if (type_reference is ErrorType && !(expression.value_type is ErrorType)) {
- Report.error (expression.source_reference, "`%s' must be an error".printf (expression.to_string ()));
+ Report.error (expression.source_reference, "`%s' must be an error", expression.to_string ());
error = true;
return false;
}
if (inner.value_type is FieldPrototype || inner.value_type is PropertyPrototype) {
error = true;
- Report.error (inner.source_reference, "Access to instance member `%s' denied".printf (inner.symbol_reference.get_full_name ()));
+ Report.error (inner.source_reference, "Access to instance member `%s' denied", inner.symbol_reference.get_full_name ());
return false;
}
// integer or floating point type
if (!is_numeric_type (inner.value_type)) {
error = true;
- Report.error (source_reference, "Operator not supported for `%s'".printf (inner.value_type.to_string ()));
+ Report.error (source_reference, "Operator not supported for `%s'", inner.value_type.to_string ());
return false;
}
// boolean type
if (inner.value_type.nullable || !inner.value_type.compatible (context.analyzer.bool_type)) {
error = true;
- Report.error (source_reference, "Operator not supported for `%s'".printf (inner.value_type.to_string ()));
+ Report.error (source_reference, "Operator not supported for `%s'", inner.value_type.to_string ());
return false;
}
// integer type
if (!is_integer_type (inner.value_type) && !(inner.value_type is EnumValueType)) {
error = true;
- Report.error (source_reference, "Operator not supported for `%s'".printf (inner.value_type.to_string ()));
+ Report.error (source_reference, "Operator not supported for `%s'", inner.value_type.to_string ());
return false;
}
// integer type
if (!is_integer_type (inner.value_type)) {
error = true;
- Report.error (source_reference, "Operator not supported for `%s'".printf (inner.value_type.to_string ()));
+ Report.error (source_reference, "Operator not supported for `%s'", inner.value_type.to_string ());
return false;
}
foreach (unowned Attribute attr in sym.attributes) {
var set = marked.get (attr.name);
if (set == null) {
- Report.warning (attr.source_reference, "attribute `%s' never used".printf (attr.name));
+ Report.warning (attr.source_reference, "Attribute `%s' never used", attr.name);
} else {
foreach (var arg in attr.args.get_keys()) {
if (!set.contains (arg)) {
- Report.warning (attr.source_reference, "argument `%s' never used".printf (arg));
+ Report.warning (attr.source_reference, "Argument `%s' never used", arg);
}
}
}
string? package_version = symbol.source_reference.file.installed_version;
if (!context.deprecated && (package_version == null || deprecated_since == null || VersionAttribute.cmp_versions (package_version, deprecated_since) >= 0)) {
- Report.deprecated (source_ref, "`%s' %s%s".printf (symbol.get_full_name (), (deprecated_since == null) ? "is deprecated" : "has been deprecated since %s".printf (deprecated_since), (replacement == null) ? "" : ". Use %s".printf (replacement)));
+ Report.deprecated (source_ref, "`%s' %s%s", symbol.get_full_name (), (deprecated_since == null) ? "is deprecated" : "has been deprecated since %s".printf (deprecated_since), (replacement == null) ? "" : ". Use %s".printf (replacement));
}
result = true;
}
if (context.since_check && package_version != null && VersionAttribute.cmp_versions (package_version, since) < 0) {
unowned string filename = symbol.source_reference.file.filename;
string pkg = Path.get_basename (filename[0:filename.last_index_of_char ('.')]);
- Report.error (source_ref, "`%s' is not available in %s %s. Use %s >= %s".printf (symbol.get_full_name (), pkg, package_version, pkg, since));
+ Report.error (source_ref, "`%s' is not available in %s %s. Use %s >= %s", symbol.get_full_name (), pkg, package_version, pkg, since);
}
result = true;
}
string? experimental_until = this.experimental_until;
if (experimental_until == null || package_version == null || VersionAttribute.cmp_versions (package_version, experimental_until) < 0) {
- Report.experimental (source_ref, "`%s' is experimental%s".printf (symbol.get_full_name (), (experimental_until != null) ? " until %s".printf (experimental_until) : ""));
+ Report.experimental (source_ref, "`%s' is experimental%s", symbol.get_full_name (), (experimental_until != null) ? " until %s".printf (experimental_until) : "");
}
}
result = true;
var package_path = context.get_vapi_path (pkg) ?? context.get_gir_path (pkg);
if (package_path == null) {
- Vala.Report.error (null, "Package `%s' not found in specified Vala API directories or GObject-Introspection GIR directories".printf (pkg));
+ Vala.Report.error (null, "Package `%s' not found in specified Vala API directories or GObject-Introspection GIR directories", pkg);
return false;
}
dep = dep.strip ();
if (dep != "") {
if (!add_package (context, dep)) {
- Vala.Report.error (null, "%s, dependency of %s, not found in specified Vala API directories".printf (dep, pkg_name));
+ Vala.Report.error (null, "`%s', dependency of `%s', not found in specified Vala API directories", dep, pkg_name);
}
}
}
} catch (FileError e) {
- Vala.Report.error (null, "Unable to read dependency file: %s".printf (e.message));
+ Vala.Report.error (null, "Unable to read dependency file: %s", e.message);
}
}
}
private void add_depencies (Vala.CodeContext context, string[] packages) {
foreach (string package in packages) {
if (!add_package (context, package)) {
- Vala.Report.error (null, "Package `%s' not found in specified Vala API directories or GObject-Introspection GIR directories".printf (package));
+ Vala.Report.error (null, "Package `%s' not found in specified Vala API directories or GObject-Introspection GIR directories", package);
}
}
}
context.add_c_source_file (rpath);
tree.add_external_c_files (rpath);
} else {
- Vala.Report.error (null, "%s is not a supported source file type. Only .vala, .vapi, .gs, and .c files are supported.".printf (source));
+ Vala.Report.error (null, "%s is not a supported source file type. Only .vala, .vapi, .gs, and .c files are supported.", source);
}
} else {
- Vala.Report.error (null, "%s not found".printf (source));
+ Vala.Report.error (null, "%s not found", source);
}
}
}
codenode_attributes_map[tokens[0]] = tokens[1];
}
} catch (FileError e) {
- Report.error (null, "Unable to read metadata file: %s".printf (e.message));
+ Report.error (null, "Unable to read metadata file: %s", e.message);
}
}
}
}
} catch (MarkupError e) {
- Report.error (null, "Unable to parse GIDL file: %s".printf (e.message));
+ Report.error (null, "Unable to parse GIDL file: %s", e.message);
}
}
if (symbol.length > 0 && !_symbols.contains (symbol)) {
var src = new SourceReference (metadata, SourceLocation (null, lineno, 1), SourceLocation (null, lineno, (int)symbol.length));
- Report.error (src, "Symbol `%s' not found".printf (symbol));
+ Report.error (src, "Symbol `%s' not found", symbol);
}
lineno += 1;
return 0;
} catch (Error error) {
- Report.error (null, "%s: %s".printf (metadata.filename, error.message));
+ Report.error (null, "%s: %s", metadata.filename, error.message);
return 1;
}
}
public int run () {
if (!FileUtils.test (gidl.filename, FileTest.IS_REGULAR)) {
- Report.error (null, "%s not found".printf (gidl.filename));
+ Report.error (null, "%s not found", gidl.filename);
return 2;
}
if (!FileUtils.test (metadata.filename, FileTest.IS_REGULAR)) {
- Report.error (null, "%s not found".printf (metadata.filename));
+ Report.error (null, "%s not found", metadata.filename);
return 2;
}
source_file.from_commandline = true;
context.add_source_file (source_file);
} else {
- Report.error (null, "%s not found".printf (source));
+ Report.error (null, "%s not found", source);
}
}
var library_name = Path.get_basename (library);
if (package_names.length > 0 && !(library_name in package_names)) {
- Report.warning (null, "Given library name `%s' does not match pkg-config name `%s'".printf (library_name, string.join ("', `", package_names)));
+ Report.warning (null, "Given library name `%s' does not match pkg-config name `%s'", library_name, string.join ("', `", package_names));
}
var interface_writer = new CodeWriter (CodeWriterType.VAPIGEN);