diff --git a/src/Type.cc b/src/Type.cc index c6029489b5..bb67b2fbbe 100644 --- a/src/Type.cc +++ b/src/Type.cc @@ -63,11 +63,6 @@ const char* type_name(TypeTag t) return type_names[int(t)]; } -// Given two types, returns the "merge", in which promotable types -// are promoted to the maximum of the two. Returns nil (and generates -// an error message) if the types are incompatible. -static TypePtr merge_types(const TypePtr& t1, const TypePtr& t2); - Type::Type(TypeTag t, bool arg_base_type) : tag(t), internal_tag(to_internal_type_tag(tag)), is_network_order(zeek::is_network_order(t)), base_type(arg_base_type) @@ -2696,7 +2691,7 @@ TypePtr maximal_type(detail::ListExpr* elements) for ( size_t i = 1; t && i < tl.size(); ++i ) { - auto& tl_i = tl[i]; + const auto& tl_i = tl[i]; if ( t == tl_i ) continue; diff --git a/src/Type.h b/src/Type.h index 96517a7727..d775207637 100644 --- a/src/Type.h +++ b/src/Type.h @@ -923,6 +923,11 @@ extern Type* flatten_type(Type* t); // Returns the "maximum" of two type tags, in a type-promotion sense. extern TypeTag max_type(TypeTag t1, TypeTag t2); +// Given two types, returns the "merge", in which promotable types +// are promoted to the maximum of the two. Returns nil (and generates +// an error message) if the types are incompatible. +TypePtr merge_types(const TypePtr& t1, const TypePtr& t2); + // Given a list of expressions, returns the maximal type consistent across // all of them, or nil if this cannot be done. "Maximal" incorporates // notions of arithmetic coercion, but otherwise requires type-equivalence.