diff --git a/src/script_opt/CPP/RuntimeInitSupport.cc b/src/script_opt/CPP/RuntimeInitSupport.cc index 2ae4b9c2fd..3c5c1b06c6 100644 --- a/src/script_opt/CPP/RuntimeInitSupport.cc +++ b/src/script_opt/CPP/RuntimeInitSupport.cc @@ -110,6 +110,12 @@ void activate_bodies__CPP(const char* fn, const char* module, bool exported, Typ fg->SetType(ft); } + if ( ! fg->GetType() ) + // This can happen both because we just installed the ID, but also + // because events registered by Spicy don't have types associated + // with them initially. + fg->SetType(ft); + if ( ! fg->GetAttr(ATTR_IS_USED) ) fg->AddAttr(make_intrusive(ATTR_IS_USED)); @@ -175,6 +181,9 @@ IDPtr lookup_global__CPP(const char* g, const TypePtr& t, const GlobalCharacteri gl->MakeType(); } + else if ( ! gl->GetType() ) + gl->SetType(t); + return gl; }