익명 구현을 lambda로 바꾸기 전에 행동 계약을 확인한다

여러 method와 필드가 있는 익명 객체를 화살표 하나로 줄이면 원래 의미가 사라집니다.

  1. 1

    inspect

    정확히 하나의 SAM

  2. 2

    remove boilerplate

    class·method 껍질

  3. 3

    target type

    parameter·return 추론

  4. 4

    scope check

    this·이름 충돌

  5. 5

    lifetime check

    capture·registration

핵심: 변환 뒤 target type과 this·capture 의미가 유지되는지 확인합니다.