Figure out what the cast should be for the elements and for the union conversion if any.
(cast super.Type)
| 354 | |
| 355 | // Figure out what the cast should be for the elements and for the union conversion if any. |
| 356 | func arrayElemCast(cast super.Type) (super.Type, error) { |
| 357 | if cast == nil { |
| 358 | return nil, nil |
| 359 | } |
| 360 | if arrayType, ok := super.TypeUnder(cast).(*super.TypeArray); ok { |
| 361 | return arrayType.Type, nil |
| 362 | } |
| 363 | return nil, errors.New("array decorator not of type array") |
| 364 | } |
| 365 | |
| 366 | func (a Analyzer) convertArray(sctx *super.Context, array *ast.Array, cast super.Type) (Value, error) { |
| 367 | vals := make([]Value, 0, len(array.Elements)) |
no test coverage detected