Example #1
0
        internal static void GetLocalNames(ForStatementSyntax commonForEach, ref List <SyntaxToken> result)
        {
            switch (commonForEach.Kind())
            {
            case SyntaxKind.ForStatement:
                var forEachVariable = (ForStatementSyntax)commonForEach;
                GetLocalNames(forEachVariable.Variable, ref result);
                return;

            default: throw ExceptionUtilities.UnexpectedValue(commonForEach.Kind());
            }
        }
        public static bool IsTypeInferred(this ForStatementSyntax forEachStatement, SemanticModel semanticModel)
        {
            switch (forEachStatement.Kind())
            {
            case SyntaxKind.ForStatement:
                return((((ForStatementSyntax)forEachStatement).Variable as DeclarationExpressionSyntax)?.Type
                       .IsTypeInferred(semanticModel) == true);

            default:
                return(false);
            }
        }