diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2020-10-26 16:10:37 +0100 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2020-10-26 16:10:37 +0100 |
commit | 1d78426a2b172f0b0ba2f04d1f5c51ad75c82ef5 (patch) | |
tree | 7f82f8eed0a1590ecbb830d575ee0f092a2e433e /vala/valaforeachstatement.vala | |
parent | 545121d1322d3f73880b3f14d86d3d7bd976e664 (diff) | |
download | vala-1d78426a2b172f0b0ba2f04d1f5c51ad75c82ef5.tar.gz |
vala: Make use of new printf-like API of Report.*()
Diffstat (limited to 'vala/valaforeachstatement.vala')
-rw-r--r-- | vala/valaforeachstatement.vala | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/vala/valaforeachstatement.vala b/vala/valaforeachstatement.vala index 2c74773e8..da80b24aa 100644 --- a/vala/valaforeachstatement.vala +++ b/vala/valaforeachstatement.vala @@ -230,18 +230,18 @@ public class Vala.ForeachStatement : Block { 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; } @@ -253,13 +253,13 @@ public class Vala.ForeachStatement : Block { 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; } @@ -277,29 +277,29 @@ public class Vala.ForeachStatement : Block { 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; } @@ -315,7 +315,7 @@ public class Vala.ForeachStatement : Block { 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; } @@ -331,7 +331,7 @@ public class Vala.ForeachStatement : Block { 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; @@ -349,7 +349,7 @@ public class Vala.ForeachStatement : Block { 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; } |