79 references to IsVar
Microsoft.CodeAnalysis.CSharp (10)
Binder\Binder_Expressions.cs (1)
3218if (typeSyntax.IsVar)
Binder\Binder_Symbols.cs (2)
109if (syntax.IsVar) 184/// PREREQUISITE: syntax should be checked to match the keyword, like <see cref="TypeSyntax.IsVar"/> or <see cref="TypeSyntax.IsUnmanaged"/>.
Compilation\CSharpSemanticModel.cs (2)
543if (((TypeSyntax)expression).IsVar) 973if (((TypeSyntax)expression).IsVar)
Compilation\SyntaxTreeSemanticModel.cs (1)
351if (!type.IsVar)
Symbols\Source\GlobalExpressionVariable.cs (1)
54return (typeSyntax == null || typeSyntax.SkipScoped(out _).SkipRef().IsVar)
Symbols\Source\SourceLocalSymbol.cs (3)
147return closestTypeSyntax.SkipScoped(out _).SkipRef().IsVar 178return typeSyntax?.SkipScoped(out _).SkipRef().IsVar != false && kind != LocalDeclarationKind.DeclarationExpressionVariable 321if (typeSyntax.IsVar)
Microsoft.CodeAnalysis.CSharp.CodeStyle (18)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\NullableImpactingSpanWalker.cs (1)
127if (typeSyntax.IsVar)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
630=> equalsValue.Parent is not VariableDeclaratorSyntax { Parent: VariableDeclarationSyntax { Type.IsVar: true } };
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
223if (type.IsVar)
src\Analyzers\CSharp\Analyzers\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (1)
88Parent: VariableDeclaratorSyntax { Parent: VariableDeclarationSyntax { Type.IsVar: false } variableDeclaration }
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
125if (localDeclaration.Declaration.Type.IsVar)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DefaultExpressionSyntaxExtensions.cs (1)
46if (typeSyntax.IsVar)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
77return !varDecl.Type.IsVar;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\TypeSyntaxExtensions.cs (1)
28if (!typeSyntax.IsVar)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
363if (node is IdentifierNameSyntax { IsVar: true })
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseExplicitTypeHelper.cs (3)
44if (!variableDeclaration.Type.StripRefIfNeeded().IsVar) 56if (!forEachStatement.Type.StripRefIfNeeded().IsVar) 120if (!declaration.Type.IsVar)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (6)
33if (typeName.StripRefIfNeeded().IsVar) 50if (type.IsVar) 63if (type.IsVar || (type.Kind() == SyntaxKind.RefType && ((RefTypeSyntax)type).Type.IsVar)) 95Debug.Assert(!typeName.StripRefIfNeeded().IsVar, "'var' special case should have prevented analysis of this variable."); 348if (declaration.Type.IsVar)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (6)
src\Analyzers\CSharp\CodeFixes\GenerateEnumMember\CSharpGenerateEnumMemberService.cs (1)
31!identifierName.IsVar)
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (2)
231var explicitType = declaration.Type.IsVar ? local.Type?.GenerateTypeSyntax() : declaration.Type; 343if (declarationExpression.Type.IsVar)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Editing\CSharpImportAdder.cs (1)
199if (node.IsVar)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpMoveDeclarationNearReferenceService.cs (1)
58if (type.IsVar)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
2228if (declExpr.Type.IsVar &&
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (2)
Semantics\PatternMatchingTestBase.cs (2)
154if (!decl.Type.IsVar || !type.IsErrorType()) 275if (typeSyntax.IsVar && type.IsErrorType())
Microsoft.CodeAnalysis.CSharp.Features (18)
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
385var isVar = ((VariableDeclarationSyntax)variableDeclarator.Parent).Type.IsVar;
ConvertLinq\ConvertForEachToLinqQuery\AbstractConverter.cs (2)
108type: forEachStatement.Type.IsVar ? null : forEachStatement.Type, 109identifier: forEachStatement.Type.IsVar
Debugging\DataTipInfoGetter.cs (1)
75if (expression is TypeSyntax typeSyntax && typeSyntax.IsVar)
GenerateType\CSharpGenerateTypeService.cs (1)
136if (simpleName.IsVar)
InlineHints\CSharpInlineTypeHintsService.cs (3)
38if (node is VariableDeclarationSyntax { Type.IsVar: true } variableDeclaration && 50if (node is DeclarationExpressionSyntax { Type.IsVar: true, Designation: not ParenthesizedVariableDesignationSyntax } declarationExpression) 67else if (node is ForEachStatementSyntax { Type.IsVar: true } forEachStatement)
ReplaceConditionalWithStatements\CSharpReplaceConditionalWithStatementsCodeRefactoringProvider.cs (1)
71if (type.IsVar)
SpellCheck\CSharpSpellcheckCodeFixProvider.cs (1)
38=> !name.IsVar;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\NullableImpactingSpanWalker.cs (1)
127if (typeSyntax.IsVar)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
630=> equalsValue.Parent is not VariableDeclaratorSyntax { Parent: VariableDeclarationSyntax { Type.IsVar: true } };
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
223if (type.IsVar)
src\Analyzers\CSharp\Analyzers\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (1)
88Parent: VariableDeclaratorSyntax { Parent: VariableDeclarationSyntax { Type.IsVar: false } variableDeclaration }
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
125if (localDeclaration.Declaration.Type.IsVar)
src\Analyzers\CSharp\CodeFixes\GenerateEnumMember\CSharpGenerateEnumMemberService.cs (1)
31!identifierName.IsVar)
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (2)
231var explicitType = declaration.Type.IsVar ? local.Type?.GenerateTypeSyntax() : declaration.Type; 343if (declarationExpression.Type.IsVar)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Semantics\NullableReferenceTypesTests.cs (1)
35006var varDecl = tree.GetRoot().DescendantNodes().OfType<LocalDeclarationStatementSyntax>().Where(d => d.Declaration.Type.IsVar).Single();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Symbols\Source\NullablePublicAPITests.cs (1)
2564if (type.IsVar)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Parsing\StatementParsingTests.cs (1)
911Assert.True(fs.Declaration.Type.IsVar);
Microsoft.CodeAnalysis.CSharp.Workspaces (22)
Classification\SyntaxClassification\NameSyntaxClassifier.cs (1)
150if (name.IsVar && IsInVarContext(name))
Simplification\CSharpSimplificationService.Expander.cs (1)
442if (originalSimpleName.IsVar)
Simplification\Simplifiers\NameSimplifier.cs (2)
44if (name.IsVar || name.IsNint || name.IsNuint) 272if (!name.IsVar && symbol.Kind == SymbolKind.NamedType && !name.IsLeftSideOfQualifiedName())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DefaultExpressionSyntaxExtensions.cs (1)
46if (typeSyntax.IsVar)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
77return !varDecl.Type.IsVar;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\TypeSyntaxExtensions.cs (1)
28if (!typeSyntax.IsVar)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
363if (node is IdentifierNameSyntax { IsVar: true })
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseExplicitTypeHelper.cs (3)
44if (!variableDeclaration.Type.StripRefIfNeeded().IsVar) 56if (!forEachStatement.Type.StripRefIfNeeded().IsVar) 120if (!declaration.Type.IsVar)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (6)
33if (typeName.StripRefIfNeeded().IsVar) 50if (type.IsVar) 63if (type.IsVar || (type.Kind() == SyntaxKind.RefType && ((RefTypeSyntax)type).Type.IsVar)) 95Debug.Assert(!typeName.StripRefIfNeeded().IsVar, "'var' special case should have prevented analysis of this variable."); 348if (declaration.Type.IsVar)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Editing\CSharpImportAdder.cs (1)
199if (node.IsVar)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
1527binaryExpressionSyntax.Right == typeSyntax && !typeSyntax.IsVar)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpMoveDeclarationNearReferenceService.cs (1)
58if (type.IsVar)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
2169if (!variableType.IsVar || 2228if (declExpr.Type.IsVar &&