    case let .structLiteral(s):
      return s.freeTypeVariables
    case let .switch(s):
      return s.freeTypeVariables
    }
  }
}

extension Expr: TypeSubstitutable where A == TypeAnnotation {
  func apply(_ sub: TypeSubstitution) -> Expr<TypeAnnotation> {
    .init(payload: payload.apply(sub), annotation: annotation.apply(sub))
  }
