Created
July 18, 2018 08:42
-
-
Save sajjadyousefnia/0bf0868731861bcfe4340528e2b5b3ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A { // implicit label @A | |
inner class B { // implicit label @B | |
fun Int.foo() { // implicit label @foo | |
val a = this@A // A's this | |
val b = this@B // B's this | |
val c = this // foo()'s receiver, an Int | |
val c1 = this@foo // foo()'s receiver, an Int | |
val funLit = lambda@ fun String.() { | |
val d = this // funLit's receiver | |
} | |
val funLit2 = { s: String -> | |
// foo()'s receiver, since enclosing lambda expression | |
// doesn't have any receiver | |
val d1 = this | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment