title: Kotlin - How can i return different types from my method?
body: <p>I have this method.</p>
  
  <pre><code>    private fun getOffer(offers: OfferRepresentation, type: OfferType): ???? {
      return when (type) {
          OfferType.ADDON -&gt; offers.addon 
          OfferType.SALE -&gt; offers.sale
          OfferType.PLAN -&gt; offers.plan
          OfferType.CUSTOMPLAN -&gt; offers.customPlan
      }
  </code></pre>
  
  <p>How can i change this method to return the correct type?</p>