Immutable Function Parameters With Kotlin 1.1

I think, what you are referring to is called “final” or “non-final” parameter. function parameters in Kotlin have been always “final”. meaning one cannot re-assign them within function.

mutability or immutability depends on how the type (class) is defined. If the type is mutable, then you can in fact change it inside function. example:

data class Foo(var name: String)

fun muteFoo(f: Foo) {
    f.name = "Bar"
}

fun main(args: Array<String>) {
    val foo = Foo("Foo")
    println(foo)                              // prints Foo(name=Foo)

    muteFoo(foo)
    println(foo)                              // prints Foo(name=Bar)
}

in the above example, Foo is mutable and when is passed to a function like (muteFoo), its state can be altered.