fun foo() {
var x = 21
bar()
println(2 * x)
}
fun bar() {
// imagine something very long nobody wants to read
}
fun main() {
foo()
}
var x = 21
fun foo() {
bar()
println(2 * x)
}
fun bar() {
// imagine something very long nobody wants to read
}
fun main() {
foo()
}
fun foo() {
var x = 21
fun bar() {
x = 1
}
bar()
println(2 * x)
}
fun main() {
foo()
}
class Thing {
var x = 21
fun foo() {
bar()
println(2 * x)
}
fun bar() {
x = 1
}
}
fun main() {
val myThing = Thing()
myThing.foo()
}
class Thing {
var x = 21
var y = 2
fun foo() {
bar()
println(y * x)
}
fun bar() {
println(y)
}
}
fun main() {
val myThing = Thing()
myThing.foo()
}
class Thing {
var x = 21
var y = 2
fun foo() {
bar(y)
println(y * x)
}
}
fun bar(y: Int) {
println(y)
}
fun main() {
val myThing = Thing()
myThing.foo()
}
class Thing {
var x = 21
var y = 2
fun foo() {
bar(y)
println(y * x)
}
companion object {
fun bar(y: Int) {
println(y)
}
}
}
fun main() {
val myThing = Thing()
myThing.foo()
}
class Thing {
var x = 21
var y = 2
var z = 3
}
fun foo(x: Int, y: Int) {
bar(y)
println(y * x)
}
fun bar(y: Int) {
println(y)
}
fun main() {
val myThing = Thing()
foo(myThing.x, myThing.y)
}