decodeTypeDef method

dynamic decodeTypeDef(
  1. TypeDef def,
  2. Input input
)

Implementation

dynamic decodeTypeDef(TypeDef def, Input input) {
  return switch (def) {
    final TypeDefComposite def => decodeComposite(def, input),
    final TypeDefSequence def => decodeSequence(def, input),
    final TypeDefTuple def => decodeTuple(def, input),
    final TypeDefArray def => decodeArray(def, input),
    final TypeDefPrimitive def => decodePrimitive(def.primitive, input),
    _ => throw Exception('TypeDef not supported: ${def.runtimeType}'),
  };
}