| 850 | } |
| 851 | |
| 852 | TypePtr createType(TypeKind kind, std::vector<TypePtr>&& children) { |
| 853 | if (kind == TypeKind::FUNCTION) { |
| 854 | BOLT_USER_CHECK_GE( |
| 855 | children.size(), |
| 856 | 1, |
| 857 | "FUNCTION type should have at least one child type"); |
| 858 | std::vector<TypePtr> argTypes( |
| 859 | children.begin(), children.begin() + children.size() - 1); |
| 860 | return std::make_shared<FunctionType>(std::move(argTypes), children.back()); |
| 861 | } |
| 862 | |
| 863 | if (kind == TypeKind::UNKNOWN) { |
| 864 | BOLT_USER_CHECK_EQ( |
| 865 | children.size(), 0, "UNKNOWN type should not have child types"); |
| 866 | return UNKNOWN(); |
| 867 | } |
| 868 | return BOLT_DYNAMIC_TYPE_DISPATCH(createType, kind, std::move(children)); |
| 869 | } |
| 870 | |
| 871 | template <> |
| 872 | TypePtr createType<TypeKind::ROW>(std::vector<TypePtr>&& /*children*/) { |