80 references to IsVar
Microsoft.CodeAnalysis.CSharp (12)
Binder\Binder_Expressions.cs (1)
3002
if (typeSyntax.
IsVar
)
Binder\Binder_Symbols.cs (2)
109
if (syntax.
IsVar
)
184
/// PREREQUISITE: syntax should be checked to match the keyword, like <see cref="TypeSyntax.
IsVar
"/> or <see cref="TypeSyntax.IsUnmanaged"/>.
Binder\ForEachLoopBinder.cs (1)
1081
((_syntax as ForEachStatementSyntax)?.Type.
IsVar
== true) ?
Compilation\CSharpSemanticModel.cs (2)
543
if (((TypeSyntax)expression).
IsVar
)
973
if (((TypeSyntax)expression).
IsVar
)
Compilation\SyntaxTreeSemanticModel.cs (1)
347
if (!type.
IsVar
)
Symbols\Source\GlobalExpressionVariable.cs (1)
53
return (typeSyntax == null || typeSyntax.SkipScoped(out _).SkipRef().
IsVar
)
Symbols\Source\SourceLocalSymbol.cs (3)
148
return closestTypeSyntax.SkipScoped(out _).SkipRef().
IsVar
179
return typeSyntax?.SkipScoped(out _).SkipRef().
IsVar
!= false && kind != LocalDeclarationKind.DeclarationExpressionVariable
322
if (typeSyntax.
IsVar
)
Syntax\SyntaxNodeExtensions.cs (1)
360
((IdentifierNameSyntax)invocationTarget).
IsVar
;
Microsoft.CodeAnalysis.CSharp.CodeStyle (17)
CSharpSemanticFacts.cs (1)
350
if (node is IdentifierNameSyntax {
IsVar
: true })
CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
221
if (type.
IsVar
)
CSharpUseExplicitTypeHelper.cs (3)
44
if (!variableDeclaration.Type.StripRefIfNeeded().
IsVar
)
56
if (!forEachStatement.Type.StripRefIfNeeded().
IsVar
)
120
if (!declaration.Type.
IsVar
)
CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (1)
70
!variableDeclaration.Type.
IsVar
)
CSharpUseImplicitTypeHelper.cs (6)
33
if (typeName.StripRefIfNeeded().
IsVar
)
50
if (type.
IsVar
)
63
if (type.
IsVar
|| (type.Kind() == SyntaxKind.RefType && ((RefTypeSyntax)type).Type.
IsVar
))
95
Debug.Assert(!typeName.StripRefIfNeeded().
IsVar
, "'var' special case should have prevented analysis of this variable.");
348
if (declaration.Type.
IsVar
)
CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
191
if (!localDeclaration.Declaration.Type.
IsVar
)
DefaultExpressionSyntaxExtensions.cs (1)
46
if (typeSyntax.
IsVar
)
NullableImpactingSpanWalker.cs (1)
136
if (typeSyntax.
IsVar
)
ParenthesizedExpressionSyntaxExtensions.cs (1)
82
return !varDecl.Type.
IsVar
;
TypeSyntaxExtensions.cs (1)
28
if (!typeSyntax.
IsVar
)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (6)
CSharpInlineDeclarationCodeFixProvider.cs (2)
244
var explicitType = declaration.Type.
IsVar
? local.Type?.GenerateTypeSyntax() : declaration.Type;
342
if (declarationExpression.Type.
IsVar
)
CSharpMoveDeclarationNearReferenceService.cs (1)
58
if (type.
IsVar
)
CSharpTypeInferenceService.TypeInferrer.cs (2)
2238
if (!variableType.
IsVar
||
2297
if (declExpr.Type.
IsVar
&&
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (1)
1511
binaryExpressionSyntax.Right == typeSyntax && !typeSyntax.
IsVar
)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (2)
Semantics\PatternMatchingTestBase.cs (2)
154
if (!decl.Type.
IsVar
|| !type.IsErrorType())
275
if (typeSyntax.
IsVar
&& type.IsErrorType())
Microsoft.CodeAnalysis.CSharp.Features (18)
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
387
var isVar = ((VariableDeclarationSyntax)variableDeclarator.Parent).Type.
IsVar
;
ConvertLinq\ConvertForEachToLinqQuery\AbstractConverter.cs (2)
108
type: forEachStatement.Type.
IsVar
? null : forEachStatement.Type,
109
identifier: forEachStatement.Type.
IsVar
CSharpInlineDeclarationCodeFixProvider.cs (2)
244
var explicitType = declaration.Type.
IsVar
? local.Type?.GenerateTypeSyntax() : declaration.Type;
342
if (declarationExpression.Type.
IsVar
)
CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
221
if (type.
IsVar
)
CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (1)
70
!variableDeclaration.Type.
IsVar
)
CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
191
if (!localDeclaration.Declaration.Type.
IsVar
)
Debugging\DataTipInfoGetter.cs (1)
76
if (expression is TypeSyntax typeSyntax && typeSyntax.
IsVar
)
DocumentHighlighting\CSharpDocumentHighlightsService.cs (1)
62
if (type.
IsVar
)
GenerateMember\GenerateEnumMember\CSharpGenerateEnumMemberService.cs (1)
36
!identifierName.
IsVar
)
GenerateType\CSharpGenerateTypeService.cs (1)
136
if (simpleName.
IsVar
)
InlineHints\CSharpInlineTypeHintsService.cs (3)
38
if (node is VariableDeclarationSyntax { Type.
IsVar
: true } variableDeclaration &&
50
if (node is DeclarationExpressionSyntax { Type.
IsVar
: true, Designation: not ParenthesizedVariableDesignationSyntax } declarationExpression)
67
else if (node is ForEachStatementSyntax { Type.
IsVar
: true } forEachStatement)
NullableImpactingSpanWalker.cs (1)
136
if (typeSyntax.
IsVar
)
ReplaceConditionalWithStatements\CSharpReplaceConditionalWithStatementsCodeRefactoringProvider.cs (1)
71
if (type.
IsVar
)
SpellCheck\CSharpSpellcheckCodeFixProvider.cs (1)
38
=> !name.
IsVar
;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Semantics\NullableReferenceTypesTests.cs (1)
33062
var varDecl = tree.GetRoot().DescendantNodes().OfType<LocalDeclarationStatementSyntax>().Where(d => d.Declaration.Type.
IsVar
).Single();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Symbols\Source\NullablePublicAPITests.cs (1)
2565
if (type.
IsVar
)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Parsing\StatementParsingTests.cs (1)
911
Assert.True(fs.Declaration.Type.
IsVar
);
Microsoft.CodeAnalysis.CSharp.Workspaces (22)
Classification\SyntaxClassification\NameSyntaxClassifier.cs (1)
162
if (name.
IsVar
&&
CSharpMoveDeclarationNearReferenceService.cs (1)
58
if (type.
IsVar
)
CSharpSemanticFacts.cs (1)
350
if (node is IdentifierNameSyntax {
IsVar
: true })
CSharpTypeInferenceService.TypeInferrer.cs (2)
2238
if (!variableType.
IsVar
||
2297
if (declExpr.Type.
IsVar
&&
CSharpUseExplicitTypeHelper.cs (3)
44
if (!variableDeclaration.Type.StripRefIfNeeded().
IsVar
)
56
if (!forEachStatement.Type.StripRefIfNeeded().
IsVar
)
120
if (!declaration.Type.
IsVar
)
CSharpUseImplicitTypeHelper.cs (6)
33
if (typeName.StripRefIfNeeded().
IsVar
)
50
if (type.
IsVar
)
63
if (type.
IsVar
|| (type.Kind() == SyntaxKind.RefType && ((RefTypeSyntax)type).Type.
IsVar
))
95
Debug.Assert(!typeName.StripRefIfNeeded().
IsVar
, "'var' special case should have prevented analysis of this variable.");
348
if (declaration.Type.
IsVar
)
DefaultExpressionSyntaxExtensions.cs (1)
46
if (typeSyntax.
IsVar
)
Editing\CSharpImportAdder.cs (1)
199
if (node.
IsVar
)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\TypeSyntaxExtensions.cs\TypeSyntaxExtensions.cs (1)
28
if (!typeSyntax.
IsVar
)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (1)
1511
binaryExpressionSyntax.Right == typeSyntax && !typeSyntax.
IsVar
)
ParenthesizedExpressionSyntaxExtensions.cs (1)
82
return !varDecl.Type.
IsVar
;
Simplification\CSharpSimplificationService.Expander.cs (1)
440
if (originalSimpleName.
IsVar
)
Simplification\Simplifiers\NameSimplifier.cs (2)
44
if (name.
IsVar
|| name.IsNint || name.IsNuint)
272
if (!name.
IsVar
&& symbol.Kind == SymbolKind.NamedType && !name.IsLeftSideOfQualifiedName())