title: Passing StringBuilder::append as argument in Kotlin
body: <p>I'm using <a href="https://github.com/NovaCrypto/BIP39#generate-a-mnemonic" rel="nofollow noreferrer">BIP39 plugin</a> for Java to create a mnemonic.
  So I've converted (well mostly IDEA did) <a href="https://github.com/NovaCrypto/BIP39#generate-a-mnemonic" rel="nofollow noreferrer">this Java code</a> to a function in Kotlin syntax which looks like this:</p>
  <pre class="lang-kotlin prettyprint-override"><code>fun mnemonicBuilder(): String {
    val sb = StringBuilder()
    val entropy = ByteArray(Words.TWELVE.byteLength())
    SecureRandom().nextBytes(entropy)
    MnemonicGenerator(English.INSTANCE)
        .createMnemonic(entropy, sb::append)
    return sb.toString()
  }
  </code></pre>
  <p>IntelliJ IDEA keeps telling me that &quot;<em><strong>None of the following functions can be called with the arguments supplied.</strong></em>&quot; for <strong>sb::append</strong>.</p>
  <p>My quess is that <a href="https://github.com/NovaCrypto/BIP39/blob/master/src/main/java/io/github/novacrypto/bip39/MnemonicGenerator.java#L78" rel="nofollow noreferrer">.createMnemonic requires</a> the second argument to have <a href="https://github.com/NovaCrypto/BIP39/blob/master/src/main/java/io/github/novacrypto/bip39/MnemonicGenerator.java#L45" rel="nofollow noreferrer">no return value (given by Target interface)</a> but all appenders return the StringBuilder as a value.</p>
  <p>Please, can somebody help me?</p>