(ext *super.TypeUnion)
| 117 | } |
| 118 | |
| 119 | func (e *Encoder) encodeTypeUnion(ext *super.TypeUnion) (super.Type, error) { |
| 120 | var types []super.Type |
| 121 | for _, t := range ext.Types { |
| 122 | t, err := e.Encode(t) |
| 123 | if err != nil { |
| 124 | return nil, err |
| 125 | } |
| 126 | types = append(types, t) |
| 127 | } |
| 128 | typ := e.sctx.LookupTypeUnion(types) |
| 129 | e.bytes = append(e.bytes, TypeDefUnion) |
| 130 | e.bytes = binary.AppendUvarint(e.bytes, uint64(len(types))) |
| 131 | for _, t := range types { |
| 132 | e.bytes = binary.AppendUvarint(e.bytes, uint64(super.TypeID(t))) |
| 133 | } |
| 134 | return typ, nil |
| 135 | } |
| 136 | |
| 137 | func (e *Encoder) encodeTypeSet(ext *super.TypeSet) (*super.TypeSet, error) { |
| 138 | inner, err := e.Encode(ext.Type) |
no test coverage detected