77 references to IsVar
Microsoft.CodeAnalysis.CSharp (10)
Binder\Binder_Expressions.cs (1)
3221if (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 (17)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\NullableImpactingSpanWalker.cs (1)
127if (typeSyntax.IsVar)
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\ExpressionSyntaxExtensions.cs (1)
989if (equalsValue.Parent is VariableDeclaratorSyntax { Parent: VariableDeclarationSyntax { Type.IsVar: true } })
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)
350if (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 (5)
33if (typeName.StripRefIfNeeded().IsVar) 51if (type.IsVar) 62if (type.IsVar) 72if (declaration.Type.StripRefIfNeeded().IsVar) 101Debug.Assert(!typeName.StripRefIfNeeded().IsVar, "'var' special case should have prevented analysis of this variable.");
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)
2244if (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 (17)
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
381var 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)
36else if (expression is TypeSyntax typeSyntax && typeSyntax.IsVar)
GenerateType\CSharpGenerateTypeService.cs (1)
124if (simpleName.IsVar)
InlineHints\CSharpInlineTypeHintsService.cs (3)
34if (node is VariableDeclarationSyntax { Type.IsVar: true } variableDeclaration && 46if (node is DeclarationExpressionSyntax { Type.IsVar: true, Designation: not ParenthesizedVariableDesignationSyntax } declarationExpression) 63else if (node is ForEachStatementSyntax { Type.IsVar: true } forEachStatement)
ReplaceConditionalWithStatements\CSharpReplaceConditionalWithStatementsCodeRefactoringProvider.cs (1)
71if (type.IsVar)
SpellCheck\CSharpSpellcheckCodeFixProvider.cs (1)
50=> !name.IsVar;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\NullableImpactingSpanWalker.cs (1)
127if (typeSyntax.IsVar)
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)
35000var 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\ExpressionSyntaxExtensions.cs (1)
989if (equalsValue.Parent is VariableDeclaratorSyntax { Parent: VariableDeclarationSyntax { Type.IsVar: true } })
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)
350if (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 (5)
33if (typeName.StripRefIfNeeded().IsVar) 51if (type.IsVar) 62if (type.IsVar) 72if (declaration.Type.StripRefIfNeeded().IsVar) 101Debug.Assert(!typeName.StripRefIfNeeded().IsVar, "'var' special case should have prevented analysis of this variable.");
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)
2185if (!variableType.IsVar || 2244if (declExpr.Type.IsVar &&