How does Kotlin property access syntax work for Java classes (i.e. EditText setText)?
<p>I'm trying to switch my Android project to Kotlin. I have an <code>EditText</code> (a subclass of <code>TextView</code>) for which I want to set a hint and text programmatically. The hint works as expected. For text, though, I'm getting a type mismatch exception if I try to do it using Kotlin setter syntax:</p>

<pre><code>    val test = EditText(context)

    test.setHint("hint")    // Lint message: "Use property access syntax"
    test.hint = "hint"      // ok

    test.setText("text")    // ok (no lint message)
    test.text = "text"      // Type mismatch: inferred type is kotlin.String but android.text.Editable! was expected
</code></pre>

<p>If we look at the declaration, we'll find identical signatures inherited from <code>TextView</code>:</p>

<pre><code>    public final void setHint(CharSequence hint)

    public final void setText(CharSequence text)
</code></pre>

<p>I had an impression that <code>x.y = z</code> was a shortcut for <code>x.setY(z)</code> but apparently that impression was wrong. <code>setText()</code> is treated as a normal method rather than a setter, but what's the difference between these two methods that makes the compiler behave differently? The only one I can think of is that <code>TextView</code> has an <code>mHint</code> property but I don't think it might be the case.</p>

<p>Another thing I don't quite understand is, where does <code>android.text.Editable</code> come from? There is no corresponding <code>setText(Editable)</code> method, nor is there a public field of this type.</p>