130 implementations of Type
Microsoft.CodeAnalysis (129)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
937 references to Type
ConfigurationSchemaGenerator (3)
ILLink.RoslynAnalyzer (5)
Metrics (11)
Metrics.Legacy (11)
Microsoft.Analyzers.Extra (13)
Microsoft.Analyzers.Local (5)
Microsoft.AspNetCore.App.Analyzers (6)
Microsoft.AspNetCore.Mvc.Api.Analyzers (4)
Microsoft.CodeAnalysis (199)
Operations\ControlFlowGraphBuilder.cs (192)
1412return result ?? MakeInvalidOperation(originalOperation.Syntax, originalOperation.Type, ImmutableArray<IOperation>.Empty);
2104return PopStackFrame(frame, new SimpleAssignmentOperation(operation.IsRef, PopOperand(), value, null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation)));
2116syntax: operation.Syntax, type: operation.Type, isImplicit: IsImplicit(operation)));
2127operation.Syntax, operation.Type, IsImplicit(operation));
2138operation.Syntax, operation.Type, IsImplicit(operation));
2149operation.Syntax, operation.Type, IsImplicit(operation));
2170if (ITypeSymbolHelpers.IsBooleanType(operation.Type) &&
2171ITypeSymbolHelpers.IsBooleanType(operation.LeftOperand.Type) &&
2172ITypeSymbolHelpers.IsBooleanType(operation.RightOperand.Type))
2178ITypeSymbolHelpers.IsNullableOfBoolean(operation.Type) &&
2179ITypeSymbolHelpers.IsNullableOfBoolean(operation.LeftOperand.Type) &&
2180ITypeSymbolHelpers.IsNullableOfBoolean(operation.RightOperand.Type))
2185else if (ITypeSymbolHelpers.IsObjectType(operation.Type) &&
2186ITypeSymbolHelpers.IsObjectType(operation.LeftOperand.Type) &&
2187ITypeSymbolHelpers.IsObjectType(operation.RightOperand.Type))
2191else if (ITypeSymbolHelpers.IsDynamicType(operation.Type) &&
2192(ITypeSymbolHelpers.IsDynamicType(operation.LeftOperand.Type) ||
2193ITypeSymbolHelpers.IsDynamicType(operation.RightOperand.Type)))
2232semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation)));
2246semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
2258semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation));
2265ITypeSymbolHelpers.IsBooleanType(operation.Type) &&
2266ITypeSymbolHelpers.IsBooleanType(operation.Operand.Type);
2402semanticModel: null, operand.Syntax, operand.Type, constantValue: null, isImplicit: true);
2451Debug.Assert(binOp.Type is not null);
2452return new ConversionOperation(condition, _compilation.ClassifyConvertibleConversion(condition, binOp.Type, out _), isTryCast: false, isChecked: false,
2453semanticModel: null, binOp.Syntax, binOp.Type, binOp.GetConstantValue(), isImplicit: true);
2465Debug.Assert(binOp.Type is not null);
2488if (ITypeSymbolHelpers.IsBooleanType(left.Type))
2493else if (ITypeSymbolHelpers.IsDynamicType(left.Type) || unaryOperatorMethod != null)
2499(ITypeSymbolHelpers.IsNullableType(left.Type) || !ITypeSymbolHelpers.IsNullableType(unaryOperatorMethod.Parameters[0].Type))))
2525if (!ITypeSymbolHelpers.IsDynamicType(left.Type))
2527resultFromLeft = CreateConversion(resultFromLeft, binOp.Type);
2550binOp.Type,
2585if (ITypeSymbolHelpers.IsNullableType(left.Type))
2640binOp.Type,
2694AddStatement(new FlowCaptureOperation(captureId, leftSyntax, new LiteralOperation(semanticModel: null, leftSyntax, condition.Type, constantValue, isImplicit: true)));
2704Debug.Assert(ITypeSymbolHelpers.IsBooleanType(condition.Type));
2740lastUnary.Type, lastUnary.GetConstantValue(), IsImplicit(lastUnary))
2743condition.Type, constantValue: null, isImplicit: true);
2753ITypeSymbolHelpers.IsBooleanType(binOp.Type) &&
2754ITypeSymbolHelpers.IsBooleanType(binOp.LeftOperand.Type) &&
2755ITypeSymbolHelpers.IsBooleanType(binOp.RightOperand.Type);
2866if (ITypeSymbolHelpers.IsBooleanType(condition.Type))
2871if (ITypeSymbolHelpers.IsBooleanType(conditional.WhenTrue.Type) &&
2872ITypeSymbolHelpers.IsBooleanType(conditional.WhenFalse.Type))
2891if (ITypeSymbolHelpers.IsBooleanType(condition.Type))
2895if (ITypeSymbolHelpers.IsBooleanType(coalesce.WhenNull.Type))
2988ITypeSymbol? valueTypeOpt = operationValue.Type;
3008(!testConversion.IsIdentity || !ITypeSymbolHelpers.IsNullableType(operation.Type)))
3026isTryCast: false, isChecked: false, semanticModel: null, valueSyntax, operation.Type,
3034convertedTestExpression = MakeInvalidOperation(operation.Type, capturedValue);
3129if (operation.Target?.Type?.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T &&
3130((INamedTypeSymbol)operation.Target.Type!).TypeArguments[0].Equals(operation.Type))
3232value: CreateConversion(whenNullValue, operation.Target.Type),
3235type: operation.Target.Type,
3268operation.Syntax, operation.Type, constantValue: operation.GetConstantValue(), isImplicit: true);
3330ITypeSymbol? valueType = value.Type;
3355Debug.Assert(ITypeSymbolHelpers.IsNullableType(value.Type));
3357MakeInvalidOperation(ITypeSymbolHelpers.GetNullableUnderlyingType(value.Type), value);
3430if (ITypeSymbolHelpers.IsNullableType(operation.Type) && !ITypeSymbolHelpers.IsNullableType(currentConditionalAccess.WhenNotNull.Type))
3434MakeNullable(access, operation.Type)));
3454Debug.Assert(operation.Type is not null);
3457new DefaultValueOperation(semanticModel: null, defaultValueSyntax, operation.Type,
3458(operation.Type.IsReferenceType && !ITypeSymbolHelpers.IsNullableType(operation.Type))
3531ITypeSymbol? testExpressionType = testExpression.Type;
4027return resource.Type == null || resource.Type.Kind == SymbolKind.DynamicType;
4115Debug.Assert(resource.Type is not null);
4126Debug.Assert(!isNotNullableValueType(resource.Type));
4131Debug.Assert(resource.Type is not null);
4134if (requiresRuntimeConversion || !isNotNullableValueType(resource.Type))
4141if (!iDisposable.Equals(resource.Type) && disposeMethod is null)
4143if (resource.Type.IsReferenceType)
4147else if (ITypeSymbolHelpers.IsNullableType(resource.Type))
4169((value.Type!.Equals(iDisposable) || (!value.Type.IsReferenceType && !ITypeSymbolHelpers.IsNullableType(value.Type))) && disposeArguments.IsDefaultOrEmpty));
4223if (operation.LockedValue.Type?.IsWellKnownTypeLock() == true)
4225if (operation.LockedValue.Type.TryFindLockTypeInfo() is { } lockTypeInfo)
4317if (!objectType.Equals(lockedValue.Type))
4587collection = new FlowCaptureReferenceOperation(localCopyCaptureId, operation.Collection.Syntax, collection.Type, constantValue: null);
4684operation.LoopControlVariable.Syntax, operation.LoopControlVariable.Type,
4690operation.LoopControlVariable.Type,
4755ITypeSymbol? stepEnumUnderlyingTypeOrSelf = ITypeSymbolHelpers.GetEnumUnderlyingTypeOrSelf(operation.StepValue.Type);
4920if (ITypeSymbolHelpers.IsNullableType(stepValue.Type))
4926ITypeSymbol? stepValueEnumUnderlyingTypeOrSelf = ITypeSymbolHelpers.GetEnumUnderlyingTypeOrSelf(stepValue.Type);
4956IOperation literal = new LiteralOperation(semanticModel: null, stepValue.Syntax, stepValue.Type,
5149if (ITypeSymbolHelpers.IsNullableType(operation.LimitValue.Type))
5257operation.StepValue.Type,
5272operand.Type,
5320bool isNullable = ITypeSymbolHelpers.IsNullableType(operation.StepValue.Type);
5361controlVariableReferenceForAssignment.Type,
5380Debug.Assert(ITypeSymbolHelpers.IsNullableType(controlVariableReferenceForIncrement.Type));
5396controlVariableReferenceForIncrement.Type,
5404Debug.Assert(controlVariableReferenceForAssignment.Type != null);
5405increment = MakeNullable(increment, controlVariableReferenceForAssignment.Type);
5446return new FlowCaptureReferenceOperation(id, underlying.Syntax, underlying.Type, underlying.GetConstantValue());
5553bool leftIsNullable = ITypeSymbolHelpers.IsNullableType(operation.Value.Type);
5554bool rightIsNullable = ITypeSymbolHelpers.IsNullableType(compareWith.Type);
5566if (leftOperand.Type != null)
5568Debug.Assert(compareWith.Type != null);
5569leftOperand = MakeNullable(leftOperand, compareWith.Type);
5572else if (!rightIsNullable && rightOperand.Type != null)
5574Debug.Assert(operation.Value.Type != null);
5575rightOperand = MakeNullable(rightOperand, operation.Value.Type);
5665Debug.Assert(ITypeSymbolHelpers.GetNullableUnderlyingType(type).Equals(operand.Type));
5934operation.Type, IsImplicit(operation));
5944operation.Type, IsImplicit(operation));
5976IOperation initializedInstance = new NoPiaObjectCreationOperation(initializer: null, semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
5988operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation));
5996var initializedInstance = new TypeParameterObjectCreationOperation(initializer: null, semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
6010operation.Type, IsImplicit(operation));
6097assignmentOperation.Type, assignmentOperation.GetConstantValue(), IsImplicit(assignmentOperation));
6234fieldReference.Syntax, fieldReference.Type, fieldReference.GetConstantValue(), IsImplicit(fieldReference));
6239eventReference.Type, IsImplicit(eventReference));
6245propertyReference.Type, IsImplicit(propertyReference));
6250return new ArrayElementReferenceOperation(instance, indices, semanticModel: null, originalTarget.Syntax, originalTarget.Type, IsImplicit(originalTarget));
6257semanticModel: null, originalTarget.Syntax, originalTarget.Type, IsImplicit(originalTarget));
6270dynamicReference.Type, IsImplicit(dynamicReference));
6360return MakeInvalidOperation(operation.Syntax, operation.Type, ImmutableArray<IOperation>.Empty);
6366return MakeInvalidOperation(operation.Syntax, operation.Type, ImmutableArray<IOperation>.Empty);
6374operation.Syntax, operation.Type, IsImplicit(operation));
6378Debug.Assert(operation.Type is not null);
6379_currentImplicitInstance = new ImplicitInstanceInfo((INamedTypeSymbol)operation.Type);
6399propertyReference.Instance.Syntax, propertyReference.Instance.Type, IsImplicit(propertyReference.Instance));
6401semanticModel: null, propertyReference.Syntax, propertyReference.Type, IsImplicit(propertyReference));
6404semanticModel: null, simpleAssignment.Syntax, simpleAssignment.Type, simpleAssignment.GetConstantValue(), IsImplicit(simpleAssignment));
6418operation.Syntax, operation.Type, IsImplicit(operation));
6492operation.Syntax, operation.Type, IsImplicit(operation));
6571operation.Type,
6596return MakeInvalidOperation(operation.Syntax, operation.Type, ImmutableArray<IOperation>.Empty);
6601return new FlowCaptureReferenceOperation(_currentInterpolatedStringHandlerCreationContext.HandlerPlaceholder, operation.Syntax, operation.Type, operation.GetConstantValue());
6604return new InstanceReferenceOperation(operation.ReferenceKind, semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
6633dynamicMemberReference.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));
6659operation.ContainingType, semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
6665return new DeconstructionAssignmentOperation(visitedTarget, visitedValue, semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
6703return new TupleOperation(elementBuilder.ToImmutableAndFree(), tuple.NaturalType, semanticModel: null, tuple.Syntax, tuple.Type, IsImplicit(tuple));
6713return new DeclarationExpressionOperation(VisitPreservingTupleOperations(operation.Expression), semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
6761return new NoneOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation));
6767new NoneOperation(VisitArray(((Operation)operation).ChildOperations.ToImmutableArray()), semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation)));
6843ConditionalBranch(new FlowCaptureReferenceOperation(outParameterFlowCapture, outParameterPlaceholder.Syntax, outParameterPlaceholder.Type, constantValue: null), jumpIfTrue: false, resultBlock);
6890return new FlowCaptureReferenceOperation(handlerCaptureId, operation.Syntax, operation.Type, operation.GetConstantValue());
6971return new FlowCaptureReferenceOperation(_currentInterpolatedStringHandlerCreationContext.OutPlaceholder, operation.Syntax, operation.Type, operation.GetConstantValue(), isInitialization: true);
6983return new InvalidOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), isImplicit: true);
6996return new InvalidOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), isImplicit: true);
7083return new InterpolatedStringOperation(partsBuilder.ToImmutableAndFree(), semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation));
7099return new LiteralOperation(semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation));
7104return new LiteralOperation(semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation));
7109return new Utf8StringOperation(operation.Value, semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
7115operation.Type, operation.GetConstantValue(), IsImplicit(operation));
7121operation.Type, IsImplicit(operation));
7128operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation));
7135operation.Syntax, operation.Type, IsImplicit(operation));
7155return MakeInvalidOperation(operation.Syntax, operation.Type, ImmutableArray<IOperation>.Empty);
7164operation.Syntax, operation.Type, IsImplicit(operation));
7171operation.Syntax, operation.Type, IsImplicit(operation));
7176return new TypeOfOperation(operation.TypeOperand, semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
7181return new ParenthesizedOperation(VisitRequired(operation.Operand), semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation));
7186return new AwaitOperation(VisitRequired(operation.Operation), semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
7191return new SizeOfOperation(operation.TypeOperand, semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation));
7201return new IsTypeOperation(VisitRequired(operation.ValueOperand), operation.TypeOperand, operation.IsNegated, semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
7280initializer.Syntax, rewrittenTarget.Type, constantValue: null, isImplicit: true);
7308semanticModel: null, operation.EventReference.Syntax, operation.EventReference.Type, IsImplicit(operation.EventReference));
7321operation.Syntax, operation.Type, IsImplicit(operation));
7354semanticModel: null, operation.EventReference.Syntax, operation.EventReference.Type, IsImplicit(operation.EventReference));
7363return new AddressOfOperation(VisitRequired(operation.Reference), semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
7370operation.Kind, semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
7375return new DiscardOperation(operation.DiscardSymbol, semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
7385return new OmittedArgumentOperation(semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
7419return new PlaceholderOperation(operation.PlaceholderKind, semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
7424return new ConversionOperation(VisitRequired(operation.Operand), ((ConversionOperation)operation).ConversionConvertible, operation.IsTryCast, operation.IsChecked, semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation));
7429return new DefaultValueOperation(semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation));
7440operation.Syntax, operation.Type, IsImplicit(operation));
7472IOperation initializedInstance = new InvalidOperation(children.ToImmutableAndFree(), semanticModel: null, operation.Syntax, operation.Type,
7496return new InvalidOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, invalidOperation.Syntax, invalidOperation.Type, invalidOperation.GetConstantValue(), IsImplicit(invalidOperation));
7503invalidOperation.Syntax, invalidOperation.Type, invalidOperation.GetConstantValue(), IsImplicit(operation)));
7545return new TranslatedQueryOperation(VisitRequired(operation.Operation), semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
7696operation.Syntax, operation.Type, IsImplicit(operation));
7714return new RangeOperation(visitedLeftOperand, visitedRightOperand, operation.IsLifted, operation.Method, semanticModel: null, operation.Syntax, operation.Type, isImplicit: IsImplicit(operation));
7917if (operation.Type!.IsAnonymousType)
7926if (operation.Type.IsValueType)
7933? MakeInvalidOperation(visitedInstance.Type, visitedInstance)
7936semanticModel: null, operation.Syntax, operation.Type, isImplicit: true);
8013operation.Operand.Type, constantValue: operation.Operand.GetConstantValue());
8034operation.Operand.Type, constantValue: operation.Operand.GetConstantValue());
8044operation.Operand.Type, constantValue: operation.Operand.GetConstantValue());
Operations\OperationCloner.cs (5)
21return new NoneOperation(VisitArray(((Operation)operation).ChildOperations.ToImmutableArray()), ((Operation)operation).OwningSemanticModel, operation.Syntax, operation.Type, operation.GetConstantValue(), operation.IsImplicit);
32return new DynamicObjectCreationOperation(Visit(operation.Initializer), VisitArray(operation.Arguments), ((HasDynamicArgumentsExpression)operation).ArgumentNames, ((HasDynamicArgumentsExpression)operation).ArgumentRefKinds, ((Operation)operation).OwningSemanticModel, operation.Syntax, operation.Type, operation.IsImplicit);
37return new DynamicInvocationOperation(Visit(operation.Operation), VisitArray(operation.Arguments), ((HasDynamicArgumentsExpression)operation).ArgumentNames, ((HasDynamicArgumentsExpression)operation).ArgumentRefKinds, ((Operation)operation).OwningSemanticModel, operation.Syntax, operation.Type, operation.IsImplicit);
42return new DynamicIndexerAccessOperation(Visit(operation.Operation), VisitArray(operation.Arguments), ((HasDynamicArgumentsExpression)operation).ArgumentNames, ((HasDynamicArgumentsExpression)operation).ArgumentRefKinds, ((Operation)operation).OwningSemanticModel, operation.Syntax, operation.Type, operation.IsImplicit);
47return new InvalidOperation(VisitArray(((InvalidOperation)operation).Children), ((Operation)operation).OwningSemanticModel, operation.Syntax, operation.Type, operation.GetConstantValue(), operation.IsImplicit);
Microsoft.CodeAnalysis.Analyzers (31)
Microsoft.CodeAnalysis.AnalyzerUtilities (98)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\PointsToAnalysis.PointsToDataFlowOperationVisitor.cs (20)
275if (PointsToAnalysis.ShouldBeTracked(operation.Type, IsDisposable) &&
282Debug.Assert(operation.Type == null || !operation.Type.IsNonNullableValueType() || defaultValue == PointsToAbstractValue.NoLocation);
760if (operation.Type == null ||
770else if (operation.Type.IsNonNullableValueType())
801AbstractLocation location = AbstractLocation.CreateAllocationLocation(operation, operation.Type!, DataFlowAnalysisContext);
827if (operation.Operand.Type == null)
832AbstractLocation location = AbstractLocation.CreateAllocationLocation(operation, operation.Operand.Type, DataFlowAnalysisContext);
844if (operation.Type.GetUnderlyingValueTupleTypeOrThis() is { } type)
862if (operation.Type is null)
865AbstractLocation location = AbstractLocation.CreateAllocationLocation(operation, operation.Type, DataFlowAnalysisContext);
886var pointsToAbstractValue = operation.Type != null
887? PointsToAbstractValue.Create(AbstractLocation.CreateAllocationLocation(operation, operation.Type, DataFlowAnalysisContext), mayBeNull: false)
923if (PointsToAnalysis.ShouldBeTracked(operation.Type, IsDisposable))
930AbstractLocation location = AbstractLocation.CreateAllocationLocation(operation, operation.Type, DataFlowAnalysisContext);
1070NullAbstractValue nullState = GetNullStateBasedOnInstanceOrReferenceValue(referenceOrInstance, operation.Type, defaultValue.NullState);
1175PointsToAnalysis.ShouldBeTracked(operation.Value.Type, IsDisposable))
1212if (inference.IsBoxing && operation.Type != null)
1215var location = AbstractLocation.CreateAllocationLocation(operation, operation.Type, DataFlowAnalysisContext);
1218else if (inference.IsUnboxing && operation.Type.IsNonNullableValueType())
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\ValueContentAnalysis\ValueContentAnalysis.ValueContentDataFlowOperationVisitor.cs (12)
187if (operation.Type == null)
194if (ValueContentAbstractValue.IsSupportedType(operation.Type, out var valueTypeSymbol))
215operation.Type is INamedTypeSymbol namedType &&
228return leftValue.MergeBinaryOperation(rightValue, operation.OperatorKind, operation.LeftOperand.Type, operation.RightOperand.Type, operation.Type);
238return targetValue.MergeBinaryOperation(assignedValue, operation.OperatorKind, targetType, assignedValueType, operation.Type);
246return targetValue.MergeBinaryOperation(incrementValue, operationKind, operation.Target.Type, incrementValueType, operation.Type);
294mergedValue = mergedValue.MergeBinaryOperation(newValue, BinaryOperatorKind.Add, leftType: operation.Type, rightType: operation.Type, resultType: operation.Type);
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (23)
727var thrownExceptionType = branch.BranchValue?.Type ?? CurrentBasicBlock.GetEnclosingRegionExceptionType();
747if (branch.BranchValue.Type?.SpecialType == SpecialType.System_Boolean &&
840!SymbolEqualityComparer.Default.Equals(method.ReturnType, returnValueOperation.Type))
1237return TryInferConversion(operation.Operand, operation.Type, operation.IsTryCast, operation, out inference);
1253inference = ConversionInference.Create(targetType, sourceOperand.Type, isTryCast);
1697if (invocation.Type?.SpecialType != SpecialType.System_Boolean)
1856var leftType = operation.LeftOperand.Type;
1858var rightType = operation.RightOperand.Type;
1861operation.Type?.SpecialType == SpecialType.System_Boolean &&
2027Debug.Assert(operation.Type!.HasValueCopySemantics());
2046Debug.Assert(!operation.Type!.HasValueCopySemantics());
2063if (operation == null || operation.Type == null || !HasPointsToAnalysisResult || !PessimisticAnalysis)
2068if (operation.Type.HasValueCopySemantics())
2838var value = ComputeValueForCompoundAssignment(operation, targetValue, assignedValue, operation.Target.Type, operation.Value.Type);
2901var elementType = ((IArrayTypeSymbol)arrayCreation.Type!).ElementType;
3056return GetAbstractDefaultValue(operation.Type);
3113operation.Value.Type != null &&
3114!operation.Value.Type.HasValueCopySemantics())
3231operation.Type?.SpecialType == SpecialType.System_Boolean &&
3702return GetAbstractDefaultValue(operation.Type);
3751if (operation.Type != null)
3753MergeAnalysisDataFromUnhandledThrowOperations(operation.Type);
Microsoft.CodeAnalysis.BannedApiAnalyzers (16)
Microsoft.CodeAnalysis.CodeStyle (28)
Microsoft.CodeAnalysis.CodeStyle.Fixes (9)
Microsoft.CodeAnalysis.CSharp (2)
Microsoft.CodeAnalysis.CSharp.Analyzers (1)
Microsoft.CodeAnalysis.CSharp.CodeStyle (35)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Features (13)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (4)
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (6)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (175)
Semantics\DynamicTests.cs (166)
5092AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
5216AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
5339AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
5582AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
5626AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
5803AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
5934AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
5979AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
6137AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
6260AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
6380AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
6488AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
6530Assert.Equal(typeInfo.Type, propertyRef.Type);
6577Assert.Equal(typeInfo.Type, propertyRef.Type);
6621Assert.Equal(typeInfo.Type, propertyRef.Type);
6666Assert.Equal(typeInfo.Type, propertyRef.Type);
6720Assert.Equal(typeInfo.Type, propertyRef.Type);
6786Assert.Equal(typeInfo.Type, propertyRef.Type);
6794AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
6795AssertEx.Equal("System.Int32", operation.Value.Type.ToTestDisplayString());
6796AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
6895Assert.Equal(typeInfo.Type, propertyRef.Type);
6903AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
6904AssertEx.Equal("System.Int32", operation.Value.Type.ToTestDisplayString());
6905AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
7005Assert.Equal(typeInfo.Type, propertyRef.Type);
7013AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
7014AssertEx.Equal("dynamic", operation.Value.Type.ToTestDisplayString());
7015AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
7102Assert.Equal(typeInfo.Type, propertyRef.Type);
7110AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
7111AssertEx.Equal("System.Object", operation.Value.Type.ToTestDisplayString());
7112AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
7174Assert.Equal(typeInfo.Type, propertyRef.Type);
7277Assert.Equal(typeInfo.Type, propertyRef.Type);
7287AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
7288AssertEx.Equal("System.Int32", operation.Value.Type.ToTestDisplayString());
7289AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
7390Assert.Equal(typeInfo.Type, propertyRef.Type);
7400AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
7401AssertEx.Equal("System.Int32", operation.Value.Type.ToTestDisplayString());
7402AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
7506Assert.Equal(typeInfo.Type, propertyRef.Type);
7516AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
7517AssertEx.Equal("dynamic", operation.Value.Type.ToTestDisplayString());
7518AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
7619Assert.Equal(typeInfo.Type, propertyRef.Type);
7630AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
7631AssertEx.Equal("C2", operation.Value.Type.ToTestDisplayString());
7632AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
7633Assert.False(operation.Type.IsErrorType());
7696Assert.Equal(typeInfo.Type, propertyRef.Type);
7801Assert.Equal(typeInfo.Type, propertyRef.Type);
7811AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
7812AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
7907Assert.Equal(typeInfo.Type, propertyRef.Type);
7917AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
7918AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
8011Assert.Equal(typeInfo.Type, propertyRef.Type);
8022AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
8023AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
8082Assert.Equal(typeInfo.Type, propertyRef.Type);
8092AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
8093AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
8188Assert.Equal(typeInfo.Type, propertyRef.Type);
8198AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
8199AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
8293Assert.Equal(typeInfo.Type, propertyRef.Type);
8303AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
8304AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
8398Assert.Equal(typeInfo.Type, propertyRef.Type);
8406AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
8407AssertEx.Equal("dynamic", operation.Value.Type.ToTestDisplayString());
8408AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
8507Assert.Equal(typeInfo.Type, propertyRef.Type);
8515AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
8516AssertEx.Equal("dynamic", operation.Value.Type.ToTestDisplayString());
8517AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
8616Assert.Equal(typeInfo.Type, propertyRef.Type);
8624AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
8625AssertEx.Equal("dynamic", operation.Value.Type.ToTestDisplayString());
8626AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
8726Assert.Equal(typeInfo.Type, propertyRef.Type);
8734AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
8735AssertEx.Equal("dynamic", operation.Value.Type.ToTestDisplayString());
8736AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
8835Assert.Equal(typeInfo.Type, propertyRef.Type);
8843AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
8844AssertEx.Equal("dynamic", operation.Value.Type.ToTestDisplayString());
8845AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
8904Assert.Equal(typeInfo.Type, propertyRef.Type);
8912AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
8913AssertEx.Equal("dynamic", operation.Value.Type.ToTestDisplayString());
8914AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
8976Assert.Equal(typeInfo.Type, propertyRef.Type);
8984AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
8985AssertEx.Equal("dynamic", operation.Value.Type.ToTestDisplayString());
8986AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
9032Assert.Equal(typeInfo.Type, propertyRef.Type);
9040AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
9041AssertEx.Equal("dynamic", operation.Value.Type.ToTestDisplayString());
9042AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
9122Assert.Equal(typeInfo.Type, propertyRef.Type);
9130AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
9131AssertEx.Equal("dynamic", operation.Value.Type.ToTestDisplayString());
9132AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
9213Assert.Equal(typeInfo.Type, propertyRef.Type);
9221AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
9222AssertEx.Equal("dynamic", operation.Value.Type.ToTestDisplayString());
9223AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
9303Assert.Equal(typeInfo.Type, propertyRef.Type);
9311AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
9312AssertEx.Equal("dynamic", operation.Value.Type.ToTestDisplayString());
9313AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
9359Assert.Equal(typeInfo.Type, propertyRef.Type);
9367AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
9368AssertEx.Equal("dynamic", operation.Value.Type.ToTestDisplayString());
9369AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
9420Assert.Equal(typeInfo.Type, propertyRef.Type);
9428AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
9541Assert.Equal(typeInfo.Type, propertyRef.Type);
9549AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
9661Assert.Equal(typeInfo.Type, propertyRef.Type);
9669AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
9775Assert.Equal(typeInfo.Type, propertyRef.Type);
9783AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
9886Assert.Equal(typeInfo.Type, propertyRef.Type);
9894AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
9997Assert.Equal(typeInfo.Type, propertyRef.Type);
10005AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
10128Assert.Equal(typeInfo.Type, propertyRef.Type);
10143Assert.Equal(tupleTypeInfo.Type, operation.Target.Type);
10144Assert.Equal(tupleTypeInfo.Type, operation.Value.Type);
10145Assert.Equal(typeInfo.Type, operation.Type);
10256Assert.Equal(typeInfo.Type, propertyRef.Type);
10271Assert.Equal(tupleTypeInfo.Type, operation.Target.Type);
10272Assert.Equal(tupleTypeInfo.Type, operation.Value.Type);
10273Assert.Equal(typeInfo.Type, operation.Type);
10384Assert.Equal(typeInfo.Type, propertyRef.Type);
10399Assert.Equal(tupleTypeInfo.Type, operation.Target.Type);
10400Assert.Equal(tupleTypeInfo.Type, operation.Value.Type);
10401Assert.Equal(typeInfo.Type, operation.Type);
10538Assert.Equal(typeInfo.Type, propertyRef.Type);
10553Assert.Equal(tupleTypeInfo.Type, operation.Target.Type);
10554Assert.Equal(tupleTypeInfo.Type, operation.Value.Type);
10555Assert.Equal(typeInfo.Type, operation.Type);
10672Assert.Equal(typeInfo.Type, propertyRef.Type);
10687Assert.Equal(tupleTypeInfo.Type, operation.Target.Type);
10688Assert.Equal("C2", operation.Value.Type.ToTestDisplayString());
10689Assert.Equal(typeInfo.Type, operation.Type);
10820Assert.Equal(typeInfo.Type, propertyRef.Type);
10835Assert.Equal(tupleTypeInfo.Type, operation.Target.Type);
10836Assert.Equal("C2", operation.Value.Type.ToTestDisplayString());
10837Assert.Equal(typeInfo.Type, operation.Type);
11090Assert.Equal(typeInfo.Type, propertyRef.Type);
11105Assert.Equal(tupleTypeInfo.Type, operation.Target.Type);
11106Assert.Equal("C2", operation.Value.Type.ToTestDisplayString());
11107Assert.Equal(typeInfo.Type, operation.Type);
11433AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
11486AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
11562AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
11606AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
11647AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
11699AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
11751AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
11791AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (7)
Microsoft.CodeAnalysis.CSharp.Workspaces (24)
Microsoft.CodeAnalysis.Features (37)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (16)
Microsoft.CodeAnalysis.PublicApiAnalyzers (11)
Microsoft.CodeAnalysis.ResxSourceGenerator (11)
Microsoft.CodeAnalysis.Test.Utilities (52)
Microsoft.CodeAnalysis.VisualBasic (3)
Microsoft.CodeAnalysis.VisualBasic.NetAnalyzers (2)
Microsoft.CodeAnalysis.Workspaces (6)
Microsoft.Interop.ComInterfaceGenerator (10)
Microsoft.Interop.LibraryImportGenerator (2)
Roslyn.Diagnostics.Analyzers (20)
Roslyn.Diagnostics.CSharp.Analyzers (25)
System.Text.RegularExpressions.Generator (1)
Test.Utilities (18)
Text.Analyzers (13)