MapTypeArgs returns the type arguments of a MapType.
(tpe ast.BaseTerm)
| 169 | |
| 170 | // MapTypeArgs returns the type arguments of a MapType. |
| 171 | func MapTypeArgs(tpe ast.BaseTerm) (ast.BaseTerm, ast.BaseTerm, error) { |
| 172 | if debug && !IsMapTypeExpression(tpe) { |
| 173 | return nil, nil, fmt.Errorf("not a map type expression: %v", tpe) |
| 174 | } |
| 175 | args := typeArgs(tpe) |
| 176 | return args[0], args[1], nil |
| 177 | } |
| 178 | |
| 179 | // IsOptional returns true if an argument of fn:Struct is an optional field. |
| 180 | func IsOptional(structElem ast.BaseTerm) bool { |