fold<R> method
R
fold<R>(
- R match1(
- T1
- R match2(
- T2
- R match3(
- T3
- R match4(
- T4
Implementation
R fold<R>(
R Function(T1) match1,
R Function(T2) match2,
R Function(T3) match3,
R Function(T4) match4,
) {
switch (_discriminator) {
case 0:
return match1(_value1 as T1);
case 1:
return match2(_value2 as T2);
case 2:
return match3(_value3 as T3);
default:
return match4(_value4 as T4);
}
}