Skip to content

Commit 53b0559

Browse files
authored
chore: update implicit this expression sample (#4552)
1 parent 4f461b5 commit 53b0559

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

docs/topics/this-expressions.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ If you have a non-member function with the same name, use this with caution beca
4545

4646
```kotlin
4747
fun main() {
48-
//sampleStart
49-
fun printLine() { println("Top-level function") }
48+
fun printLine() { println("Local function") }
5049

5150
class A {
5251
fun printLine() { println("Member function") }
@@ -58,8 +57,7 @@ fun main() {
5857
}
5958

6059
A().invokePrintLine() // Member function
61-
A().invokePrintLine(omitThis = true) // Top-level function
62-
//sampleEnd()
60+
A().invokePrintLine(omitThis = true) // Local function
6361
}
6462
```
6563
{kotlin-runnable="true" kotlin-min-compiler-version="1.3"}

0 commit comments

Comments
 (0)