| 92 | } |
| 93 | |
| 94 | TypePtr resolveScalarFunctionType( |
| 95 | const std::string& name, |
| 96 | const std::vector<TypePtr>& argTypes, |
| 97 | bool nullOnFailure) { |
| 98 | auto returnType = resolveFunction(name, argTypes); |
| 99 | if (returnType) { |
| 100 | return returnType; |
| 101 | } |
| 102 | |
| 103 | if (nullOnFailure) { |
| 104 | return nullptr; |
| 105 | } |
| 106 | |
| 107 | auto allSignatures = getFunctionSignatures(); |
| 108 | auto it = allSignatures.find(name); |
| 109 | if (it == allSignatures.end()) { |
| 110 | BOLT_USER_FAIL("Scalar function doesn't exist: {}.", name); |
| 111 | } else { |
| 112 | const auto& functionSignatures = it->second; |
| 113 | BOLT_USER_FAIL( |
| 114 | "Scalar function signature is not supported: {}. Supported signatures: {}.", |
| 115 | toString(name, argTypes), |
| 116 | toString(functionSignatures)); |
| 117 | } |
| 118 | } |
| 119 | } // namespace bytedance::bolt::parse |