Checks type of 'return' is consistent with method's type.