if ((hint != FR_TYPE_NULL) && !fr_type_is_leaf(hint)) return invalid_type(hint);
+ /*
+ * Any operation on NULL types is itself a NULL type.
+ */
+ if ((a->type == FR_TYPE_NULL) || (b->type == FR_TYPE_NULL)) {
+ fr_value_box_init_null(dst);
+ return 0;
+ }
+
+ /*
+ * Casting to structural types should be a parse error,
+ * and not a run-time calculation error.
+ */
if (!fr_type_is_leaf(a->type)) return invalid_type(a->type);
if (!fr_type_is_leaf(b->type)) return invalid_type(b->type);