title: Kotlin: single property with multiple setters of different types
body: <p>I'm trying to build a class that has a property of <code>LocalDate</code> type which has setters that accept different types: <code>LocalDate</code> or <code>String</code>. In case of <code>LocalDate</code>, the value gets assigned directly, in case of <code>String</code>, it gets parsed and then assigned.
  In Java, I just need to implement two overloaded setters handling both of above mentioned cases. But I have no idea how to handle that in Kotlin. I have tried this:</p>
  
  <pre><code>class SomeExampleClass(var _date: LocalDate) {
      var date = _date
          set(value) {
              when(value) {
                  is LocalDate -&gt; value
                  is String -&gt; LocalDate.parse(value)
              }
          }
  }
  </code></pre>
  
  <p>It doesn't compile. How can I resolve such a problem?</p>