AsMap returns the type underlying map if any, nil otherwise.
(dt DataType)
| 215 | |
| 216 | // AsMap returns the type underlying map if any, nil otherwise. |
| 217 | func AsMap(dt DataType) *Map { |
| 218 | switch t := dt.(type) { |
| 219 | case *UserTypeExpr: |
| 220 | return AsMap(t.Type) |
| 221 | case *ResultTypeExpr: |
| 222 | return AsMap(t.Type) |
| 223 | case *Map: |
| 224 | return t |
| 225 | default: |
| 226 | return nil |
| 227 | } |
| 228 | } |
| 229 | |
| 230 | // AsUnion returns the type underlying union if any, nil otherwise. |
| 231 | func AsUnion(dt DataType) *Union { |
no outgoing calls