131 implementations of Type
Microsoft.CodeAnalysis (130)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
944 references to Type
ConfigurationSchemaGenerator (3)
GenerateDocumentationAndConfigFiles (10)
ILLink.RoslynAnalyzer (5)
Metrics (11)
Metrics.Legacy (11)
Microsoft.Analyzers.Extra (13)
Microsoft.Analyzers.Local (5)
Microsoft.AspNetCore.App.Analyzers (6)
Microsoft.AspNetCore.Components.Analyzers (2)
Microsoft.AspNetCore.Mvc.Api.Analyzers (4)
Microsoft.CodeAnalysis (200)
Operations\ControlFlowGraphBuilder.cs (193)
1413return result ?? MakeInvalidOperation(originalOperation.Syntax, originalOperation.Type, ImmutableArray<IOperation>.Empty);
2106return PopStackFrame(frame, new SimpleAssignmentOperation(operation.IsRef, PopOperand(), value, null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation)));
2118syntax: operation.Syntax, type: operation.Type, isImplicit: IsImplicit(operation)));
2129operation.Syntax, operation.Type, IsImplicit(operation));
2140operation.Syntax, operation.Type, IsImplicit(operation));
2151operation.Syntax, operation.Type, IsImplicit(operation));
2172if (ITypeSymbolHelpers.IsBooleanType(operation.Type) &&
2173ITypeSymbolHelpers.IsBooleanType(operation.LeftOperand.Type) &&
2174ITypeSymbolHelpers.IsBooleanType(operation.RightOperand.Type))
2180ITypeSymbolHelpers.IsNullableOfBoolean(operation.Type) &&
2181ITypeSymbolHelpers.IsNullableOfBoolean(operation.LeftOperand.Type) &&
2182ITypeSymbolHelpers.IsNullableOfBoolean(operation.RightOperand.Type))
2187else if (ITypeSymbolHelpers.IsObjectType(operation.Type) &&
2188ITypeSymbolHelpers.IsObjectType(operation.LeftOperand.Type) &&
2189ITypeSymbolHelpers.IsObjectType(operation.RightOperand.Type))
2193else if (ITypeSymbolHelpers.IsDynamicType(operation.Type) &&
2194(ITypeSymbolHelpers.IsDynamicType(operation.LeftOperand.Type) ||
2195ITypeSymbolHelpers.IsDynamicType(operation.RightOperand.Type)))
2234semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation)));
2248semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
2260semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation));
2267ITypeSymbolHelpers.IsBooleanType(operation.Type) &&
2268ITypeSymbolHelpers.IsBooleanType(operation.Operand.Type);
2404semanticModel: null, operand.Syntax, operand.Type, constantValue: null, isImplicit: true);
2453Debug.Assert(binOp.Type is not null);
2454return new ConversionOperation(condition, _compilation.ClassifyConvertibleConversion(condition, binOp.Type, out _), isTryCast: false, isChecked: false,
2455semanticModel: null, binOp.Syntax, binOp.Type, binOp.GetConstantValue(), isImplicit: true);
2467Debug.Assert(binOp.Type is not null);
2490if (ITypeSymbolHelpers.IsBooleanType(left.Type))
2495else if (ITypeSymbolHelpers.IsDynamicType(left.Type) || unaryOperatorMethod != null)
2501(ITypeSymbolHelpers.IsNullableType(left.Type) || !ITypeSymbolHelpers.IsNullableType(unaryOperatorMethod.Parameters[0].Type))))
2527if (!ITypeSymbolHelpers.IsDynamicType(left.Type))
2529resultFromLeft = CreateConversion(resultFromLeft, binOp.Type);
2552binOp.Type,
2587if (ITypeSymbolHelpers.IsNullableType(left.Type))
2642binOp.Type,
2696AddStatement(new FlowCaptureOperation(captureId, leftSyntax, new LiteralOperation(semanticModel: null, leftSyntax, condition.Type, constantValue, isImplicit: true)));
2706Debug.Assert(ITypeSymbolHelpers.IsBooleanType(condition.Type));
2742lastUnary.Type, lastUnary.GetConstantValue(), IsImplicit(lastUnary))
2745condition.Type, constantValue: null, isImplicit: true);
2755ITypeSymbolHelpers.IsBooleanType(binOp.Type) &&
2756ITypeSymbolHelpers.IsBooleanType(binOp.LeftOperand.Type) &&
2757ITypeSymbolHelpers.IsBooleanType(binOp.RightOperand.Type);
2868if (ITypeSymbolHelpers.IsBooleanType(condition.Type))
2873if (ITypeSymbolHelpers.IsBooleanType(conditional.WhenTrue.Type) &&
2874ITypeSymbolHelpers.IsBooleanType(conditional.WhenFalse.Type))
2893if (ITypeSymbolHelpers.IsBooleanType(condition.Type))
2897if (ITypeSymbolHelpers.IsBooleanType(coalesce.WhenNull.Type))
2990ITypeSymbol? valueTypeOpt = operationValue.Type;
3010(!testConversion.IsIdentity || !ITypeSymbolHelpers.IsNullableType(operation.Type)))
3028isTryCast: false, isChecked: false, semanticModel: null, valueSyntax, operation.Type,
3036convertedTestExpression = MakeInvalidOperation(operation.Type, capturedValue);
3131if (operation.Target?.Type?.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T &&
3132((INamedTypeSymbol)operation.Target.Type!).TypeArguments[0].Equals(operation.Type))
3234value: CreateConversion(whenNullValue, operation.Target.Type),
3237type: operation.Target.Type,
3270operation.Syntax, operation.Type, constantValue: operation.GetConstantValue(), isImplicit: true);
3332ITypeSymbol? valueType = value.Type;
3357Debug.Assert(ITypeSymbolHelpers.IsNullableType(value.Type));
3359MakeInvalidOperation(ITypeSymbolHelpers.GetNullableUnderlyingType(value.Type), value);
3432if (ITypeSymbolHelpers.IsNullableType(operation.Type) && !ITypeSymbolHelpers.IsNullableType(currentConditionalAccess.WhenNotNull.Type))
3436MakeNullable(access, operation.Type)));
3456Debug.Assert(operation.Type is not null);
3459new DefaultValueOperation(semanticModel: null, defaultValueSyntax, operation.Type,
3460(operation.Type.IsReferenceType && !ITypeSymbolHelpers.IsNullableType(operation.Type))
3533ITypeSymbol? testExpressionType = testExpression.Type;
4029return resource.Type == null || resource.Type.Kind == SymbolKind.DynamicType;
4117Debug.Assert(resource.Type is not null);
4128Debug.Assert(!isNotNullableValueType(resource.Type));
4133Debug.Assert(resource.Type is not null);
4136if (requiresRuntimeConversion || !isNotNullableValueType(resource.Type))
4143if (!iDisposable.Equals(resource.Type) && disposeMethod is null)
4145if (resource.Type.IsReferenceType)
4149else if (ITypeSymbolHelpers.IsNullableType(resource.Type))
4171((value.Type!.Equals(iDisposable) || (!value.Type.IsReferenceType && !ITypeSymbolHelpers.IsNullableType(value.Type))) && disposeArguments.IsDefaultOrEmpty));
4225if (operation.LockedValue.Type?.IsWellKnownTypeLock() == true)
4227if (operation.LockedValue.Type.TryFindLockTypeInfo() is { } lockTypeInfo)
4319if (!objectType.Equals(lockedValue.Type))
4589collection = new FlowCaptureReferenceOperation(localCopyCaptureId, operation.Collection.Syntax, collection.Type, constantValue: null);
4686operation.LoopControlVariable.Syntax, operation.LoopControlVariable.Type,
4692operation.LoopControlVariable.Type,
4757ITypeSymbol? stepEnumUnderlyingTypeOrSelf = ITypeSymbolHelpers.GetEnumUnderlyingTypeOrSelf(operation.StepValue.Type);
4922if (ITypeSymbolHelpers.IsNullableType(stepValue.Type))
4928ITypeSymbol? stepValueEnumUnderlyingTypeOrSelf = ITypeSymbolHelpers.GetEnumUnderlyingTypeOrSelf(stepValue.Type);
4958IOperation literal = new LiteralOperation(semanticModel: null, stepValue.Syntax, stepValue.Type,
5151if (ITypeSymbolHelpers.IsNullableType(operation.LimitValue.Type))
5259operation.StepValue.Type,
5274operand.Type,
5322bool isNullable = ITypeSymbolHelpers.IsNullableType(operation.StepValue.Type);
5363controlVariableReferenceForAssignment.Type,
5382Debug.Assert(ITypeSymbolHelpers.IsNullableType(controlVariableReferenceForIncrement.Type));
5398controlVariableReferenceForIncrement.Type,
5406Debug.Assert(controlVariableReferenceForAssignment.Type != null);
5407increment = MakeNullable(increment, controlVariableReferenceForAssignment.Type);
5448return new FlowCaptureReferenceOperation(id, underlying.Syntax, underlying.Type, underlying.GetConstantValue());
5555bool leftIsNullable = ITypeSymbolHelpers.IsNullableType(operation.Value.Type);
5556bool rightIsNullable = ITypeSymbolHelpers.IsNullableType(compareWith.Type);
5568if (leftOperand.Type != null)
5570Debug.Assert(compareWith.Type != null);
5571leftOperand = MakeNullable(leftOperand, compareWith.Type);
5574else if (!rightIsNullable && rightOperand.Type != null)
5576Debug.Assert(operation.Value.Type != null);
5577rightOperand = MakeNullable(rightOperand, operation.Value.Type);
5667Debug.Assert(ITypeSymbolHelpers.GetNullableUnderlyingType(type).Equals(operand.Type));
5936operation.Type, IsImplicit(operation));
5946operation.Type, IsImplicit(operation));
5978IOperation initializedInstance = new NoPiaObjectCreationOperation(initializer: null, semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
5990operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation));
5998var initializedInstance = new TypeParameterObjectCreationOperation(initializer: null, semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
6012operation.Type, IsImplicit(operation));
6099assignmentOperation.Type, assignmentOperation.GetConstantValue(), IsImplicit(assignmentOperation));
6236fieldReference.Syntax, fieldReference.Type, fieldReference.GetConstantValue(), IsImplicit(fieldReference));
6241eventReference.Type, IsImplicit(eventReference));
6247propertyReference.Type, IsImplicit(propertyReference));
6252return new ArrayElementReferenceOperation(instance, indices, semanticModel: null, originalTarget.Syntax, originalTarget.Type, IsImplicit(originalTarget));
6259semanticModel: null, originalTarget.Syntax, originalTarget.Type, IsImplicit(originalTarget));
6272dynamicReference.Type, IsImplicit(dynamicReference));
6362return MakeInvalidOperation(operation.Syntax, operation.Type, ImmutableArray<IOperation>.Empty);
6368return MakeInvalidOperation(operation.Syntax, operation.Type, ImmutableArray<IOperation>.Empty);
6376operation.Syntax, operation.Type, IsImplicit(operation));
6380Debug.Assert(operation.Type is not null);
6381_currentImplicitInstance = new ImplicitInstanceInfo((INamedTypeSymbol)operation.Type);
6401propertyReference.Instance.Syntax, propertyReference.Instance.Type, IsImplicit(propertyReference.Instance));
6403semanticModel: null, propertyReference.Syntax, propertyReference.Type, IsImplicit(propertyReference));
6406semanticModel: null, simpleAssignment.Syntax, simpleAssignment.Type, simpleAssignment.GetConstantValue(), IsImplicit(simpleAssignment));
6420operation.Syntax, operation.Type, IsImplicit(operation));
6494operation.Syntax, operation.Type, IsImplicit(operation));
6595operation.Type,
6620return MakeInvalidOperation(operation.Syntax, operation.Type, ImmutableArray<IOperation>.Empty);
6625return new FlowCaptureReferenceOperation(_currentInterpolatedStringHandlerCreationContext.HandlerPlaceholder, operation.Syntax, operation.Type, operation.GetConstantValue());
6628return new InstanceReferenceOperation(operation.ReferenceKind, semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
6657dynamicMemberReference.ContainingType, semanticModel: null, dynamicMemberReference.Syntax, dynamicMemberReference.Type, IsImplicit(dynamicMemberReference));
6666((HasDynamicArgumentsExpression)operation).ArgumentRefKinds, semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
6677((HasDynamicArgumentsExpression)operation).ArgumentRefKinds, semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
6683operation.ContainingType, semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
6689return new DeconstructionAssignmentOperation(visitedTarget, visitedValue, semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
6727return new TupleOperation(elementBuilder.ToImmutableAndFree(), tuple.NaturalType, semanticModel: null, tuple.Syntax, tuple.Type, IsImplicit(tuple));
6737return new DeclarationExpressionOperation(VisitPreservingTupleOperations(operation.Expression), semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
6785return new NoneOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation));
6791new NoneOperation(VisitArray(((Operation)operation).ChildOperations.ToImmutableArray()), semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation)));
6867ConditionalBranch(new FlowCaptureReferenceOperation(outParameterFlowCapture, outParameterPlaceholder.Syntax, outParameterPlaceholder.Type, constantValue: null), jumpIfTrue: false, resultBlock);
6914return new FlowCaptureReferenceOperation(handlerCaptureId, operation.Syntax, operation.Type, operation.GetConstantValue());
6995return new FlowCaptureReferenceOperation(_currentInterpolatedStringHandlerCreationContext.OutPlaceholder, operation.Syntax, operation.Type, operation.GetConstantValue(), isInitialization: true);
7007return new InvalidOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), isImplicit: true);
7020return new InvalidOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), isImplicit: true);
7107return new InterpolatedStringOperation(partsBuilder.ToImmutableAndFree(), semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation));
7123return new LiteralOperation(semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation));
7128return new LiteralOperation(semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation));
7133return new Utf8StringOperation(operation.Value, semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
7139operation.Type, operation.GetConstantValue(), IsImplicit(operation));
7145operation.Type, IsImplicit(operation));
7152operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation));
7159operation.Syntax, operation.Type, IsImplicit(operation));
7179return MakeInvalidOperation(operation.Syntax, operation.Type, ImmutableArray<IOperation>.Empty);
7188operation.Syntax, operation.Type, IsImplicit(operation));
7195operation.Syntax, operation.Type, IsImplicit(operation));
7200return new TypeOfOperation(operation.TypeOperand, semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
7205return new ParenthesizedOperation(VisitRequired(operation.Operand), semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation));
7210return new AwaitOperation(VisitRequired(operation.Operation), semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
7215return new SizeOfOperation(operation.TypeOperand, semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation));
7225return new IsTypeOperation(VisitRequired(operation.ValueOperand), operation.TypeOperand, operation.IsNegated, semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
7304initializer.Syntax, rewrittenTarget.Type, constantValue: null, isImplicit: true);
7332semanticModel: null, operation.EventReference.Syntax, operation.EventReference.Type, IsImplicit(operation.EventReference));
7345operation.Syntax, operation.Type, IsImplicit(operation));
7378semanticModel: null, operation.EventReference.Syntax, operation.EventReference.Type, IsImplicit(operation.EventReference));
7387return new AddressOfOperation(VisitRequired(operation.Reference), semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
7394operation.Kind, semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
7399return new DiscardOperation(operation.DiscardSymbol, semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
7409return new OmittedArgumentOperation(semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
7443return new PlaceholderOperation(operation.PlaceholderKind, semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
7449return new CollectionExpressionElementsPlaceholderOperation(semanticModel: null, operation.Syntax, operation.Type, operation.IsImplicit);
7454return new ConversionOperation(VisitRequired(operation.Operand), ((ConversionOperation)operation).ConversionConvertible, operation.IsTryCast, operation.IsChecked, semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation));
7459return new DefaultValueOperation(semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation));
7470operation.Syntax, operation.Type, IsImplicit(operation));
7502IOperation initializedInstance = new InvalidOperation(children.ToImmutableAndFree(), semanticModel: null, operation.Syntax, operation.Type,
7526return new InvalidOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, invalidOperation.Syntax, invalidOperation.Type, invalidOperation.GetConstantValue(), IsImplicit(invalidOperation));
7533invalidOperation.Syntax, invalidOperation.Type, invalidOperation.GetConstantValue(), IsImplicit(operation)));
7575return new TranslatedQueryOperation(VisitRequired(operation.Operation), semanticModel: null, operation.Syntax, operation.Type, IsImplicit(operation));
7726operation.Syntax, operation.Type, IsImplicit(operation));
7744return new RangeOperation(visitedLeftOperand, visitedRightOperand, operation.IsLifted, operation.Method, semanticModel: null, operation.Syntax, operation.Type, isImplicit: IsImplicit(operation));
7947if (operation.Type!.IsAnonymousType)
7956if (operation.Type.IsValueType)
7963? MakeInvalidOperation(visitedInstance.Type, visitedInstance)
7966semanticModel: null, operation.Syntax, operation.Type, isImplicit: true);
8043operation.Operand.Type, constantValue: operation.Operand.GetConstantValue());
8064operation.Operand.Type, constantValue: operation.Operand.GetConstantValue());
8074operation.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 (41)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Features (19)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (4)
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.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 (8)
Text.Analyzers (13)