IsOptional returns true if an argument of fn:Struct is an optional field.
(structElem ast.BaseTerm)
| 178 | |
| 179 | // IsOptional returns true if an argument of fn:Struct is an optional field. |
| 180 | func IsOptional(structElem ast.BaseTerm) bool { |
| 181 | opt, ok := structElem.(ast.ApplyFn) |
| 182 | return ok && opt.Function.Symbol == Optional.Symbol |
| 183 | } |
| 184 | |
| 185 | // StructTypeRequiredArgs returns type arguments of a StructType. |
| 186 | func StructTypeRequiredArgs(tpe ast.BaseTerm) ([]ast.BaseTerm, error) { |
no outgoing calls
no test coverage detected