Skip to content

Instantly share code, notes, and snippets.

@dkwasniak
Created July 14, 2022 09:30
Show Gist options
  • Save dkwasniak/6d02d3bd0d25b45d5d3e11bddf419394 to your computer and use it in GitHub Desktop.
Save dkwasniak/6d02d3bd0d25b45d5d3e11bddf419394 to your computer and use it in GitHub Desktop.

Revisions

  1. dkwasniak created this gist Jul 14, 2022.
    26 changes: 26 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    fun nonInlined(block: () -> Unit) {
    println("before")
    block()
    println("after")
    }

    inline fun inlined(block: () -> Unit) {
    println("before")
    block()
    println("after")
    }

    inline fun inlined() {
    println("test")
    }

    #############################

    fun <T> doSomething(value: T) {
    println("Doing something with value: $value")
    }

    fun <T> doSomething1(value: T) {
    println("Doing something with type: ${T::class.simpleName}")
    }