(typ *super.TypeRecord, bytes scode.Bytes, name string)
| 108 | } |
| 109 | |
| 110 | func derefWithNoneAndOk(typ *super.TypeRecord, bytes scode.Bytes, name string) (super.Type, scode.Bytes, bool, bool) { |
| 111 | n, ok := typ.IndexOfField(name) |
| 112 | if !ok { |
| 113 | return nil, nil, false, false |
| 114 | } |
| 115 | var elem scode.Bytes |
| 116 | var none bool |
| 117 | for i, it := 0, scode.NewRecordIter(bytes, typ.Opts); i <= n; i++ { |
| 118 | elem, none = it.Next(typ.Fields[i].Opt) |
| 119 | } |
| 120 | fieldType := typ.Fields[n].Type |
| 121 | if none { |
| 122 | return fieldType, nil, true, true |
| 123 | } |
| 124 | return fieldType, elem, false, true |
| 125 | |
| 126 | } |
| 127 | |
| 128 | func (u *Upcast) toArray(b *scode.Builder, typ super.Type, bytes scode.Bytes, to *super.TypeArray) bool { |
| 129 | if arrayType, ok := typ.(*super.TypeArray); ok { |
no test coverage detected