mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 23:28:20 +00:00
change vector constructors to require direct type equivalence for non-arithmetics
This commit is contained in:
parent
c1e5389929
commit
47152e38c4
5 changed files with 63 additions and 12 deletions
13
src/Type.h
13
src/Type.h
|
@ -923,15 +923,10 @@ 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 a (ref'd) type reflecting
|
||||
// a merged type consistent across all of them, or nil if this
|
||||
// cannot be done.
|
||||
TypePtr merge_type_list(detail::ListExpr* elements);
|
||||
// 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.
|
||||
TypePtr maximal_type(detail::ListExpr* elements);
|
||||
|
||||
// Given an expression, infer its type when used for an initialization.
|
||||
TypePtr init_type(const detail::ExprPtr& init);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue