From: Timm Bäder Date: Sat, 5 Nov 2016 13:02:16 +0000 (+0100) Subject: method: Print encountered type if return types mismatch X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64b72f3760106f427650f44dfe2e6fa76d7d59f0;p=thirdparty%2Fvala.git method: Print encountered type if return types mismatch If a class overrides a method of a base type, print both the encountered return type and the return type expected by the base class. https://bugzilla.gnome.org/show_bug.cgi?id=769501 --- diff --git a/vala/valamethod.vala b/vala/valamethod.vala index ec35e00b5..8f8c6391c 100644 --- a/vala/valamethod.vala +++ b/vala/valamethod.vala @@ -344,7 +344,7 @@ public class Vala.Method : Subroutine, Callable { var actual_base_type = base_method.return_type.get_actual_type (object_type, method_type_args, this); if (!return_type.equals (actual_base_type)) { - invalid_match = "incompatible return type"; + invalid_match = "Base method expected return type `%s', but `%s' was provided".printf (actual_base_type.to_qualified_string (), return_type.to_qualified_string ()); return false; }