private static void CheckTypeEquality(TypeReference a, TypeReference b) { // todo: better check, e.g. for inherited classes or generics if (!a.SafeEquals(b)) throw new InvalidOperationException("return type does not match"); }