keep merge_types() externally available; address reviewing suggestion

This commit is contained in:
Vern Paxson 2022-11-23 11:32:27 -08:00
parent 47152e38c4
commit c4973706e0
2 changed files with 6 additions and 6 deletions

View file

@ -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.