when<_T> method
_T
when<_T>({})
Implementation
_T when<_T>({
required _T Function(String ref) ref,
required _T Function(T value) single,
required _T Function(List<CompVal<T>> values) list,
}) {
final v = this;
if (v is CompValueRef<T>) {
return ref(v.ref);
} else if (v is CompValueSingle<T>) {
return single(v.value);
} else if (v is CompValueList<T>) {
return list(v.values);
}
throw Exception();
}