Files
kotlin-fork/idea/testData/codeInsight/outOfBlock/InLambdaFunction.kt
T
2019-11-27 13:43:10 +01:00

17 lines
336 B
Kotlin
Vendored

// OUT_OF_CODE_BLOCK: FALSE
// TYPE: t
fun CharSequence.repeat(n: Int): String {
val sb = StringBuilder(n * length)
for (i in 1..n) {
sb.append(this)
}
return sb.toString()
}
fun twice(s: String): String {
val repeatFun: String.(Int) -> String = { t -> this.repeat(<caret>) }
return repeatFun(s, 2)
}