Lambda와 anonymous this
함수 body가 어느 객체를 receiver로 보는지 구분한다.
| 형태 | this | Capture |
|---|---|---|
| lambda | 둘러싼 owner | owner lifetime |
| anonymous class | 새 함수 객체 | Outer.this 별도 |
| static reference | receiver 없음 | capture 없음 |
| bound reference | 특정 instance | receiver capture |
핵심: scope 차이는 field lookup뿐 아니라 callback 보관 수명에도 영향을 준다.