(typ super.Type)
| 89 | type encoder map[super.Type]zType |
| 90 | |
| 91 | func (e encoder) encodeType(typ super.Type) zType { |
| 92 | t, ok := e[typ] |
| 93 | if !ok { |
| 94 | t = e.newType(typ) |
| 95 | id := super.TypeID(typ) |
| 96 | if id < super.IDTypeComplex { |
| 97 | e[typ] = t |
| 98 | } else { |
| 99 | e[typ] = &zRef{ |
| 100 | Kind: "ref", |
| 101 | ID: id, |
| 102 | } |
| 103 | } |
| 104 | } |
| 105 | return t |
| 106 | } |
| 107 | |
| 108 | func (e encoder) newType(typ super.Type) zType { |
| 109 | switch typ := typ.(type) { |
no test coverage detected