Example #1
0
            static void CaptureVariableDeclaratorOperation(DataCollector dataCollector, ITypeSymbol createdType, IVariableInitializerOperation variableInitializerOperation)
            {
                switch (variableInitializerOperation.Parent)
                {
                case IVariableDeclaratorOperation declaratorOperation:
                    dataCollector.CollectVariableDeclaratorOperation(declaratorOperation.Symbol, variableInitializerOperation, createdType);
                    break;

                case IVariableDeclarationOperation declarationOperation when declarationOperation.Declarators.Length == 1:
                {
                    var declaratorOperationAlt = declarationOperation.Declarators[0];
                    dataCollector.CollectVariableDeclaratorOperation(declaratorOperationAlt.Symbol, variableInitializerOperation, createdType);
                    break;
                }
                }
            }