(vec Any, slot uint32)
| 45 | } |
| 46 | |
| 47 | func IntValue(vec Any, slot uint32) int64 { |
| 48 | switch vec := Under(vec).(type) { |
| 49 | case *Int: |
| 50 | return vec.Value(slot) |
| 51 | case *Const: |
| 52 | return IntValue(vec.Any, 0) |
| 53 | case *Dict: |
| 54 | return IntValue(vec.Any, uint32(vec.Index[slot])) |
| 55 | case *Dynamic: |
| 56 | tag := vec.Tags[slot] |
| 57 | return IntValue(vec.Values[tag], vec.ForwardTagMap()[slot]) |
| 58 | case *View: |
| 59 | return IntValue(vec.Any, vec.Index[slot]) |
| 60 | } |
| 61 | panic(vec) |
| 62 | } |