From 64b72f3760106f427650f44dfe2e6fa76d7d59f0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timm=20B=C3=A4der?= Date: Sat, 5 Nov 2016 14:02:16 +0100 Subject: [PATCH] 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 --- vala/valamethod.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.47.2