class X(val v: Int) { } fun X.f1() { println("foo()") println("Value: $v") } fun f2(x: X) { println("foo()") println("Value: ${x.v}") }