mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Deprecate Scope::ScopeID(), replace with GetID()
This commit is contained in:
parent
8b6de5852c
commit
b0c95e30d0
3 changed files with 9 additions and 5 deletions
|
@ -881,7 +881,7 @@ function_ingredients::function_ingredients(IntrusivePtr<Scope> scope, IntrusiveP
|
|||
inits = scope->GetInits();
|
||||
|
||||
this->scope = std::move(scope);
|
||||
id = {NewRef{}, this->scope->ScopeID()};
|
||||
id = this->scope->GetID();
|
||||
|
||||
const auto& attrs = this->scope->Attrs();
|
||||
|
||||
|
|
|
@ -35,8 +35,12 @@ public:
|
|||
|
||||
IntrusivePtr<ID> Remove(std::string_view name);
|
||||
|
||||
[[deprecated("Remove in v4.1. Use GetID().")]]
|
||||
ID* ScopeID() const { return scope_id.get(); }
|
||||
|
||||
const IntrusivePtr<ID>& GetID() const
|
||||
{ return scope_id; }
|
||||
|
||||
const std::unique_ptr<std::vector<IntrusivePtr<Attr>>>& Attrs() const
|
||||
{ return attrs; }
|
||||
|
||||
|
|
|
@ -1414,21 +1414,21 @@ ReturnStmt::ReturnStmt(IntrusivePtr<Expr> arg_e)
|
|||
{
|
||||
Scope* s = current_scope();
|
||||
|
||||
if ( ! s || ! s->ScopeID() )
|
||||
if ( ! s || ! s->GetID() )
|
||||
{
|
||||
Error("return statement outside of function/event");
|
||||
return;
|
||||
}
|
||||
|
||||
FuncType* ft = s->ScopeID()->GetType()->AsFuncType();
|
||||
FuncType* ft = s->GetID()->GetType()->AsFuncType();
|
||||
const auto& yt = ft->Yield();
|
||||
|
||||
if ( s->ScopeID()->DoInferReturnType() )
|
||||
if ( s->GetID()->DoInferReturnType() )
|
||||
{
|
||||
if ( e )
|
||||
{
|
||||
ft->SetYieldType(e->GetType());
|
||||
s->ScopeID()->SetInferReturnType(false);
|
||||
s->GetID()->SetInferReturnType(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue