Goose  Diff

Differences From Artifact [a0059f68ce]:

  • File bs/builtins/statements/using.cpp — part of check-in [baf9721752] at 2019-08-19 13:43:31 on branch trunk —
    • Fixed many issues with compile time versus run time function invocations.
    • Improved some error messages.
    (user: achavasse size: 6259)

To Artifact [45f6f2ab59]:

  • File bs/builtins/statements/using.cpp — part of check-in [e38aee1ca0] at 2019-08-22 13:23:16 on branch trunk — You have failed me for the last time, CMake. (user: achavasse size: 6215)

79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
            // Create a local identity for the constant, from which the current identity will be visible.
            // This is to avoid anything declared from within the using expression to leak outside,
            // and also to make sure that whenever it will be parsed, it will have access to the current
            // context in which it has been declared.
            auto localIdentity = AppendToVectorTerm( InjectDomainIntoIdentity( context.identity(), ANYTERM( _ ) ), nameTerm->first );
            context.env()->addVisibilityRule( InjectDomainIntoIdentity( context.identity(), ANYTERM( _ ) ), localIdentity );

            auto nameSid = *name;
            auto nameLoc = nameTerm->second;

            bool bInUse = false;

            auto loc = Location::CreateSpanningLocation( locationId, nameLoc );

            auto UsingValProvider = [toks, localIdentity, bInUse, nameSid, loc]( Env& e, const Term& identity, const Term& contextId, Term& result ) mutable
            {
                auto& dm = DiagnosticsManager::GetInstance();

                // In case of errors, we poison the result so that code invoking
                // this using expression will not emit cascading errors.
                if( bInUse )
                {







<

<




|







79
80
81
82
83
84
85

86

87
88
89
90
91
92
93
94
95
96
97
98
            // Create a local identity for the constant, from which the current identity will be visible.
            // This is to avoid anything declared from within the using expression to leak outside,
            // and also to make sure that whenever it will be parsed, it will have access to the current
            // context in which it has been declared.
            auto localIdentity = AppendToVectorTerm( InjectDomainIntoIdentity( context.identity(), ANYTERM( _ ) ), nameTerm->first );
            context.env()->addVisibilityRule( InjectDomainIntoIdentity( context.identity(), ANYTERM( _ ) ), localIdentity );


            auto nameLoc = nameTerm->second;

            bool bInUse = false;

            auto loc = Location::CreateSpanningLocation( locationId, nameLoc );

            auto UsingValProvider = [toks, localIdentity, bInUse, loc]( Env& e, const Term& identity, const Term& contextId, Term& result ) mutable
            {
                auto& dm = DiagnosticsManager::GetInstance();

                // In case of errors, we poison the result so that code invoking
                // this using expression will not emit cascading errors.
                if( bInUse )
                {