fork download
  1. import java.util.*
  2.  
  3. fun main(args: Array<String>) {
  4. println("aaaab".replace("b",fun(mr:MatchResult):CharSequence{return "x"}))
  5. }
Compilation error #stdin compilation error #stdout 0.1s 2181120KB
stdin
Standard input is empty
compilation info
JNA Warning: IOException removing temporary files: JNA temporary directory '/tmp' is not writable
prog.kt:4:21: error: none of the following functions can be called with the arguments supplied: 
@InlineOnly public inline fun CharSequence.replace(regex: Regex, noinline transform: (MatchResult) -> CharSequence): String defined in kotlin.text
@InlineOnly public inline fun CharSequence.replace(regex: Regex, replacement: String): String defined in kotlin.text
public fun String.replace(oldChar: Char, newChar: Char, ignoreCase: Boolean = ...): String defined in kotlin.text
public fun String.replace(oldValue: String, newValue: String, ignoreCase: Boolean = ...): String defined in kotlin.text
    println("aaaab".replace("b",fun(mr:MatchResult):CharSequence{return "x"}))
                    ^
stdout
Standard output is empty