(sctx *super.Context, val *ast.Error, cast super.Type)
| 562 | } |
| 563 | |
| 564 | func (a Analyzer) convertError(sctx *super.Context, val *ast.Error, cast super.Type) (Value, error) { |
| 565 | var inner super.Type |
| 566 | if cast != nil { |
| 567 | typ, ok := super.TypeUnder(cast).(*super.TypeError) |
| 568 | if !ok { |
| 569 | return nil, errors.New("error decorator not of type error") |
| 570 | } |
| 571 | inner = typ.Type |
| 572 | } |
| 573 | under, err := a.convertValue(sctx, val.Value, inner) |
| 574 | if err != nil { |
| 575 | return nil, err |
| 576 | } |
| 577 | if cast == nil { |
| 578 | cast = sctx.LookupTypeError(under.TypeOf()) |
| 579 | } |
| 580 | return &Error{ |
| 581 | Value: under, |
| 582 | Type: cast, |
| 583 | }, nil |
| 584 | } |
| 585 | |
| 586 | func (a Analyzer) convertFusion(sctx *super.Context, val *ast.Fusion, cast super.Type) (Value, error) { |
| 587 | var inner super.Type |
no test coverage detected