Commit faa7dc16 authored by Timm Bäder's avatar Timm Bäder 👎 Committed by Rico Tzschichholz

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
parent 3e15a871
......@@ -342,7 +342,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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment