Hello! I'm trying to do some strange thing: compile some Statement (do semantic3 phase) in the scope of other function.
Other function is for example:

auto megafunction()
{
    B b;
    uint a = 25;
    return b;
}

AST of this code looks like:

FuncDeclaration
{
    fbody = CompoundStatement
    {
         ExpStatement
         {
             exp = DeclarationExp
         }
         ExpStatement
         {
             exp = DeclarationExp
         }
         ReturnStatement;
    }
}

So if I'm trying to take fbody._scope, all works correctly (other functions and templates from this module are declared), but neither a nor b are declared in this scope.
But exp.declaration._scope is null.

So how to get scope e.g. after line "B b;"?

Reply via email to