private void ConditionalBranch(QilNode ndBranch, Type itemStorageType, LocalBuilder locResult) {
if (locResult == null) {
Debug.Assert(ndBranch.XmlType.IsSingleton, "Conditional must produce a singleton");
// If in a branching context, then inherit branch target from parent context
if (this.iterCurr.IsBranching) {
Debug.Assert(itemStorageType == typeof(bool));
NestedVisitWithBranch(ndBranch, this.iterCurr.CurrentBranchingContext, this.iterCurr.LabelBranch);
}
else {
NestedVisitEnsureStack(ndBranch, itemStorageType, false);
}
}
else {
// Link nested iterator to parent conditional's iterator
NestedVisit(ndBranch, this.iterCurr.GetLabelNext());
this.iterCurr.EnsureItemStorageType(ndBranch.XmlType, itemStorageType);
this.iterCurr.EnsureLocalNoCache(locResult);
}
}