Finalize builds the default view if not explicitly defined and finalizes the underlying UserTypeExpr.
()
| 176 | // Finalize builds the default view if not explicitly defined and finalizes |
| 177 | // the underlying UserTypeExpr. |
| 178 | func (rt *ResultTypeExpr) Finalize() { |
| 179 | rt.useExplicitView() |
| 180 | rt.ensureDefaultView() |
| 181 | rt.UserTypeExpr.Finalize() |
| 182 | seen := make(map[string]struct{}) |
| 183 | walkAttribute(rt.AttributeExpr, func(_ string, att *AttributeExpr) error { // nolint: errcheck |
| 184 | if rt, ok := att.Type.(*ResultTypeExpr); ok { |
| 185 | if _, ok := seen[rt.Identifier]; !ok { |
| 186 | seen[rt.Identifier] = struct{}{} |
| 187 | rt.useExplicitView() |
| 188 | rt.ensureDefaultView() |
| 189 | } |
| 190 | } |
| 191 | return nil |
| 192 | }) |
| 193 | } |
| 194 | |
| 195 | // useExplicitView projects the result type using the view explicitly set on the |
| 196 | // attribute if any. |
nothing calls this directly
no test coverage detected