2 implementations of ChildOperations
Microsoft.CodeAnalysis (1)
Operations\Operation.cs (1)
110public IOperation.OperationList ChildOperations => new IOperation.OperationList(this);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Semantics\CollectionExpressionTests.cs (1)
27094IOperation.OperationList IOperation.ChildOperations => throw null;
191 references to ChildOperations
ConfigurationSchemaGenerator (2)
RuntimeSource\Configuration.Binder\Parser\ConfigurationBinder.cs (2)
172ITypeOfOperation? typeOfOperation = GetArgumentForParameterAtIndex(operation.Arguments, 1).ChildOperations.FirstOrDefault() as ITypeOfOperation; 227ITypeOfOperation? typeOfOperation = GetArgumentForParameterAtIndex(operation.Arguments, 1).ChildOperations.FirstOrDefault() as ITypeOfOperation;
ILLink.RoslynAnalyzer (1)
DataFlow\OperationWalker.cs (1)
16 foreach (var child in operation.ChildOperations)
Microsoft.Analyzers.Extra (6)
AsyncCallInsideUsingBlockAnalyzer.cs (1)
213.ChildOperations
CallAnalysis\Fixers\LegacyLoggingFixer.FixDetails.cs (5)
45var children = op.ChildOperations.ToArray(); 61foreach (var o in children[0].ChildOperations) 66_ = sb.Append(stringOp.ChildOperations.First().ConstantValue.Value as string); 70var operation = intOp.ChildOperations.First(); 92interpolationArgs.Add(intOp.ChildOperations.First());
Microsoft.AspNetCore.App.Analyzers (7)
Authorization\AddAuthorizationBuilderAnalyzer.cs (4)
76var allOperationsInvolveAuthorizationOptions = configureBlockOperation.ChildOperations 105if (configureArgumentOperation is { ChildOperations: { Count: 1 } argumentChildOperations } 119if (configureDelegateCreationOperation is { ChildOperations: { Count: 1 } delegateCreationChildOperations } 133if (configureAnonymousFunctionOperation is { ChildOperations: { Count: 1 } anonymousFunctionChildOperations }
RouteHandlers\DetectMisplacedLambdaAttribute.cs (3)
28if (lambda.ChildOperations.Count != 1 || lambda.ChildOperations.FirstOrDefault() is not IBlockOperation blockOperation) 73foreach (var op in Enumerable.Reverse(blockOperation.ChildOperations))
Microsoft.CodeAnalysis (8)
Operations\ControlFlowGraphBuilder.cs (4)
1623Debug.Assert(rewrittenThrow.ChildOperations.IsEmpty()); 1641Debug.Assert(rewrittenThrow.ChildOperations.IsEmpty()); 2930Debug.Assert(rewrittenThrow.ChildOperations.IsEmpty()); 3072Debug.Assert(rewrittenThrow.ChildOperations.IsEmpty());
Operations\IOperation.cs (2)
48/// An array of child operations for this operation. Deprecated: please use <see cref="ChildOperations"/>. 50[Obsolete($"This API has performance penalties, please use {nameof(ChildOperations)} instead.", error: false)]
Operations\OperationExtensions.cs (2)
97stack.Push(operation.ChildOperations.GetEnumerator()); 117stack.Push(current.ChildOperations.GetEnumerator());
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
255foreach (var child in operation.ChildOperations)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (1)
483return operation.ChildOperations.All(IsSafeAssignment);
Microsoft.CodeAnalysis.CSharp.Features (1)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (1)
483return operation.ChildOperations.All(IsSafeAssignment);
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (14)
IOperation\IOperationTests_IVariableDeclaration.cs (14)
613Assert.Equal(2, declarator.ChildOperations.Count()); 614Assert.Equal(OperationKind.Literal, declarator.ChildOperations.First().Kind); 615Assert.Equal(OperationKind.VariableInitializer, declarator.ChildOperations.ElementAt(1).Kind); 635Assert.Equal(1, declarator.ChildOperations.Count()); 636Assert.Equal(OperationKind.Literal, declarator.ChildOperations.First().Kind); 656Assert.Equal(1, declarator.ChildOperations.Count()); 657Assert.Equal(OperationKind.VariableInitializer, declarator.ChildOperations.ElementAt(0).Kind); 676Assert.Empty(operation.ChildOperations); 851Assert.Equal(2, declaration.ChildOperations.Count()); 852Assert.Equal(OperationKind.Literal, declaration.ChildOperations.First().Kind); 853Assert.Equal(OperationKind.VariableDeclarator, declaration.ChildOperations.ElementAt(1).Kind); 873Assert.Equal(2, declaration.ChildOperations.Count()); 874Assert.Equal(OperationKind.Literal, declaration.ChildOperations.First().Kind); 875Assert.Equal(OperationKind.VariableDeclarator, declaration.ChildOperations.ElementAt(1).Kind);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Semantics\OperatorTests.cs (1)
11435foreach (var child in iop.ChildOperations)
Microsoft.CodeAnalysis.Features (3)
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
255foreach (var child in operation.ChildOperations)
ValueTracking\ValueTracker.OperationCollector.cs (2)
90foreach (var child in operation.ChildOperations) 95return operation.ChildOperations.Any();
Microsoft.CodeAnalysis.Test.Utilities (144)
CommonTestBase.cs (1)
619foreach (var child in operation.ChildOperations)
Compilation\OperationTreeVerifier.cs (2)
397Debug.Assert(operation.ChildOperations.All(o => o != null)); 399var children = operation.ChildOperations.ToImmutableArray();
Compilation\TestOperationVisitor.cs (141)
67foreach (IOperation child in operation.ChildOperations) 77Assert.Same(builder[0], operation.ChildOperations.First()); 78Assert.Same(builder[^1], operation.ChildOperations.Last()); 80var forwards = operation.ChildOperations.GetEnumerator(); 87var reversed = operation.ChildOperations.Reverse().GetEnumerator(); 96Assert.Throws<InvalidOperationException>(() => operation.ChildOperations.First()); 97Assert.Throws<InvalidOperationException>(() => operation.ChildOperations.Last()); 100foreach (IOperation child in operation.ChildOperations.Reverse()) 122AssertEx.Equal(operation.Operations, operation.ChildOperations); 128AssertEx.Equal(operation.Declarations, operation.ChildOperations); 143AssertEx.Equal(children, operation.ChildOperations); 157AssertEx.Equal(children, operation.ChildOperations); 165AssertEx.Equal(new[] { operation.Value }.Concat(operation.Cases), operation.ChildOperations); 172AssertEx.Equal(operation.Clauses.Concat(operation.Body), operation.ChildOperations); 217AssertEx.Equal(new[] { operation.Value }, operation.ChildOperations); 232AssertEx.Equal(new[] { operation.Value }, operation.ChildOperations); 239Assert.Empty(operation.ChildOperations); 285AssertEx.Equal(children, operation.ChildOperations); 305AssertEx.Equal(children, operation.ChildOperations); 326AssertEx.Equal(children, operation.ChildOperations); 335AssertEx.Equal(children, operation.ChildOperations); 372Assert.Empty(operation.ChildOperations); 376Assert.Same(operation.Operation, operation.ChildOperations.Single()); 396Assert.Empty(operation.ChildOperations); 402Assert.Empty(operation.ChildOperations); 411Assert.Empty(operation.ChildOperations); 415Assert.Same(operation.ReturnedValue, operation.ChildOperations.Single()); 422AssertEx.Equal(new[] { operation.LockedValue, operation.Body }, operation.ChildOperations); 436AssertEx.Equal(children, operation.ChildOperations); 457AssertEx.Equal(children, operation.ChildOperations); 464AssertEx.Equal(new[] { operation.Resources, operation.Body }, operation.ChildOperations); 484AssertEx.Equal(new[] { operation.Variables, operation.Body }, operation.ChildOperations); 490AssertEx.Equal(operation.Elements, operation.ChildOperations); 496Assert.Same(operation.Operand, operation.ChildOperations.Single()); 502AssertEx.Equal(new[] { operation.Group, operation.Aggregation }, operation.ChildOperations); 508Assert.Same(operation.Operation, operation.ChildOperations.Single()); 514AssertEx.Equal(new[] { operation.Value, operation.Body }, operation.ChildOperations); 520Assert.Empty(operation.ChildOperations); 526Assert.Empty(operation.ChildOperations); 551AssertEx.Equal(children, operation.ChildOperations); 573AssertEx.Equal(children, operation.ChildOperations); 582Assert.Same(operation.Value, operation.ChildOperations.Single()); 595Assert.Empty(operation.ChildOperations); 601AssertEx.Equal(new[] { operation.ArrayReference }.Concat(operation.Indices), operation.ChildOperations); 607AssertEx.Equal(new[] { operation.Instance, operation.Argument }, operation.ChildOperations); 616AssertEx.Equal(new[] { operation.Instance, operation.Argument }, operation.ChildOperations); 622Assert.Same(operation.Pointer, operation.ChildOperations.Single()); 630Assert.Empty(operation.ChildOperations); 637Assert.Empty(operation.ChildOperations); 643Assert.Empty(operation.ChildOperations); 676AssertEx.Equal(children, operation.ChildOperations); 723AssertEx.Equal(new[] { operation.EventReference, operation.HandlerValue }, operation.ChildOperations); 730AssertEx.Equal(new[] { operation.Operation, operation.WhenNotNull }, operation.ChildOperations); 736Assert.Empty(operation.ChildOperations); 742Assert.Empty(operation.ChildOperations); 755Assert.Same(operation.Operand, operation.ChildOperations.Single()); 790AssertEx.Equal(new[] { operation.LeftOperand, operation.RightOperand }, operation.ChildOperations); 835AssertEx.Equal(new[] { operation.LeftOperand, operation.RightOperand }, operation.ChildOperations); 863Assert.Same(operation.Operand, operation.ChildOperations.Single()); 893AssertEx.Equal(new[] { operation.Condition, operation.WhenTrue, operation.WhenFalse }, operation.ChildOperations); 897AssertEx.Equal(new[] { operation.Condition, operation.WhenTrue }, operation.ChildOperations); 904AssertEx.Equal(new[] { operation.Value, operation.WhenNull }, operation.ChildOperations); 911AssertEx.Equal(new[] { operation.Target, operation.Value }, operation.ChildOperations); 919Assert.Same(operation.ValueOperand, operation.ChildOperations.Single()); 926Assert.Empty(operation.ChildOperations); 933Assert.Empty(operation.ChildOperations); 940Assert.Same(operation.Body, operation.ChildOperations.Single()); 947Assert.Empty(operation.ChildOperations); 957var children = operation.ChildOperations.ToImmutableArray(); 972Assert.Empty(operation.ChildOperations); 979Assert.Empty(operation.ChildOperations); 985Assert.Empty(operation.ChildOperations); 992Assert.Same(operation.Operation, operation.ChildOperations.Single()); 998Assert.Same(operation.Argument, operation.ChildOperations.Single()); 1006Assert.Empty(operation.ChildOperations); 1010Assert.Same(operation.Exception, operation.ChildOperations.Single()); 1017Assert.Same(operation.Reference, operation.ChildOperations.Single()); 1042AssertEx.Equal(children, operation.ChildOperations); 1048AssertEx.Equal(operation.Initializers, operation.ChildOperations); 1069AssertEx.Equal(children, operation.ChildOperations); 1075AssertEx.Equal(new[] { operation.Operation }.Concat(operation.Arguments), operation.ChildOperations); 1081AssertEx.Equal(new[] { operation.Operation }.Concat(operation.Arguments), operation.ChildOperations); 1087AssertEx.Equal(operation.Initializers, operation.ChildOperations); 1093AssertEx.Equal(new[] { operation.InitializedMember, operation.Initializer }, operation.ChildOperations); 1099Assert.Same(operation.Value, operation.ChildOperations.Single()); 1146AssertEx.Equal(children, operation.ChildOperations); 1153AssertEx.Equal(operation.ElementValues, operation.ChildOperations); 1158AssertEx.Equal(new[] { operation.Target, operation.Value }, operation.ChildOperations); 1206Assert.Same(operation.Target, operation.ChildOperations.Single()); 1212Assert.Same(operation.Operand, operation.ChildOperations.Single()); 1229Assert.Empty(operation.ChildOperations); 1233Assert.Same(operation.Instance, operation.ChildOperations.Single()); 1240Assert.Empty(operation.ChildOperations); 1248Assert.Empty(operation.ChildOperations); 1252Assert.Same(operation.Initializer, operation.ChildOperations.Single()); 1261Assert.Empty(operation.ChildOperations); 1265Assert.Same(operation.Initializer, operation.ChildOperations.Single()); 1278AssertEx.Equal(operation.Elements, operation.ChildOperations); 1284AssertEx.Equal(operation.Parts, operation.ChildOperations); 1294Assert.Same(operation.Text, operation.ChildOperations.Single()); 1315AssertEx.Equal(children, operation.ChildOperations); 1322AssertEx.Equal(children, operation.ChildOperations); 1332AssertEx.Equal(new[] { operation.Left, operation.Right }, operation.ChildOperations); 1369Assert.Same(operation.Value, operation.ChildOperations.Single()); 1382Assert.Same(operation.Value, operation.ChildOperations.Single()); 1390var children = operation.ChildOperations.ToArray(); 1400Assert.Same(operation.Pattern, operation.ChildOperations.Single()); 1408Assert.Empty(operation.ChildOperations); 1441Assert.Empty(operation.ChildOperations); 1451Assert.Same(operation.Pattern, operation.ChildOperations.Single()); 1455Assert.Empty(operation.ChildOperations); 1474AssertEx.Equal(children, operation.ChildOperations); 1518AssertEx.Equal(children, operation.ChildOperations); 1525AssertEx.Equal(children, operation.ChildOperations); 1554AssertEx.Equal(children, operation.ChildOperations); 1568AssertEx.Equal(children, operation.ChildOperations); 1574AssertEx.Equal(new[] { operation.Value, operation.Pattern }, operation.ChildOperations); 1585AssertEx.Equal(new[] { operation.Pattern, operation.Guard }, operation.ChildOperations); 1589Assert.Same(operation.Pattern, operation.ChildOperations.Single()); 1596Assert.Same(operation.Operation, operation.ChildOperations.Single()); 1602Assert.Same(operation.Expression, operation.ChildOperations.Single()); 1614Assert.Same(operation.Target, operation.ChildOperations.Single()); 1620AssertEx.Equal(new IOperation[] { operation.EventReference }.Concat(operation.Arguments), operation.ChildOperations); 1627AssertEx.Equal(new[] { operation.MinimumValue, operation.MaximumValue }, operation.ChildOperations); 1653AssertEx.Equal(builder, operation.ChildOperations); 1666AssertEx.Equal(new[] { operation.BlockBody, operation.ExpressionBody }, operation.ChildOperations); 1670Assert.Same(operation.BlockBody, operation.ChildOperations.Single()); 1675Assert.Same(operation.ExpressionBody, operation.ChildOperations.Single()); 1679Assert.Empty(operation.ChildOperations); 1686Assert.Empty(operation.ChildOperations); 1696Assert.Empty(operation.ChildOperations); 1703Assert.Same(operation.Value, operation.ChildOperations.Single()); 1735Assert.Empty(operation.ChildOperations); 1742Assert.Same(operation.Operand, operation.ChildOperations.Single()); 1749Assert.Empty(operation.ChildOperations); 1756Assert.Empty(operation.ChildOperations); 1765IOperation[] children = operation.ChildOperations.ToArray(); 1785AssertEx.Equal(operation.Clauses, operation.ChildOperations); 1792AssertEx.Equal(SpecializedCollections.SingletonEnumerable(operation.Operand).Concat(operation.DimensionSizes), operation.ChildOperations); 1798AssertEx.Equal(SpecializedCollections.SingletonEnumerable(operation.DeclarationGroup), operation.ChildOperations); 1821AssertEx.Equal(children, operation.ChildOperations);
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (1)
Semantics\BinaryOperators.vb (1)
1521For Each child In iop.ChildOperations
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NullableHelpers.cs (1)
128foreach (var childOperation in operation.ChildOperations.Reverse())