58 references to Type
Microsoft.CodeAnalysis.CSharp (18)
_generated\0\Syntax.xml.Main.Generated.cs (1)
1695
=> node.Update(VisitToken(node.NewKeyword), (TypeSyntax?)Visit(node.
Type
) ?? throw new ArgumentNullException("type"), (ArgumentListSyntax?)Visit(node.ArgumentList), (InitializerExpressionSyntax?)Visit(node.Initializer));
_generated\2\Syntax.xml.Syntax.Generated.cs (4)
3678
if (newKeyword != this.NewKeyword || type != this.
Type
|| argumentList != this.ArgumentList || initializer != this.Initializer)
3689
public new ObjectCreationExpressionSyntax WithNewKeyword(SyntaxToken newKeyword) => Update(newKeyword, this.
Type
, this.ArgumentList, this.Initializer);
3692
public new ObjectCreationExpressionSyntax WithArgumentList(ArgumentListSyntax? argumentList) => Update(this.NewKeyword, this.
Type
, argumentList, this.Initializer);
3694
public new ObjectCreationExpressionSyntax WithInitializer(InitializerExpressionSyntax? initializer) => Update(this.NewKeyword, this.
Type
, this.ArgumentList, initializer);
Binder\Binder_Expressions.cs (10)
5285
var typeWithAnnotations = BindType(node.
Type
, diagnostics);
5300
return BindClassCreationExpression(node, (NamedTypeSymbol)type, GetName(node.
Type
), diagnostics, originalType);
5324
diagnostics.Add(ErrorCode.ERR_InvalidObjectCreation, node.
Type
.Location));
5698
else if (node.
Type
.Kind() == SyntaxKind.TupleType)
5700
diagnostics.Add(ErrorCode.ERR_NewWithTupleTypeSyntax, node.
Type
.GetLocation());
5704
return BindClassCreationExpression(node, typeName, node.
Type
, type, analyzedArguments, diagnostics, node.Initializer, initializerType);
5757
return MakeBadExpressionForObjectCreation(node, type, analyzedArguments, node.Initializer, node.
Type
, diagnostics, wasCompilerGenerated);
6368
ObjectCreationExpressionSyntax {
Type
: { } type } => type.Location,
7072
var result = BindInterfaceCreationExpression(node, type, diagnostics, node.
Type
, analyzedArguments, node.Initializer, wasTargetTyped: false);
7230
var result = BindTypeParameterCreationExpression(node, typeParameter, analyzedArguments, node.Initializer, node.
Type
, wasTargetTyped: false, diagnostics);
Compilation\CSharpSemanticModel.cs (1)
3410
((ObjectCreationExpressionSyntax)boundNodeForSyntacticParent.Syntax).
Type
== boundType.Syntax &&
Syntax\SyntaxFactory.cs (1)
2261
if (node.Kind() == SyntaxKind.NullableType && ((ObjectCreationExpressionSyntax)parent).
Type
== node)
Syntax\SyntaxFacts.cs (1)
117
return ((ObjectCreationExpressionSyntax)parent).
Type
== node;
Microsoft.CodeAnalysis.CSharp.CodeStyle (5)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (1)
115
else if (objectCreation.Parent is InitializerExpressionSyntax { Parent: ObjectCreationExpressionSyntax {
Type
: var collectionType } })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (1)
92
return objectCreationNode.
Type
.GetLastToken();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
361
var symbol = semanticModel.GetSymbolInfo(objectCreation.
Type
, cancellationToken).GetAnySymbol();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
973
if (parent is ObjectCreationExpressionSyntax objectCreation && objectCreation.
Type
== node)
1616
type = objectCreationExpression.
Type
;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (9)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
562
updatedObjectCreation.
Type
.WithoutTrailingTrivia(),
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateConstructor\CSharpGenerateConstructorService.cs (1)
96
var symbolInfo = document.SemanticModel.GetSymbolInfo(objectCreationExpression.
Type
, cancellationToken);
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateConstructor\GenerateConstructorCodeFixProvider.cs (1)
53
ObjectCreationExpressionSyntax objectCreationNode => objectCreationNode.
Type
.GetRightmostName(),
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseObjectInitializer\UseInitializerHelpers.cs (1)
23
.WithType(objectCreation.
Type
.WithTrailingTrivia(objectCreation.ArgumentList.GetTrailingTrivia()))
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (4)
108
objectCreationExpression.
Type
,
109
lockTypeExpression.WithTriviaFrom(objectCreationExpression.
Type
));
155
objectCreation.
Type
,
156
lockTypeExpression.WithTriviaFrom(objectCreation.
Type
));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
2505
if (semanticModel.GetSymbolInfo(objectCreation.
Type
, cancellationToken).Symbol is ITypeSymbol type && !type.CanSupportCollectionInitializer(containingSymbol))
Microsoft.CodeAnalysis.CSharp.Features (14)
ChangeSignature\CSharpChangeSignatureService.cs (3)
163
token.Parent.AncestorsAndSelf().Any(a => a == objectCreation.
Type
))
165
var typeSymbol = semanticModel.GetSymbolInfo(objectCreation.
Type
, cancellationToken).Symbol;
271
return ((ObjectCreationExpressionSyntax)matchingNode).
Type
;
ConvertLinq\ConvertForEachToLinqQuery\ToToListConverter.cs (1)
31
ForEachInfo.SemanticModel.GetSymbolInfo(objectCreationExpression.
Type
, cancellationToken).Symbol is ITypeSymbol typeSymbol &&
DocumentationComments\CSharpDocumentationCommentSnippetService.cs (1)
178
else if (expression is ObjectCreationExpressionSyntax {
Type
: TypeSyntax exceptionType })
src\roslyn\src\Analyzers\CSharp\Analyzers\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (1)
115
else if (objectCreation.Parent is InitializerExpressionSyntax { Parent: ObjectCreationExpressionSyntax {
Type
: var collectionType } })
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
562
updatedObjectCreation.
Type
.WithoutTrailingTrivia(),
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateConstructor\CSharpGenerateConstructorService.cs (1)
96
var symbolInfo = document.SemanticModel.GetSymbolInfo(objectCreationExpression.
Type
, cancellationToken);
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateConstructor\GenerateConstructorCodeFixProvider.cs (1)
53
ObjectCreationExpressionSyntax objectCreationNode => objectCreationNode.
Type
.GetRightmostName(),
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseObjectInitializer\UseInitializerHelpers.cs (1)
23
.WithType(objectCreation.
Type
.WithTrailingTrivia(objectCreation.ArgumentList.GetTrailingTrivia()))
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (4)
108
objectCreationExpression.
Type
,
109
lockTypeExpression.WithTriviaFrom(objectCreationExpression.
Type
));
155
objectCreation.
Type
,
156
lockTypeExpression.WithTriviaFrom(objectCreation.
Type
));
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (2)
Microsoft.NetCore.Analyzers\Performance\CSharpPreferHashDataOverComputeHash.Fixer.cs (2)
215
else if (initliazerValue is ObjectCreationExpressionSyntax {
Type
: QualifiedNameSyntax { Left: QualifiedNameSyntax qualifiedNamespaceSyntax } })
227
else if (invocationNode.Expression is MemberAccessExpressionSyntax { Expression: ObjectCreationExpressionSyntax {
Type
: QualifiedNameSyntax { Left: QualifiedNameSyntax qualifiedNamespaceSyntax } } })
Microsoft.CodeAnalysis.CSharp.Workspaces (5)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (1)
92
return objectCreationNode.
Type
.GetLastToken();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
361
var symbol = semanticModel.GetSymbolInfo(objectCreation.
Type
, cancellationToken).GetAnySymbol();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
973
if (parent is ObjectCreationExpressionSyntax objectCreation && objectCreation.
Type
== node)
1616
type = objectCreationExpression.
Type
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
2505
if (semanticModel.GetSymbolInfo(objectCreation.
Type
, cancellationToken).Symbol is ITypeSymbol type && !type.CanSupportCollectionInitializer(containingSymbol))
Roslyn.Diagnostics.CSharp.Analyzers (5)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (1)
92
return objectCreationNode.
Type
.GetLastToken();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
361
var symbol = semanticModel.GetSymbolInfo(objectCreation.
Type
, cancellationToken).GetAnySymbol();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
973
if (parent is ObjectCreationExpressionSyntax objectCreation && objectCreation.
Type
== node)
1616
type = objectCreationExpression.
Type
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
2505
if (semanticModel.GetSymbolInfo(objectCreation.
Type
, cancellationToken).Symbol is ITypeSymbol type && !type.CanSupportCollectionInitializer(containingSymbol))