ScopeView newScope = null;
if (isLocalImport) {
// we need to copy the whole tree, because this runs inside referenced mixin scope
// snapshot and imported mixin needs to remember the scope as it is now
newScope = ScopeFactory.createJoinedScopesView(null, mixinToImport.getScope());
newScope.saveLocalDataForTheWholeWayUp();
} else {
// since this is non-local import, we need to join reference scope and imported mixins scope
// imported mixin needs to have access to variables defined in caller
newScope = ScopeFactory.createJoinedScopesView(calleeScope, mixinToImport.getScope());
newScope.saveLocalDataForTheWholeWayUp();