Could someone help me solve the TODO line in the code below?
fun printLine() {
println("Package-level function outside main")
}
fun main() {
fun printLine() {
println("Top-level function inside main")
}
class A {
fun printLine() {
println("Member function A")
}
inner class B {
fun printLine() {
println("Member function B")
}
fun invokePrintLine() {
// TODO: how to call printLine to print "Package-level function outside main"
printLine() // Top-level function inside main
this@A.printLine() // Member function A (label)
this.printLine() // Member function B (closest)
}
}
}
A().B().invokePrintLine()
}