Pattern은 검사·binding·deconstruction을 한 성공 경로로 묶는다

type 검사 뒤 cast와 getter를 반복하면 검사한 값과 사용하는 값 사이의 연결을 사람이 유지해야 합니다.

  1. 1

    input value

    Object·sealed root

  2. 2

    type test

    Post인가

  3. 3

    binding

    post 이름 생성

  4. 4

    deconstruct

    title·viewCount 추출

  5. 5

    case body

    검증된 값 사용

핵심: pattern이 일치한 분기 안에서만 bound value와 record component를 사용합니다.