130 implementations of Type
Microsoft.CodeAnalysis (129)
Generated\Operations.Generated.cs (126)
4050
public override ITypeSymbol?
Type
=> null;
4105
public override ITypeSymbol?
Type
=> null;
4175
public override ITypeSymbol?
Type
=> null;
4281
public override ITypeSymbol?
Type
=> null;
4373
public override ITypeSymbol?
Type
=> null;
4485
public override ITypeSymbol?
Type
=> null;
4509
public override ITypeSymbol?
Type
=> null;
4562
public override ITypeSymbol?
Type
=> null;
4582
public override ITypeSymbol?
Type
=> null;
4596
public override ITypeSymbol?
Type
=> null;
4648
public override ITypeSymbol?
Type
=> null;
4712
public override ITypeSymbol?
Type
=> null;
4791
public override ITypeSymbol?
Type
=> null;
4859
public override ITypeSymbol?
Type
=> null;
4910
public override ITypeSymbol?
Type
=> null;
4974
public override ITypeSymbol?
Type
=> null;
4988
public override ITypeSymbol?
Type
=> null;
5002
public override ITypeSymbol?
Type
=> null;
5068
public override ITypeSymbol?
Type
=> null;
5086
public override ITypeSymbol?
Type
{ get; }
5146
public override ITypeSymbol?
Type
{ get; }
5219
public override ITypeSymbol?
Type
{ get; }
5286
public override ITypeSymbol?
Type
{ get; }
5308
public override ITypeSymbol?
Type
{ get; }
5327
public override ITypeSymbol?
Type
{ get; }
5392
public override ITypeSymbol?
Type
{ get; }
5448
public override ITypeSymbol?
Type
{ get; }
5517
public override ITypeSymbol?
Type
{ get; }
5571
public override ITypeSymbol?
Type
{ get; }
5634
public override ITypeSymbol?
Type
{ get; }
5712
public override ITypeSymbol?
Type
{ get; }
5789
public override ITypeSymbol?
Type
{ get; }
5856
public override ITypeSymbol?
Type
{ get; }
5909
public override ITypeSymbol?
Type
=> null;
5979
public override ITypeSymbol?
Type
{ get; }
6031
public override ITypeSymbol?
Type
{ get; }
6098
public override ITypeSymbol?
Type
{ get; }
6117
public override ITypeSymbol?
Type
{ get; }
6173
public override ITypeSymbol?
Type
{ get; }
6225
public override ITypeSymbol?
Type
{ get; }
6298
public override ITypeSymbol?
Type
{ get; }
6373
public override ITypeSymbol?
Type
{ get; }
6426
public override ITypeSymbol?
Type
{ get; }
6491
public override ITypeSymbol?
Type
{ get; }
6554
public override ITypeSymbol?
Type
{ get; }
6571
public override ITypeSymbol?
Type
{ get; }
6628
public override ITypeSymbol?
Type
{ get; }
6684
public override ITypeSymbol?
Type
{ get; }
6740
public override ITypeSymbol?
Type
{ get; }
6803
public override ITypeSymbol?
Type
{ get; }
6856
public override ITypeSymbol?
Type
{ get; }
6914
public override ITypeSymbol?
Type
{ get; }
6972
public override ITypeSymbol?
Type
{ get; }
7024
public override ITypeSymbol?
Type
{ get; }
7076
public override ITypeSymbol?
Type
{ get; }
7094
public override ITypeSymbol?
Type
{ get; }
7113
public override ITypeSymbol?
Type
{ get; }
7133
public override ITypeSymbol?
Type
{ get; }
7185
public override ITypeSymbol?
Type
{ get; }
7248
public override ITypeSymbol?
Type
{ get; }
7311
public override ITypeSymbol?
Type
{ get; }
7363
public override ITypeSymbol?
Type
{ get; }
7422
public override ITypeSymbol?
Type
{ get; }
7474
public override ITypeSymbol?
Type
{ get; }
7491
public override ITypeSymbol?
Type
{ get; }
7553
public override ITypeSymbol?
Type
=> null;
7600
public override ITypeSymbol?
Type
=> null;
7651
public override ITypeSymbol?
Type
=> null;
7702
public override ITypeSymbol?
Type
=> null;
7757
public override ITypeSymbol?
Type
=> null;
7825
public override ITypeSymbol?
Type
=> null;
7906
public override ITypeSymbol?
Type
=> null;
7967
public override ITypeSymbol?
Type
=> null;
8044
public override ITypeSymbol?
Type
=> null;
8118
public override ITypeSymbol?
Type
=> null;
8142
public override ITypeSymbol?
Type
=> null;
8205
public override ITypeSymbol?
Type
=> null;
8267
public override ITypeSymbol?
Type
=> null;
8320
public override ITypeSymbol?
Type
=> null;
8371
public override ITypeSymbol?
Type
=> null;
8427
public override ITypeSymbol?
Type
=> null;
8500
public override ITypeSymbol?
Type
=> null;
8562
public override ITypeSymbol?
Type
=> null;
8584
public override ITypeSymbol?
Type
=> null;
8649
public override ITypeSymbol?
Type
{ get; }
8716
public override ITypeSymbol?
Type
=> null;
8787
public override ITypeSymbol?
Type
=> null;
8806
public override ITypeSymbol?
Type
{ get; }
8859
public override ITypeSymbol?
Type
=> null;
8881
public override ITypeSymbol?
Type
{ get; }
8934
public override ITypeSymbol?
Type
{ get; }
8951
public override ITypeSymbol?
Type
{ get; }
8970
public override ITypeSymbol?
Type
{ get; }
9029
public override ITypeSymbol?
Type
{ get; }
9096
public override ITypeSymbol?
Type
{ get; }
9153
public override ITypeSymbol?
Type
=> null;
9219
public override ITypeSymbol?
Type
=> null;
9295
public override ITypeSymbol?
Type
=> null;
9309
public override ITypeSymbol?
Type
=> null;
9378
public override ITypeSymbol?
Type
{ get; }
9453
public override ITypeSymbol?
Type
=> null;
9515
public override ITypeSymbol?
Type
=> null;
9578
public override ITypeSymbol?
Type
{ get; }
9642
public override ITypeSymbol?
Type
=> null;
9694
public override ITypeSymbol?
Type
{ get; }
9713
public override ITypeSymbol?
Type
{ get; }
9775
public override ITypeSymbol?
Type
=> null;
9830
public override ITypeSymbol?
Type
=> null;
9881
public override ITypeSymbol?
Type
=> null;
9945
public override ITypeSymbol?
Type
=> null;
9963
public override ITypeSymbol?
Type
=> null;
10016
public override ITypeSymbol?
Type
=> null;
10081
public override ITypeSymbol?
Type
{ get; }
10148
public override ITypeSymbol?
Type
{ get; }
10210
public override ITypeSymbol?
Type
=> null;
10262
public override ITypeSymbol?
Type
=> null;
10282
public override ITypeSymbol?
Type
=> null;
10349
public override ITypeSymbol?
Type
{ get; }
10410
public override ITypeSymbol?
Type
=> null;
10463
public override ITypeSymbol?
Type
=> null;
10530
public override ITypeSymbol?
Type
{ get; }
10549
public override ITypeSymbol?
Type
{ get; }
10600
public override ITypeSymbol?
Type
=> null;
10663
public override ITypeSymbol?
Type
{ get; }
10721
public override ITypeSymbol?
Type
{ get; }
10777
public override ITypeSymbol?
Type
=> null;
Operations\Operation.cs (1)
75
public abstract ITypeSymbol?
Type
{ get; }
Operations\OperationNodes.cs (2)
135
public override ITypeSymbol?
Type
{ get; }
169
public override ITypeSymbol?
Type
=> null;
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Semantics\CollectionExpressionTests.cs (1)
27088
ITypeSymbol IOperation.
Type
=> throw null;
630 references to Type
ConfigurationSchemaGenerator (3)
RuntimeSource\Configuration.Binder\Parser\ConfigurationBinder.cs (3)
107
IInstanceReferenceOperation i => i.
Type
,
110
IPropertyReferenceOperation o => o.
Type
,
115
IObjectCreationOperation o => o.
Type
,
ILLink.RoslynAnalyzer (5)
TrimAnalysis\TrimAnalysisVisitor.cs (5)
91
if (operation.
Type
is not null)
188
(operation.
Type
?.TypeKind == TypeKind.Enum || operation.
Type
?.SpecialType == SpecialType.System_Int32)) {
432
} else if (operation.
Type
?.TypeKind == TypeKind.Enum && constantValue is int enumConstantValue) {
436
switch (operation.
Type
?.SpecialType) {
Microsoft.Analyzers.Extra (13)
AsyncCallInsideUsingBlockAnalyzer.cs (1)
130
var returnType = operation.
Type
?.OriginalDefinition;
CallAnalysis\Arrays.cs (1)
103
static void HandleConstructor(OperationAnalysisContext context, IObjectCreationOperation op) => HandleSuspectType(context, (INamedTypeSymbol)op.
Type
!, op.Syntax.GetLocation());
CallAnalysis\Fixers\LegacyLoggingFixer.cs (7)
366
var t = invocationOp.Arguments[0].Value.
Type
!;
386
parameters.Add(gen.ParameterDeclaration("exception", gen.TypeExpression(invocationOp.Arguments[details.ExceptionParamIndex].Value.
Type
!)));
394
parameters.Add(gen.ParameterDeclaration(details.MessageArgs[index++], gen.TypeExpression(o.
Type
!)));
431
invocationOp.Arguments[0].Value.
Type
!
436
args.Add(invocationOp.Arguments[details.ExceptionParamIndex].Value.
Type
!);
443
args.Add(a.
Type
!);
455
args.Add(d.
Type
!);
CoalesceAnalyzer.cs (2)
34
var type = op.Target.
Type
;
61
var type = op.Value.
Type
;
ConditionalAccessAnalyzer.cs (2)
72
type = op.Operation.
Type
;
78
type = op.Operation.
Type
;
Microsoft.Analyzers.Local (5)
CallAnalysis\CallAnalyzer.Handlers.cs (2)
120
if (creationOp.
Type
!= null)
122
if (_state.ExceptionTypes.TryGetValue(creationOp.
Type
, out var handlers))
CallAnalysis\Throws.cs (3)
33
if (creationOp?.
Type
!= null)
40
$"Microsoft.Shared.Diagnostics.Throws.{creationOp.
Type
.Name}");
46
if (creationOp.
Type
.Name == "ArgumentNullException")
Microsoft.AspNetCore.App.Analyzers (6)
Http\HeaderDictionaryAddAnalyzer.cs (1)
36
&& SymbolEqualityComparer.Default.Equals(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_IHeaderDictionary), invocation.Instance?.
Type
))
Http\RequestDelegateReturnTypeAnalyzer.cs (3)
33
SymbolEqualityComparer.Default.Equals(parent.
Type
, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_RequestDelegate)))
49
SymbolEqualityComparer.Default.Equals(parent.
Type
, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_RequestDelegate)))
59
var returnType = resolvedOperation.
Type
;
Kestrel\ListenOnIPv6AnyAnalyzer.cs (1)
113
Instance.
Type
:
RouteHandlers\DisallowReturningActionResultFromMapMethods.cs (1)
67
var type = returnedValue.
Type
;
Microsoft.AspNetCore.Mvc.Api.Analyzers (4)
ActualApiResponseMetadataFactory.cs (3)
79
var statementReturnType = returnedValue.
Type
;
184
typeSymbol = assignmentOperation.
Type
;
217
typeSymbol = operation.
Type
;
ApiActionsDoNotRequireExplicitModelValidationCheckAnalyzer.cs (1)
97
!symbolCache.IActionResult.IsAssignableFrom(returnValue.
Type
))
Microsoft.CodeAnalysis (199)
Generated\Operations.Generated.cs (1)
1835
/// Natural type can be different from <see cref="IOperation.
Type
" /> depending on the
Operations\ControlFlowGraphBuilder.cs (192)
1412
return result ?? MakeInvalidOperation(originalOperation.Syntax, originalOperation.
Type
, ImmutableArray<IOperation>.Empty);
2104
return PopStackFrame(frame, new SimpleAssignmentOperation(operation.IsRef, PopOperand(), value, null, operation.Syntax, operation.
Type
, operation.GetConstantValue(), IsImplicit(operation)));
2116
syntax: operation.Syntax, type: operation.
Type
, isImplicit: IsImplicit(operation)));
2127
operation.Syntax, operation.
Type
, IsImplicit(operation));
2138
operation.Syntax, operation.
Type
, IsImplicit(operation));
2149
operation.Syntax, operation.
Type
, IsImplicit(operation));
2170
if (ITypeSymbolHelpers.IsBooleanType(operation.
Type
) &&
2171
ITypeSymbolHelpers.IsBooleanType(operation.LeftOperand.
Type
) &&
2172
ITypeSymbolHelpers.IsBooleanType(operation.RightOperand.
Type
))
2178
ITypeSymbolHelpers.IsNullableOfBoolean(operation.
Type
) &&
2179
ITypeSymbolHelpers.IsNullableOfBoolean(operation.LeftOperand.
Type
) &&
2180
ITypeSymbolHelpers.IsNullableOfBoolean(operation.RightOperand.
Type
))
2185
else if (ITypeSymbolHelpers.IsObjectType(operation.
Type
) &&
2186
ITypeSymbolHelpers.IsObjectType(operation.LeftOperand.
Type
) &&
2187
ITypeSymbolHelpers.IsObjectType(operation.RightOperand.
Type
))
2191
else if (ITypeSymbolHelpers.IsDynamicType(operation.
Type
) &&
2192
(ITypeSymbolHelpers.IsDynamicType(operation.LeftOperand.
Type
) ||
2193
ITypeSymbolHelpers.IsDynamicType(operation.RightOperand.
Type
)))
2232
semanticModel: null, operation.Syntax, operation.
Type
, operation.GetConstantValue(), IsImplicit(operation)));
2246
semanticModel: null, operation.Syntax, operation.
Type
, IsImplicit(operation));
2258
semanticModel: null, operation.Syntax, operation.
Type
, operation.GetConstantValue(), IsImplicit(operation));
2265
ITypeSymbolHelpers.IsBooleanType(operation.
Type
) &&
2266
ITypeSymbolHelpers.IsBooleanType(operation.Operand.
Type
);
2402
semanticModel: null, operand.Syntax, operand.
Type
, constantValue: null, isImplicit: true);
2451
Debug.Assert(binOp.
Type
is not null);
2452
return new ConversionOperation(condition, _compilation.ClassifyConvertibleConversion(condition, binOp.
Type
, out _), isTryCast: false, isChecked: false,
2453
semanticModel: null, binOp.Syntax, binOp.
Type
, binOp.GetConstantValue(), isImplicit: true);
2465
Debug.Assert(binOp.
Type
is not null);
2488
if (ITypeSymbolHelpers.IsBooleanType(left.
Type
))
2493
else if (ITypeSymbolHelpers.IsDynamicType(left.
Type
) || unaryOperatorMethod != null)
2499
(ITypeSymbolHelpers.IsNullableType(left.
Type
) || !ITypeSymbolHelpers.IsNullableType(unaryOperatorMethod.Parameters[0].Type))))
2525
if (!ITypeSymbolHelpers.IsDynamicType(left.
Type
))
2527
resultFromLeft = CreateConversion(resultFromLeft, binOp.
Type
);
2550
binOp.
Type
,
2585
if (ITypeSymbolHelpers.IsNullableType(left.
Type
))
2640
binOp.
Type
,
2694
AddStatement(new FlowCaptureOperation(captureId, leftSyntax, new LiteralOperation(semanticModel: null, leftSyntax, condition.
Type
, constantValue, isImplicit: true)));
2704
Debug.Assert(ITypeSymbolHelpers.IsBooleanType(condition.
Type
));
2740
lastUnary.
Type
, lastUnary.GetConstantValue(), IsImplicit(lastUnary))
2743
condition.
Type
, constantValue: null, isImplicit: true);
2753
ITypeSymbolHelpers.IsBooleanType(binOp.
Type
) &&
2754
ITypeSymbolHelpers.IsBooleanType(binOp.LeftOperand.
Type
) &&
2755
ITypeSymbolHelpers.IsBooleanType(binOp.RightOperand.
Type
);
2866
if (ITypeSymbolHelpers.IsBooleanType(condition.
Type
))
2871
if (ITypeSymbolHelpers.IsBooleanType(conditional.WhenTrue.
Type
) &&
2872
ITypeSymbolHelpers.IsBooleanType(conditional.WhenFalse.
Type
))
2891
if (ITypeSymbolHelpers.IsBooleanType(condition.
Type
))
2895
if (ITypeSymbolHelpers.IsBooleanType(coalesce.WhenNull.
Type
))
2988
ITypeSymbol? valueTypeOpt = operationValue.
Type
;
3008
(!testConversion.IsIdentity || !ITypeSymbolHelpers.IsNullableType(operation.
Type
)))
3026
isTryCast: false, isChecked: false, semanticModel: null, valueSyntax, operation.
Type
,
3034
convertedTestExpression = MakeInvalidOperation(operation.
Type
, capturedValue);
3129
if (operation.Target?.
Type
?.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T &&
3130
((INamedTypeSymbol)operation.Target.
Type
!).TypeArguments[0].Equals(operation.
Type
))
3232
value: CreateConversion(whenNullValue, operation.Target.
Type
),
3235
type: operation.Target.
Type
,
3268
operation.Syntax, operation.
Type
, constantValue: operation.GetConstantValue(), isImplicit: true);
3330
ITypeSymbol? valueType = value.
Type
;
3355
Debug.Assert(ITypeSymbolHelpers.IsNullableType(value.
Type
));
3357
MakeInvalidOperation(ITypeSymbolHelpers.GetNullableUnderlyingType(value.
Type
), value);
3430
if (ITypeSymbolHelpers.IsNullableType(operation.
Type
) && !ITypeSymbolHelpers.IsNullableType(currentConditionalAccess.WhenNotNull.
Type
))
3434
MakeNullable(access, operation.
Type
)));
3454
Debug.Assert(operation.
Type
is not null);
3457
new DefaultValueOperation(semanticModel: null, defaultValueSyntax, operation.
Type
,
3458
(operation.
Type
.IsReferenceType && !ITypeSymbolHelpers.IsNullableType(operation.
Type
))
3531
ITypeSymbol? testExpressionType = testExpression.
Type
;
4027
return resource.
Type
== null || resource.
Type
.Kind == SymbolKind.DynamicType;
4115
Debug.Assert(resource.
Type
is not null);
4126
Debug.Assert(!isNotNullableValueType(resource.
Type
));
4131
Debug.Assert(resource.
Type
is not null);
4134
if (requiresRuntimeConversion || !isNotNullableValueType(resource.
Type
))
4141
if (!iDisposable.Equals(resource.
Type
) && disposeMethod is null)
4143
if (resource.
Type
.IsReferenceType)
4147
else if (ITypeSymbolHelpers.IsNullableType(resource.
Type
))
4169
((value.
Type
!.Equals(iDisposable) || (!value.
Type
.IsReferenceType && !ITypeSymbolHelpers.IsNullableType(value.
Type
))) && disposeArguments.IsDefaultOrEmpty));
4223
if (operation.LockedValue.
Type
?.IsWellKnownTypeLock() == true)
4225
if (operation.LockedValue.
Type
.TryFindLockTypeInfo() is { } lockTypeInfo)
4317
if (!objectType.Equals(lockedValue.
Type
))
4587
collection = new FlowCaptureReferenceOperation(localCopyCaptureId, operation.Collection.Syntax, collection.
Type
, constantValue: null);
4684
operation.LoopControlVariable.Syntax, operation.LoopControlVariable.
Type
,
4690
operation.LoopControlVariable.
Type
,
4755
ITypeSymbol? stepEnumUnderlyingTypeOrSelf = ITypeSymbolHelpers.GetEnumUnderlyingTypeOrSelf(operation.StepValue.
Type
);
4920
if (ITypeSymbolHelpers.IsNullableType(stepValue.
Type
))
4926
ITypeSymbol? stepValueEnumUnderlyingTypeOrSelf = ITypeSymbolHelpers.GetEnumUnderlyingTypeOrSelf(stepValue.
Type
);
4956
IOperation literal = new LiteralOperation(semanticModel: null, stepValue.Syntax, stepValue.
Type
,
5149
if (ITypeSymbolHelpers.IsNullableType(operation.LimitValue.
Type
))
5257
operation.StepValue.
Type
,
5272
operand.
Type
,
5320
bool isNullable = ITypeSymbolHelpers.IsNullableType(operation.StepValue.
Type
);
5361
controlVariableReferenceForAssignment.
Type
,
5380
Debug.Assert(ITypeSymbolHelpers.IsNullableType(controlVariableReferenceForIncrement.
Type
));
5396
controlVariableReferenceForIncrement.
Type
,
5404
Debug.Assert(controlVariableReferenceForAssignment.
Type
!= null);
5405
increment = MakeNullable(increment, controlVariableReferenceForAssignment.
Type
);
5446
return new FlowCaptureReferenceOperation(id, underlying.Syntax, underlying.
Type
, underlying.GetConstantValue());
5553
bool leftIsNullable = ITypeSymbolHelpers.IsNullableType(operation.Value.
Type
);
5554
bool rightIsNullable = ITypeSymbolHelpers.IsNullableType(compareWith.
Type
);
5566
if (leftOperand.
Type
!= null)
5568
Debug.Assert(compareWith.
Type
!= null);
5569
leftOperand = MakeNullable(leftOperand, compareWith.
Type
);
5572
else if (!rightIsNullable && rightOperand.
Type
!= null)
5574
Debug.Assert(operation.Value.
Type
!= null);
5575
rightOperand = MakeNullable(rightOperand, operation.Value.
Type
);
5665
Debug.Assert(ITypeSymbolHelpers.GetNullableUnderlyingType(type).Equals(operand.
Type
));
5934
operation.
Type
, IsImplicit(operation));
5944
operation.
Type
, IsImplicit(operation));
5976
IOperation initializedInstance = new NoPiaObjectCreationOperation(initializer: null, semanticModel: null, operation.Syntax, operation.
Type
, IsImplicit(operation));
5988
operation.Syntax, operation.
Type
, operation.GetConstantValue(), IsImplicit(operation));
5996
var initializedInstance = new TypeParameterObjectCreationOperation(initializer: null, semanticModel: null, operation.Syntax, operation.
Type
, IsImplicit(operation));
6010
operation.
Type
, IsImplicit(operation));
6097
assignmentOperation.
Type
, assignmentOperation.GetConstantValue(), IsImplicit(assignmentOperation));
6234
fieldReference.Syntax, fieldReference.
Type
, fieldReference.GetConstantValue(), IsImplicit(fieldReference));
6239
eventReference.
Type
, IsImplicit(eventReference));
6245
propertyReference.
Type
, IsImplicit(propertyReference));
6250
return new ArrayElementReferenceOperation(instance, indices, semanticModel: null, originalTarget.Syntax, originalTarget.
Type
, IsImplicit(originalTarget));
6257
semanticModel: null, originalTarget.Syntax, originalTarget.
Type
, IsImplicit(originalTarget));
6270
dynamicReference.
Type
, IsImplicit(dynamicReference));
6360
return MakeInvalidOperation(operation.Syntax, operation.
Type
, ImmutableArray<IOperation>.Empty);
6366
return MakeInvalidOperation(operation.Syntax, operation.
Type
, ImmutableArray<IOperation>.Empty);
6374
operation.Syntax, operation.
Type
, IsImplicit(operation));
6378
Debug.Assert(operation.
Type
is not null);
6379
_currentImplicitInstance = new ImplicitInstanceInfo((INamedTypeSymbol)operation.
Type
);
6399
propertyReference.Instance.Syntax, propertyReference.Instance.
Type
, IsImplicit(propertyReference.Instance));
6401
semanticModel: null, propertyReference.Syntax, propertyReference.
Type
, IsImplicit(propertyReference));
6404
semanticModel: null, simpleAssignment.Syntax, simpleAssignment.
Type
, simpleAssignment.GetConstantValue(), IsImplicit(simpleAssignment));
6418
operation.Syntax, operation.
Type
, IsImplicit(operation));
6492
operation.Syntax, operation.
Type
, IsImplicit(operation));
6571
operation.
Type
,
6596
return MakeInvalidOperation(operation.Syntax, operation.
Type
, ImmutableArray<IOperation>.Empty);
6601
return new FlowCaptureReferenceOperation(_currentInterpolatedStringHandlerCreationContext.HandlerPlaceholder, operation.Syntax, operation.
Type
, operation.GetConstantValue());
6604
return new InstanceReferenceOperation(operation.ReferenceKind, semanticModel: null, operation.Syntax, operation.
Type
, IsImplicit(operation));
6633
dynamicMemberReference.ContainingType, semanticModel: null, dynamicMemberReference.Syntax, dynamicMemberReference.
Type
, IsImplicit(dynamicMemberReference));
6642
((HasDynamicArgumentsExpression)operation).ArgumentRefKinds, semanticModel: null, operation.Syntax, operation.
Type
, IsImplicit(operation));
6653
((HasDynamicArgumentsExpression)operation).ArgumentRefKinds, semanticModel: null, operation.Syntax, operation.
Type
, IsImplicit(operation));
6659
operation.ContainingType, semanticModel: null, operation.Syntax, operation.
Type
, IsImplicit(operation));
6665
return new DeconstructionAssignmentOperation(visitedTarget, visitedValue, semanticModel: null, operation.Syntax, operation.
Type
, IsImplicit(operation));
6703
return new TupleOperation(elementBuilder.ToImmutableAndFree(), tuple.NaturalType, semanticModel: null, tuple.Syntax, tuple.
Type
, IsImplicit(tuple));
6713
return new DeclarationExpressionOperation(VisitPreservingTupleOperations(operation.Expression), semanticModel: null, operation.Syntax, operation.
Type
, IsImplicit(operation));
6761
return new NoneOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, operation.Syntax, operation.
Type
, operation.GetConstantValue(), IsImplicit(operation));
6767
new NoneOperation(VisitArray(((Operation)operation).ChildOperations.ToImmutableArray()), semanticModel: null, operation.Syntax, operation.
Type
, operation.GetConstantValue(), IsImplicit(operation)));
6843
ConditionalBranch(new FlowCaptureReferenceOperation(outParameterFlowCapture, outParameterPlaceholder.Syntax, outParameterPlaceholder.
Type
, constantValue: null), jumpIfTrue: false, resultBlock);
6890
return new FlowCaptureReferenceOperation(handlerCaptureId, operation.Syntax, operation.
Type
, operation.GetConstantValue());
6971
return new FlowCaptureReferenceOperation(_currentInterpolatedStringHandlerCreationContext.OutPlaceholder, operation.Syntax, operation.
Type
, operation.GetConstantValue(), isInitialization: true);
6983
return new InvalidOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, operation.Syntax, operation.
Type
, operation.GetConstantValue(), isImplicit: true);
6996
return new InvalidOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, operation.Syntax, operation.
Type
, operation.GetConstantValue(), isImplicit: true);
7083
return new InterpolatedStringOperation(partsBuilder.ToImmutableAndFree(), semanticModel: null, operation.Syntax, operation.
Type
, operation.GetConstantValue(), IsImplicit(operation));
7099
return new LiteralOperation(semanticModel: null, operation.Syntax, operation.
Type
, operation.GetConstantValue(), IsImplicit(operation));
7104
return new LiteralOperation(semanticModel: null, operation.Syntax, operation.
Type
, operation.GetConstantValue(), IsImplicit(operation));
7109
return new Utf8StringOperation(operation.Value, semanticModel: null, operation.Syntax, operation.
Type
, IsImplicit(operation));
7115
operation.
Type
, operation.GetConstantValue(), IsImplicit(operation));
7121
operation.
Type
, IsImplicit(operation));
7128
operation.Syntax, operation.
Type
, operation.GetConstantValue(), IsImplicit(operation));
7135
operation.Syntax, operation.
Type
, IsImplicit(operation));
7155
return MakeInvalidOperation(operation.Syntax, operation.
Type
, ImmutableArray<IOperation>.Empty);
7164
operation.Syntax, operation.
Type
, IsImplicit(operation));
7171
operation.Syntax, operation.
Type
, IsImplicit(operation));
7176
return new TypeOfOperation(operation.TypeOperand, semanticModel: null, operation.Syntax, operation.
Type
, IsImplicit(operation));
7181
return new ParenthesizedOperation(VisitRequired(operation.Operand), semanticModel: null, operation.Syntax, operation.
Type
, operation.GetConstantValue(), IsImplicit(operation));
7186
return new AwaitOperation(VisitRequired(operation.Operation), semanticModel: null, operation.Syntax, operation.
Type
, IsImplicit(operation));
7191
return new SizeOfOperation(operation.TypeOperand, semanticModel: null, operation.Syntax, operation.
Type
, operation.GetConstantValue(), IsImplicit(operation));
7201
return new IsTypeOperation(VisitRequired(operation.ValueOperand), operation.TypeOperand, operation.IsNegated, semanticModel: null, operation.Syntax, operation.
Type
, IsImplicit(operation));
7280
initializer.Syntax, rewrittenTarget.
Type
, constantValue: null, isImplicit: true);
7308
semanticModel: null, operation.EventReference.Syntax, operation.EventReference.
Type
, IsImplicit(operation.EventReference));
7321
operation.Syntax, operation.
Type
, IsImplicit(operation));
7354
semanticModel: null, operation.EventReference.Syntax, operation.EventReference.
Type
, IsImplicit(operation.EventReference));
7363
return new AddressOfOperation(VisitRequired(operation.Reference), semanticModel: null, operation.Syntax, operation.
Type
, IsImplicit(operation));
7370
operation.Kind, semanticModel: null, operation.Syntax, operation.
Type
, IsImplicit(operation));
7375
return new DiscardOperation(operation.DiscardSymbol, semanticModel: null, operation.Syntax, operation.
Type
, IsImplicit(operation));
7385
return new OmittedArgumentOperation(semanticModel: null, operation.Syntax, operation.
Type
, IsImplicit(operation));
7419
return new PlaceholderOperation(operation.PlaceholderKind, semanticModel: null, operation.Syntax, operation.
Type
, IsImplicit(operation));
7424
return new ConversionOperation(VisitRequired(operation.Operand), ((ConversionOperation)operation).ConversionConvertible, operation.IsTryCast, operation.IsChecked, semanticModel: null, operation.Syntax, operation.
Type
, operation.GetConstantValue(), IsImplicit(operation));
7429
return new DefaultValueOperation(semanticModel: null, operation.Syntax, operation.
Type
, operation.GetConstantValue(), IsImplicit(operation));
7440
operation.Syntax, operation.
Type
, IsImplicit(operation));
7472
IOperation initializedInstance = new InvalidOperation(children.ToImmutableAndFree(), semanticModel: null, operation.Syntax, operation.
Type
,
7496
return new InvalidOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, invalidOperation.Syntax, invalidOperation.
Type
, invalidOperation.GetConstantValue(), IsImplicit(invalidOperation));
7503
invalidOperation.Syntax, invalidOperation.
Type
, invalidOperation.GetConstantValue(), IsImplicit(operation)));
7545
return new TranslatedQueryOperation(VisitRequired(operation.Operation), semanticModel: null, operation.Syntax, operation.
Type
, IsImplicit(operation));
7696
operation.Syntax, operation.
Type
, IsImplicit(operation));
7714
return new RangeOperation(visitedLeftOperand, visitedRightOperand, operation.IsLifted, operation.Method, semanticModel: null, operation.Syntax, operation.
Type
, isImplicit: IsImplicit(operation));
7917
if (operation.
Type
!.IsAnonymousType)
7926
if (operation.
Type
.IsValueType)
7933
? MakeInvalidOperation(visitedInstance.
Type
, visitedInstance)
7936
semanticModel: null, operation.Syntax, operation.
Type
, isImplicit: true);
8013
operation.Operand.
Type
, constantValue: operation.Operand.GetConstantValue());
8034
operation.Operand.
Type
, constantValue: operation.Operand.GetConstantValue());
8044
operation.Operand.
Type
, constantValue: operation.Operand.GetConstantValue());
Operations\OperationCloner.cs (5)
21
return new NoneOperation(VisitArray(((Operation)operation).ChildOperations.ToImmutableArray()), ((Operation)operation).OwningSemanticModel, operation.Syntax, operation.
Type
, operation.GetConstantValue(), operation.IsImplicit);
32
return new DynamicObjectCreationOperation(Visit(operation.Initializer), VisitArray(operation.Arguments), ((HasDynamicArgumentsExpression)operation).ArgumentNames, ((HasDynamicArgumentsExpression)operation).ArgumentRefKinds, ((Operation)operation).OwningSemanticModel, operation.Syntax, operation.
Type
, operation.IsImplicit);
37
return new DynamicInvocationOperation(Visit(operation.Operation), VisitArray(operation.Arguments), ((HasDynamicArgumentsExpression)operation).ArgumentNames, ((HasDynamicArgumentsExpression)operation).ArgumentRefKinds, ((Operation)operation).OwningSemanticModel, operation.Syntax, operation.
Type
, operation.IsImplicit);
42
return new DynamicIndexerAccessOperation(Visit(operation.Operation), VisitArray(operation.Arguments), ((HasDynamicArgumentsExpression)operation).ArgumentNames, ((HasDynamicArgumentsExpression)operation).ArgumentRefKinds, ((Operation)operation).OwningSemanticModel, operation.Syntax, operation.
Type
, operation.IsImplicit);
47
return new InvalidOperation(VisitArray(((InvalidOperation)operation).Children), ((Operation)operation).OwningSemanticModel, operation.Syntax, operation.
Type
, operation.GetConstantValue(), operation.IsImplicit);
Operations\OperationExtensions.cs (1)
22
return ((IFunctionPointerTypeSymbol)functionPointer.Target.
Type
!).Signature;
Microsoft.CodeAnalysis.CodeStyle (25)
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.OperationDeconstructor.cs (1)
123
Equals(_method.ContainingType.BaseType, instanceReference.
Type
))
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchDiagnosticAnalyzer.cs (1)
60
var type = value.
Type
;
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchExpressionDiagnosticAnalyzer.cs (1)
27
=> operation.Value.
Type
is null;
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchStatementDiagnosticAnalyzer.cs (1)
27
=> operation.Value.
Type
is null;
src\Analyzers\Core\Analyzers\PopulateSwitch\PopulateSwitchExpressionHelpers.cs (2)
19
var switchExpressionType = switchExpression?.
Type
;
108
var type = operation.Value.
Type
;
src\Analyzers\Core\Analyzers\PopulateSwitch\PopulateSwitchStatementHelpers.cs (2)
58
var switchExpressionType = switchExpression?.
Type
;
185
var type = operation.Value.
Type
;
src\Analyzers\Core\Analyzers\RemoveRedundantEquality\AbstractRemoveRedundantEqualityDiagnosticAnalyzer.cs (2)
85
var leftType = leftOperand.
Type
;
86
var rightType = rightOperand.
Type
;
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (6)
175
if (value.
Type
== null ||
176
value.
Type
.IsErrorType() ||
177
value.
Type
.SpecialType == SpecialType.System_Void)
183
if (value.
Type
.TypeKind == TypeKind.Dynamic)
311
if (!operation.
Type
.IsDelegateType())
341
if (assignmentOperation.Target.
Type
.IsDelegateType() &&
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (3)
84
instance.
Type
!= null &&
85
!instance.
Type
.IsRefLikeType)
92
instance.
Type
.Implements(systemIFormattable))
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\UseConditionalExpressionForAssignmentHelpers.cs (2)
69
!AreEqualOrHaveImplicitConversion(trueAssignment.
Type
, falseAssignment.
Type
, trueAssignment.SemanticModel!.Compilation))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (2)
375
=> operation.Kind == OperationKind.Literal && operation.
Type
.IsNumericType();
454
notImplementedExceptionType.Equals(objectCreation.
Type
);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (2)
364
operation.Value.
Type
.IsDelegateType())
500
Debug.Assert(operation.
Type
.IsDelegateType());
Microsoft.CodeAnalysis.CodeStyle.Fixes (9)
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchExpressionCodeFixProvider.cs (1)
44
=> switchExpression.Value.
Type
?? throw ExceptionUtilities.Unreachable();
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchStatementCodeFixProvider.cs (1)
60
=> switchOperation.Value.
Type
?? throw ExceptionUtilities.Unreachable();
src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (5)
177
conversion.
Type
!= null &&
178
conversion.
Type
.TypeKind != TypeKind.Error)
182
if (conversion.Operand.
Type
== null || conversion.Operand.
Type
.TypeKind != TypeKind.Error)
184
return (TExpressionSyntax)generator.CastExpression(conversion.
Type
, sourceSyntax);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (2)
276
var valueType = (operation as IIsPatternOperation)?.Value.
Type
?.SpecialType;
457
var type = variableExpression.
Type
;
Microsoft.CodeAnalysis.CSharp (2)
Compilation\CSharpCompilation.cs (1)
2340
ITypeSymbol? sourceType = source.
Type
;
Operations\CSharpOperationFactory_Methods.cs (1)
465
ITypeSymbol? assignmentType = target.
Type
;
Microsoft.CodeAnalysis.CSharp.CodeStyle (30)
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (3)
259
return instance is {
Type
.TypeKind: TypeKind.Struct } ||
260
instance is {
Type
: ITypeParameterSymbol { HasReferenceTypeConstraint: false } };
364
if (conversion.IsInlineArray && conversionOperation.
Type
.IsSpan())
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
138
if (operation?.Parent is IAssignmentOperation {
Type
.TypeKind: TypeKind.Dynamic })
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseNullCheckOverTypeCheckDiagnosticAnalyzer.cs (2)
106
if (isTypeOperation.ValueOperand.
Type
is not null &&
107
isTypeOperation.ValueOperand.
Type
.InheritsFromOrEquals(isTypeOperation.TypeOperand))
src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (1)
248
=> value.UnwrapImplicitConversion() is IObjectCreationOperation {
Type
.SpecialType: SpecialType.System_Object };
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
78
if (arrayCreationOperation.
Type
is not IArrayTypeSymbol { ElementType.SpecialType: SpecialType.System_Byte })
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (21)
96
while (current is IConversionOperation {
Type
.SpecialType: SpecialType.System_Delegate or SpecialType.System_MulticastDelegate })
99
if (current is IConversionOperation {
Type
.SpecialType: SpecialType.System_Object })
106
if (current.Parent is IConversionOperation {
Type
: { } parentConversionType, IsImplicit: false } &&
235
conversionOperation.
Type
.RemoveNullableIfPresent() is var type1 &&
236
conversionOperation.Operand.
Type
.RemoveNullableIfPresent() is var type2 &&
252
if (originalDelegateCreationOperation.
Type
?.TypeKind != TypeKind.Delegate)
269
if (rewrittenDelegateCreationOperation.
Type
?.TypeKind != TypeKind.Delegate)
273
if (!Equals(originalDelegateCreationOperation.
Type
, rewrittenDelegateCreationOperation.
Type
))
409
var isAcceptableSpanConversion = originalConversionOperation.
Type
.IsSpan() && originalParentConversionOperation.
Type
.IsReadOnlySpan();
552
if (castNode.IsParentKind(SyntaxKind.Interpolation) && originalConversionOperation.
Type
?.SpecialType is SpecialType.System_Object)
780
if (!IsSignedIntegralOrIntPtrType(originalConversionOperation.
Type
) ||
781
!IsSignedIntegralOrIntPtrType(originalConversionOperation.Operand.
Type
))
807
var originalConvertedType = originalConversionOperation.
Type
;
808
var rewrittenBitwiseNotConversionType = rewrittenBitwiseNotConversionOperation.
Type
;
885
if (castType.Equals(rewrittenConditionalOperation.
Type
, SymbolEqualityComparer.IncludeNullability))
890
castType.Equals(conditionalParentConversion.
Type
, SymbolEqualityComparer.IncludeNullability))
916
if (binaryOperation.LeftOperand.
Type
?.SpecialType == SpecialType.System_Object &&
923
else if (binaryOperation.RightOperand.
Type
?.SpecialType == SpecialType.System_Object &&
946
if (conversionOperation.Operand.
Type
is not INamedTypeSymbol original)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
240
if (argumentOp is not { Value.
Type
: { } valueType, Parameter.Type: { } parameterType })
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (1)
614
IInstanceReferenceOperation thisReference => thisReference.
Type
,
src\Analyzers\CSharp\CodeFixes\UseUtf8StringLiteral\UseUtf8StringLiteralCodeFixProvider.cs (1)
65
conversion.
Type
is INamedTypeSymbol { IsGenericType: true } namedType &&
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Semantics\OutVarTests.cs (1)
1085
Assert.Equal(expectedType, model.GetOperation(decl)?.
Type
);
Microsoft.CodeAnalysis.CSharp.Features (10)
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (3)
259
return instance is {
Type
.TypeKind: TypeKind.Struct } ||
260
instance is {
Type
: ITypeParameterSymbol { HasReferenceTypeConstraint: false } };
364
if (conversion.IsInlineArray && conversionOperation.
Type
.IsSpan())
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
138
if (operation?.Parent is IAssignmentOperation {
Type
.TypeKind: TypeKind.Dynamic })
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseNullCheckOverTypeCheckDiagnosticAnalyzer.cs (2)
106
if (isTypeOperation.ValueOperand.
Type
is not null &&
107
isTypeOperation.ValueOperand.
Type
.InheritsFromOrEquals(isTypeOperation.TypeOperand))
src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (1)
248
=> value.UnwrapImplicitConversion() is IObjectCreationOperation {
Type
.SpecialType: SpecialType.System_Object };
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
78
if (arrayCreationOperation.
Type
is not IArrayTypeSymbol { ElementType.SpecialType: SpecialType.System_Byte })
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (1)
614
IInstanceReferenceOperation thisReference => thisReference.
Type
,
src\Analyzers\CSharp\CodeFixes\UseUtf8StringLiteral\UseUtf8StringLiteralCodeFixProvider.cs (1)
65
conversion.
Type
is INamedTypeSymbol { IsGenericType: true } namedType &&
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (4)
IOperation\IOperationTests_IConversionExpression.cs (4)
183
Assert.Null(initializerOperation.
Type
);
5294
Assert.Equal(CodeAnalysis.NullableAnnotation.Annotated, iopTree.Value.
Type
.NullableAnnotation);
5386
Assert.Equal(conversion.
Type
, typeInfo.ConvertedType);
5387
Assert.Equal(ConversionChildSelector(conversion).
Type
, typeInfo.Type);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (175)
Semantics\DelegateTypeTests.cs (1)
14757
Assert.Equal("System.Func<System.Int32, System.String>", value.
Type
.ToTestDisplayString());
Semantics\DynamicTests.cs (166)
4994
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
5118
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
5241
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
5484
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
5528
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
5705
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
5836
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
5881
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
6039
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
6162
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
6282
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
6390
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
6432
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
6479
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
6523
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
6568
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
6622
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
6688
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
6696
AssertEx.Equal("dynamic", operation.Target.
Type
.ToTestDisplayString());
6697
AssertEx.Equal("System.Int32", operation.Value.
Type
.ToTestDisplayString());
6698
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
6797
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
6805
AssertEx.Equal("dynamic", operation.Target.
Type
.ToTestDisplayString());
6806
AssertEx.Equal("System.Int32", operation.Value.
Type
.ToTestDisplayString());
6807
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
6907
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
6915
AssertEx.Equal("dynamic", operation.Target.
Type
.ToTestDisplayString());
6916
AssertEx.Equal("dynamic", operation.Value.
Type
.ToTestDisplayString());
6917
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
7004
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
7012
AssertEx.Equal("dynamic", operation.Target.
Type
.ToTestDisplayString());
7013
AssertEx.Equal("System.Object", operation.Value.
Type
.ToTestDisplayString());
7014
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
7076
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
7179
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
7189
AssertEx.Equal("dynamic", operation.Target.
Type
.ToTestDisplayString());
7190
AssertEx.Equal("System.Int32", operation.Value.
Type
.ToTestDisplayString());
7191
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
7292
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
7302
AssertEx.Equal("dynamic", operation.Target.
Type
.ToTestDisplayString());
7303
AssertEx.Equal("System.Int32", operation.Value.
Type
.ToTestDisplayString());
7304
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
7408
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
7418
AssertEx.Equal("dynamic", operation.Target.
Type
.ToTestDisplayString());
7419
AssertEx.Equal("dynamic", operation.Value.
Type
.ToTestDisplayString());
7420
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
7521
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
7532
AssertEx.Equal("dynamic", operation.Target.
Type
.ToTestDisplayString());
7533
AssertEx.Equal("C2", operation.Value.
Type
.ToTestDisplayString());
7534
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
7535
Assert.False(operation.
Type
.IsErrorType());
7598
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
7703
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
7713
AssertEx.Equal("dynamic", operation.Target.
Type
.ToTestDisplayString());
7714
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
7809
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
7819
AssertEx.Equal("dynamic", operation.Target.
Type
.ToTestDisplayString());
7820
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
7913
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
7924
AssertEx.Equal("dynamic", operation.Target.
Type
.ToTestDisplayString());
7925
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
7984
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
7994
AssertEx.Equal("dynamic", operation.Target.
Type
.ToTestDisplayString());
7995
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
8090
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
8100
AssertEx.Equal("dynamic", operation.Target.
Type
.ToTestDisplayString());
8101
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
8195
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
8205
AssertEx.Equal("dynamic", operation.Target.
Type
.ToTestDisplayString());
8206
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
8300
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
8308
AssertEx.Equal("dynamic", operation.Target.
Type
.ToTestDisplayString());
8309
AssertEx.Equal("dynamic", operation.Value.
Type
.ToTestDisplayString());
8310
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
8409
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
8417
AssertEx.Equal("dynamic", operation.Target.
Type
.ToTestDisplayString());
8418
AssertEx.Equal("dynamic", operation.Value.
Type
.ToTestDisplayString());
8419
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
8518
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
8526
AssertEx.Equal("dynamic", operation.Target.
Type
.ToTestDisplayString());
8527
AssertEx.Equal("dynamic", operation.Value.
Type
.ToTestDisplayString());
8528
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
8628
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
8636
AssertEx.Equal("dynamic", operation.Target.
Type
.ToTestDisplayString());
8637
AssertEx.Equal("dynamic", operation.Value.
Type
.ToTestDisplayString());
8638
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
8737
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
8745
AssertEx.Equal("dynamic", operation.Target.
Type
.ToTestDisplayString());
8746
AssertEx.Equal("dynamic", operation.Value.
Type
.ToTestDisplayString());
8747
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
8806
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
8814
AssertEx.Equal("dynamic", operation.Target.
Type
.ToTestDisplayString());
8815
AssertEx.Equal("dynamic", operation.Value.
Type
.ToTestDisplayString());
8816
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
8878
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
8886
AssertEx.Equal("dynamic", operation.Target.
Type
.ToTestDisplayString());
8887
AssertEx.Equal("dynamic", operation.Value.
Type
.ToTestDisplayString());
8888
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
8934
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
8942
AssertEx.Equal("dynamic", operation.Target.
Type
.ToTestDisplayString());
8943
AssertEx.Equal("dynamic", operation.Value.
Type
.ToTestDisplayString());
8944
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
9024
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
9032
AssertEx.Equal("dynamic", operation.Target.
Type
.ToTestDisplayString());
9033
AssertEx.Equal("dynamic", operation.Value.
Type
.ToTestDisplayString());
9034
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
9115
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
9123
AssertEx.Equal("dynamic", operation.Target.
Type
.ToTestDisplayString());
9124
AssertEx.Equal("dynamic", operation.Value.
Type
.ToTestDisplayString());
9125
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
9205
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
9213
AssertEx.Equal("dynamic", operation.Target.
Type
.ToTestDisplayString());
9214
AssertEx.Equal("dynamic", operation.Value.
Type
.ToTestDisplayString());
9215
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
9261
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
9269
AssertEx.Equal("dynamic", operation.Target.
Type
.ToTestDisplayString());
9270
AssertEx.Equal("dynamic", operation.Value.
Type
.ToTestDisplayString());
9271
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
9322
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
9330
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
9443
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
9451
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
9563
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
9571
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
9677
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
9685
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
9788
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
9796
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
9899
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
9907
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
10030
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
10045
Assert.Equal(tupleTypeInfo.Type, operation.Target.
Type
);
10046
Assert.Equal(tupleTypeInfo.Type, operation.Value.
Type
);
10047
Assert.Equal(typeInfo.Type, operation.
Type
);
10158
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
10173
Assert.Equal(tupleTypeInfo.Type, operation.Target.
Type
);
10174
Assert.Equal(tupleTypeInfo.Type, operation.Value.
Type
);
10175
Assert.Equal(typeInfo.Type, operation.
Type
);
10286
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
10301
Assert.Equal(tupleTypeInfo.Type, operation.Target.
Type
);
10302
Assert.Equal(tupleTypeInfo.Type, operation.Value.
Type
);
10303
Assert.Equal(typeInfo.Type, operation.
Type
);
10440
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
10455
Assert.Equal(tupleTypeInfo.Type, operation.Target.
Type
);
10456
Assert.Equal(tupleTypeInfo.Type, operation.Value.
Type
);
10457
Assert.Equal(typeInfo.Type, operation.
Type
);
10574
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
10589
Assert.Equal(tupleTypeInfo.Type, operation.Target.
Type
);
10590
Assert.Equal("C2", operation.Value.
Type
.ToTestDisplayString());
10591
Assert.Equal(typeInfo.Type, operation.
Type
);
10722
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
10737
Assert.Equal(tupleTypeInfo.Type, operation.Target.
Type
);
10738
Assert.Equal("C2", operation.Value.
Type
.ToTestDisplayString());
10739
Assert.Equal(typeInfo.Type, operation.
Type
);
10992
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
11007
Assert.Equal(tupleTypeInfo.Type, operation.Target.
Type
);
11008
Assert.Equal("C2", operation.Value.
Type
.ToTestDisplayString());
11009
Assert.Equal(typeInfo.Type, operation.
Type
);
11335
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
11388
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
11464
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
11508
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
11549
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
11601
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
11653
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
11693
AssertEx.Equal("dynamic", operation.
Type
.ToTestDisplayString());
Semantics\ObjectAndCollectionInitializerTests.cs (8)
4236
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
4244
AssertEx.Equal("System.Int32", operation.Target.
Type
.ToTestDisplayString());
4245
AssertEx.Equal("System.Int32", operation.Value.
Type
.ToTestDisplayString());
4246
AssertEx.Equal("System.Int32", operation.
Type
.ToTestDisplayString());
4290
Assert.Equal(typeInfo.Type, propertyRef.
Type
);
4298
AssertEx.Equal("System.Int32", operation.Target.
Type
.ToTestDisplayString());
4299
AssertEx.Equal("System.Int32", operation.Value.
Type
.ToTestDisplayString());
4300
AssertEx.Equal("System.Int32", operation.
Type
.ToTestDisplayString());
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Symbols\Source\NullablePublicAPITests.cs (1)
4968
AssertEx.Equal("(System.Object, System.Int32 a)", operation.
Type
.ToTestDisplayString());
Microsoft.CodeAnalysis.CSharp.Test.Utilities (7)
CompilationTestUtils.cs (7)
361
else if (iop is {
Type
: { } })
363
Assert.Equal(typeInfo.Type.NullableAnnotation, iop.
Type
.NullableAnnotation);
383
Assert.Null(iop?.
Type
);
385
else if (iop is {
Type
: { } })
387
Assert.Equal(typeInfo.ConvertedType.NullableAnnotation, iop.
Type
.NullableAnnotation);
428
Assert.True(iop.
Type
?.NullableAnnotation == typeInfo.ConvertedType?.NullableAnnotation);
432
Assert.Null(iop?.
Type
);
Microsoft.CodeAnalysis.CSharp.Workspaces (22)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (21)
96
while (current is IConversionOperation {
Type
.SpecialType: SpecialType.System_Delegate or SpecialType.System_MulticastDelegate })
99
if (current is IConversionOperation {
Type
.SpecialType: SpecialType.System_Object })
106
if (current.Parent is IConversionOperation {
Type
: { } parentConversionType, IsImplicit: false } &&
235
conversionOperation.
Type
.RemoveNullableIfPresent() is var type1 &&
236
conversionOperation.Operand.
Type
.RemoveNullableIfPresent() is var type2 &&
252
if (originalDelegateCreationOperation.
Type
?.TypeKind != TypeKind.Delegate)
269
if (rewrittenDelegateCreationOperation.
Type
?.TypeKind != TypeKind.Delegate)
273
if (!Equals(originalDelegateCreationOperation.
Type
, rewrittenDelegateCreationOperation.
Type
))
409
var isAcceptableSpanConversion = originalConversionOperation.
Type
.IsSpan() && originalParentConversionOperation.
Type
.IsReadOnlySpan();
552
if (castNode.IsParentKind(SyntaxKind.Interpolation) && originalConversionOperation.
Type
?.SpecialType is SpecialType.System_Object)
780
if (!IsSignedIntegralOrIntPtrType(originalConversionOperation.
Type
) ||
781
!IsSignedIntegralOrIntPtrType(originalConversionOperation.Operand.
Type
))
807
var originalConvertedType = originalConversionOperation.
Type
;
808
var rewrittenBitwiseNotConversionType = rewrittenBitwiseNotConversionOperation.
Type
;
885
if (castType.Equals(rewrittenConditionalOperation.
Type
, SymbolEqualityComparer.IncludeNullability))
890
castType.Equals(conditionalParentConversion.
Type
, SymbolEqualityComparer.IncludeNullability))
916
if (binaryOperation.LeftOperand.
Type
?.SpecialType == SpecialType.System_Object &&
923
else if (binaryOperation.RightOperand.
Type
?.SpecialType == SpecialType.System_Object &&
946
if (conversionOperation.Operand.
Type
is not INamedTypeSymbol original)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
240
if (argumentOp is not { Value.
Type
: { } valueType, Parameter.Type: { } parameterType })
Microsoft.CodeAnalysis.Features (33)
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (1)
207
var collectionType = foreachCollection.
Type
;
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Analyzer.cs (1)
461
_switchTargetType = operation.
Type
;
SignatureHelp\CommonSignatureHelpUtilities.cs (1)
161
var parentType = parentOperation?.
Type
;
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.OperationDeconstructor.cs (1)
123
Equals(_method.ContainingType.BaseType, instanceReference.
Type
))
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchDiagnosticAnalyzer.cs (1)
60
var type = value.
Type
;
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchExpressionDiagnosticAnalyzer.cs (1)
27
=> operation.Value.
Type
is null;
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchStatementDiagnosticAnalyzer.cs (1)
27
=> operation.Value.
Type
is null;
src\Analyzers\Core\Analyzers\PopulateSwitch\PopulateSwitchExpressionHelpers.cs (2)
19
var switchExpressionType = switchExpression?.
Type
;
108
var type = operation.Value.
Type
;
src\Analyzers\Core\Analyzers\PopulateSwitch\PopulateSwitchStatementHelpers.cs (2)
58
var switchExpressionType = switchExpression?.
Type
;
185
var type = operation.Value.
Type
;
src\Analyzers\Core\Analyzers\RemoveRedundantEquality\AbstractRemoveRedundantEqualityDiagnosticAnalyzer.cs (2)
85
var leftType = leftOperand.
Type
;
86
var rightType = rightOperand.
Type
;
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (6)
175
if (value.
Type
== null ||
176
value.
Type
.IsErrorType() ||
177
value.
Type
.SpecialType == SpecialType.System_Void)
183
if (value.
Type
.TypeKind == TypeKind.Dynamic)
311
if (!operation.
Type
.IsDelegateType())
341
if (assignmentOperation.Target.
Type
.IsDelegateType() &&
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (3)
84
instance.
Type
!= null &&
85
!instance.
Type
.IsRefLikeType)
92
instance.
Type
.Implements(systemIFormattable))
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\UseConditionalExpressionForAssignmentHelpers.cs (2)
69
!AreEqualOrHaveImplicitConversion(trueAssignment.
Type
, falseAssignment.
Type
, trueAssignment.SemanticModel!.Compilation))
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchExpressionCodeFixProvider.cs (1)
44
=> switchExpression.Value.
Type
?? throw ExceptionUtilities.Unreachable();
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchStatementCodeFixProvider.cs (1)
60
=> switchOperation.Value.
Type
?? throw ExceptionUtilities.Unreachable();
src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (5)
177
conversion.
Type
!= null &&
178
conversion.
Type
.TypeKind != TypeKind.Error)
182
if (conversion.Operand.
Type
== null || conversion.Operand.
Type
.TypeKind != TypeKind.Error)
184
return (TExpressionSyntax)generator.CastExpression(conversion.
Type
, sourceSyntax);
ValueTracking\ValueTracker.OperationCollector.cs (2)
154
if (literalOperation.
Type
is null)
159
return AddOperationAsync(literalOperation, literalOperation.
Type
, cancellationToken);
Microsoft.CodeAnalysis.Test.Utilities (52)
Compilation\CompilationExtensions.cs (2)
302
Assert.True(operation.
Type
== null || !operation.MustHaveNullType(), $"Unexpected non-null type: {operation.
Type
}");
Compilation\ControlFlowGraphVerifier.cs (11)
916
&& arguments[0].Value.
Type
.SpecialType == SpecialType.System_Int32
917
&& arguments[1].Value.
Type
.SpecialType == SpecialType.System_Int32;
949
(ITypeSymbolHelpers.IsDynamicType(binOp.
Type
) &&
950
(ITypeSymbolHelpers.IsDynamicType(binOp.LeftOperand.
Type
) || ITypeSymbolHelpers.IsDynamicType(binOp.RightOperand.
Type
)))))
999
ITypeSymbolHelpers.IsNullableType(reference.
Type
) &&
1878
!ITypeSymbolHelpers.IsBooleanType(binary.
Type
) &&
1879
!ITypeSymbolHelpers.IsNullableOfBoolean(binary.
Type
) &&
1880
!ITypeSymbolHelpers.IsObjectType(binary.
Type
) &&
1881
!ITypeSymbolHelpers.IsDynamicType(binary.
Type
));
1892
n.
Type
.IsAnonymousType &&
Compilation\OperationTreeVerifier.cs (6)
107
LogType(operation.
Type
);
321
Assert.True(operation.
Type
== null || !operation.MustHaveNullType(), $"Unexpected non-null type: {operation.
Type
}");
1092
Assert.Null(operation.
Type
);
1148
Assert.NotNull(operation.
Type
);
1624
Assert.Null(operation.
Type
);
Compilation\TestOperationVisitor.cs (11)
47
var type = operation.
Type
;
571
Assert.Same(((IFunctionPointerTypeSymbol)operation.Target.
Type
).Signature, signature);
729
Assert.NotNull(operation.
Type
);
1026
if (!operation.
Type
.IsValueType)
1152
Assert.Null(operation.
Type
);
1361
Assert.Null(pattern.
Type
);
1549
Assert.NotNull(operation.
Type
);
1559
Assert.Null(operation.
Type
);
1689
Assert.Equal(operation.
Type
, discardSymbol.Type);
1725
Assert.NotNull(operation.Value.
Type
);
1800
Assert.Null(operation.
Type
);
Diagnostics\BoxingOperationAnalyzer.cs (4)
48
if (conversion.
Type
.IsReferenceType &&
49
conversion.Operand.
Type
!= null &&
50
conversion.Operand.
Type
.IsValueType &&
63
invocation.Instance.
Type
.IsValueType &&
Diagnostics\CouldHaveMoreSpecificTypeAnalyzer.cs (3)
67
ITypeSymbol type = increment.
Type
;
286
return conversion.Operand.
Type
;
290
return value.
Type
;
Diagnostics\FieldCouldBeReadOnlyAnalyzer.cs (1)
135
if (fieldReference.Instance != null && fieldReference.Instance.
Type
.IsValueType)
Diagnostics\LocalCouldBeConstAnalyzer.cs (1)
126
if (fieldReference.Instance != null && fieldReference.Instance.
Type
.IsValueType)
Diagnostics\OperationTestAnalyzer.cs (13)
57
if (invalidOperation.
Type
== null)
159
conditionRight.
Type
.SpecialType == SpecialType.System_Int32 &&
176
setupAssignment.Value.
Type
.SpecialType == SpecialType.System_Int32)
241
advanceAssignment.Value.
Type
.SpecialType == SpecialType.System_Int32)
250
advanceOperation.RightOperand.
Type
.SpecialType == SpecialType.System_Int32)
265
advanceAssignment.Value.
Type
.SpecialType == SpecialType.System_Int32)
357
singleValueExpression.
Type
.SpecialType == SpecialType.System_Int32)
377
rangeMinExpression.
Type
.SpecialType == SpecialType.System_Int32 &&
380
rangeMaxExpression.
Type
.SpecialType == SpecialType.System_Int32)
400
relationalValueExpression.
Type
.SpecialType == SpecialType.System_Int32)
587
if (argumentValue.HasValue && argument.
Type
.SpecialType == SpecialType.System_Int32)
631
if (literal.
Type
.SpecialType == SpecialType.System_Int32 &&
1521
if (binary.OperatorKind == BinaryOperatorKind.Multiply && binary.
Type
.SpecialType == SpecialType.System_Double)
Microsoft.CodeAnalysis.VisualBasic (3)
Compilation\VisualBasicCompilation.vb (1)
1905
Dim sourceType As ITypeSymbol = source.
Type
Operations\VisualBasicOperationFactory_Methods.vb (2)
349
Dim type As ITypeSymbol = target.
Type
521
adjustedInfo.Operation.
Type
,
Microsoft.CodeAnalysis.Workspaces (6)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (2)
375
=> operation.Kind == OperationKind.Literal && operation.
Type
.IsNumericType();
454
notImplementedExceptionType.Equals(objectCreation.
Type
);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (2)
364
operation.Value.
Type
.IsDelegateType())
500
Debug.Assert(operation.
Type
.IsDelegateType());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (2)
276
var valueType = (operation as IIsPatternOperation)?.Value.
Type
?.SpecialType;
457
var type = variableExpression.
Type
;
Microsoft.Interop.ComInterfaceGenerator (10)
Analyzers\ComHostingDoesNotSupportGeneratedComInterfaceAnalyzer.cs (1)
45
|| !comVisibleAttribute.Equals(ctor.
Type
, SymbolEqualityComparer.Default)
Analyzers\RuntimeComApiUsageWithSourceGeneratedComAnalyzer.cs (9)
143
if (operation.
Type
is INamedTypeSymbol { IsComImport: true } && !enableGeneratedComInterfaceComImportInterop)
146
if (operand is IConversionOperation {
Type
.SpecialType: SpecialType.System_Object } objConversion)
150
if (operand.
Type
is null)
158
if (recognizer(operand.
Type
))
171
if (recognizer(operation.
Type
))
174
if (operand is IConversionOperation {
Type
.SpecialType: SpecialType.System_Object } objConversion)
178
if (operand.
Type
is INamedTypeSymbol { IsComImport: true } && !enableGeneratedComInterfaceComImportInterop)
202
IConversionOperation conversion => (conversion.Operand.
Type
, conversion.Operand.Syntax.GetLocation()),
203
IOperation op => (op.
Type
, op.Syntax.GetLocation())
Microsoft.Interop.LibraryImportGenerator (2)
Analyzers\CustomMarshallerAttributeAnalyzer.cs (1)
646
&& attrCreation.
Type
.Equals(_customMarshallerAttribute, SymbolEqualityComparer.Default))
Analyzers\NativeMarshallingAttributeAnalyzer.cs (1)
88
&& attrCreation.
Type
.ToDisplayString() == TypeNames.NativeMarshallingAttribute)
System.Text.RegularExpressions.Generator (1)
UpgradeToGeneratedRegexAnalyzer.cs (1)
126
if (!SymbolEqualityComparer.Default.Equals(operation.
Type
, regexTypeSymbol))