private bool IsOutputOfProcessAffectedBySourceChange(
            Process process,
            ReadOnlyArray <AbsolutePath> dynamicallyObservedFiles)
        {
            // sourceChangeAffectedOutputFiles is initilized with the source change list.
            // If it is null, that means no file change for this build.
            // Thus no output is affected by the change.
            if (m_sourceChangeAffectedFiles.Count == 0)
            {
                return(false);
            }

            return(dynamicallyObservedFiles.Concat(process.Dependencies.Select(f => f.Path)).Any(f => m_sourceChangeAffectedFiles.Contains(f)));
        }
        public override BoundNode VisitSpillSequence(BoundSpillSequence node)
        {
            ReadOnlyArray <BoundStatement> statements = (ReadOnlyArray <BoundStatement>) this.VisitList(node.Statements);
            BoundExpression value = (BoundExpression)this.Visit(node.Value);
            TypeSymbol      type  = this.VisitType(node.Type);

            if (value.Kind != BoundKind.SpillSequence)
            {
                return(node.Update(node.Locals, node.SpillTemps, node.SpillFields, statements, value, type));
            }

            var valAwait = (BoundSpillSequence)value;

            return(node.Update(
                       node.Locals.Concat(valAwait.Locals),
                       node.SpillTemps.Concat(valAwait.SpillTemps),
                       node.SpillFields,
                       statements.Concat(valAwait.Statements),
                       valAwait.Value,
                       valAwait.Type));
        }
        internal ReadOnlyArray <string> GetImportedNamespaces(Session session)
        {
            // TODO (tomat): bound imports should be reused from previous submission instead of passing
            // them to every submission in the chain. See bug #7802.
            //
            //if (session != null && session.LastSubmission != null)
            //{
            //    // engine wide namespaces have already been imported by the first submission:
            //    return session.PendingNamespaces;
            //}
            //else

            if (session != null)
            {
                // this is the first submission of a session:
                return(initialNamespaceImports.Concat(session.PendingNamespaces));
            }
            else
            {
                // this is a standalone submission:
                return(initialNamespaceImports);
            }
        }