mirror of
https://github.com/zeek/zeek.git
synced 2025-10-14 20:48:21 +00:00
Add is_atomic_type() overloads for IntrusivePtr
This commit is contained in:
parent
6a1c312451
commit
457c08f531
4 changed files with 10 additions and 6 deletions
|
@ -606,10 +606,10 @@ SwitchStmt::SwitchStmt(IntrusivePtr<Expr> index, case_list* arg_cases)
|
|||
{
|
||||
have_exprs = true;
|
||||
|
||||
if ( ! is_atomic_type(e->GetType().get()) )
|
||||
if ( ! is_atomic_type(e->GetType()) )
|
||||
e->Error("switch expression must be of an atomic type when cases are expressions");
|
||||
|
||||
if ( ! le->GetType()->AsTypeList()->AllMatch(e->GetType().get(), false) )
|
||||
if ( ! le->GetType()->AsTypeList()->AllMatch(e->GetType(), false) )
|
||||
{
|
||||
le->Error("case expression type differs from switch type", e.get());
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue