title: Bad return type in method reference: cannot convert reactor.core.publisher.Mono<S> to reactor.core.publisher.Mono<? extends R>
body: <p>I have two <code>Mono</code>-s and I'd like to return/throw an exception if one wasn't empty (the user already exists), or return a <code>Mono&lt;User&gt;</code> value based on the other one (copy settings and DTO data to User object). I wrote:</p>
  
  <pre><code>public Mono&lt;User&gt; registerUser(UserRegistrationDto userRegistrationDto) {
          Mono&lt;Settings&gt; settingsMono = settingsService.getSettings();
          Mono&lt;User&gt; dbUserMono = userRepository.findByEmail(userRegistrationDto.getEmail());
      return dbUserMono.map(dbUser -&gt; Mono.error(new AlreadyRegisteredException())).or(
                  settingsMono.map(
                      settings -&gt; validateDtoAndCreateUser(userRegistrationDto, settings)
                  ).flatMap(userRepository::save)
              );
  </code></pre>
  
  <p>The userRepository is a Spring Data ReactiveMongoRepository. The validateDtoAndCreateUser's signature is: <code>private User validateDtoAndCreateUser(UserRegistrationDto userRegistrationDto, SiteSettings siteSettings)</code></p>
  
  <p>Unfortunately at <code>userRepository::save</code> I'm getting:</p>
  
  <pre><code>Bad return type in method reference: cannot convert reactor.core.publisher.Mono&lt;S&gt; to reactor.core.publisher.Mono&lt;? extends R&gt;
  </code></pre>
  
  <p>What am I doing wrong? Am I using a bad operator somewhere?</p>