(rootNode *RootAssertionNode, expr ast.Expr)
| 799 | } |
| 800 | |
| 801 | func exprAsDeepProducer(rootNode *RootAssertionNode, expr ast.Expr) annotation.ProducingAnnotationTrigger { |
| 802 | _, parsedExpr := rootNode.ParseExprAsProducer(expr, true) |
| 803 | if len(parsedExpr) > 1 { |
| 804 | panic("multiply returning function passed where a deep producer is expected - tuple types are not deep") |
| 805 | } |
| 806 | if len(parsedExpr) == 0 || !parsedExpr[0].IsDeep() || parsedExpr[0].GetDeep() == nil { |
| 807 | // the expr is not deeply nilable |
| 808 | return &annotation.ProduceTriggerNever{} |
| 809 | } |
| 810 | return parsedExpr[0].GetDeep().Annotation |
| 811 | } |
| 812 | |
| 813 | // CheckGuardOnFullTrigger gives guarding its intended semantics: |
| 814 | // if a full trigger would be created with a guarded producer but |
no test coverage detected