fold<R> method

R fold<R>(
  1. R match1(
    1. T1
    ),
  2. R match2(
    1. T2
    )
)

Implementation

R fold<R>(R Function(T1) match1, R Function(T2) match2) {
  switch (_discriminator) {
    case 0:
      return match1(_value1 as T1);
    default:
      return match2(_value2 as T2);
  }
}