From: Rico Tzschichholz Date: Sat, 8 Apr 2023 13:50:53 +0000 (+0200) Subject: vala: Improve error message for wrong number of type-arguments X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bed64669cac1af13ef66736cff8d301865233de8;p=thirdparty%2Fvala.git vala: Improve error message for wrong number of type-arguments --- diff --git a/vala/valadatatype.vala b/vala/valadatatype.vala index 9f612fa17..a7ba03856 100644 --- a/vala/valadatatype.vala +++ b/vala/valadatatype.vala @@ -693,11 +693,11 @@ public abstract class Vala.DataType : CodeNode { if ((!allow_none || n_type_args > 0) && n_type_args < expected_n_type_args) { error = true; - Report.error (source_reference, "too few type arguments for `%s'", type_symbol.get_full_name ()); + Report.error (source_reference, "too few type arguments for `%s'", type_symbol.to_string ()); return false; } else if ((!allow_none || n_type_args > 0) && n_type_args > expected_n_type_args) { error = true; - Report.error (source_reference, "too many type arguments for `%s'", type_symbol.get_full_name ()); + Report.error (source_reference, "too many type arguments for `%s'", type_symbol.to_string ()); return false; } diff --git a/vala/valamethodcall.vala b/vala/valamethodcall.vala index 75bf6b3a1..7333891b4 100644 --- a/vala/valamethodcall.vala +++ b/vala/valamethodcall.vala @@ -379,11 +379,11 @@ public class Vala.MethodCall : Expression, CallableExpression { int n_type_args = ma.get_type_arguments ().size; if (n_type_args > 0 && n_type_args < n_type_params) { error = true; - Report.error (ma.source_reference, "too few type arguments"); + Report.error (ma.source_reference, "too few type arguments for `%s'", m.to_string ()); return false; } else if (n_type_args > 0 && n_type_args > n_type_params) { error = true; - Report.error (ma.source_reference, "too many type arguments"); + Report.error (ma.source_reference, "too many type arguments for `%s'", m.to_string ()); return false; } }