mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-13 08:31:31 +00:00
14 lines
258 B
Kotlin
Vendored
14 lines
258 B
Kotlin
Vendored
package com.myapp
|
|
|
|
import android.content.Context
|
|
|
|
fun foo(context: Context) {
|
|
with (context) {
|
|
with (2) {
|
|
getString(R.string.resource_id)
|
|
}
|
|
}
|
|
}
|
|
|
|
inline fun <T, R> with(receiver: T, block: T.() -> R): R = receiver.block()
|