130 implementations of Type
Microsoft.CodeAnalysis (129)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
924 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.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 (27)
Microsoft.CodeAnalysis.CodeStyle.Fixes (9)
Microsoft.CodeAnalysis.CSharp (2)
Microsoft.CodeAnalysis.CSharp.Analyzers (1)
Microsoft.CodeAnalysis.CSharp.CodeStyle (34)
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.Semantic.UnitTests (175)
Semantics\DynamicTests.cs (166)
4994AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
5118AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
5241AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
5484AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
5528AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
5705AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
5836AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
5881AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
6039AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
6162AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
6282AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
6390AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
6432Assert.Equal(typeInfo.Type, propertyRef.Type);
6479Assert.Equal(typeInfo.Type, propertyRef.Type);
6523Assert.Equal(typeInfo.Type, propertyRef.Type);
6568Assert.Equal(typeInfo.Type, propertyRef.Type);
6622Assert.Equal(typeInfo.Type, propertyRef.Type);
6688Assert.Equal(typeInfo.Type, propertyRef.Type);
6696AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
6697AssertEx.Equal("System.Int32", operation.Value.Type.ToTestDisplayString());
6698AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
6797Assert.Equal(typeInfo.Type, propertyRef.Type);
6805AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
6806AssertEx.Equal("System.Int32", operation.Value.Type.ToTestDisplayString());
6807AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
6907Assert.Equal(typeInfo.Type, propertyRef.Type);
6915AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
6916AssertEx.Equal("dynamic", operation.Value.Type.ToTestDisplayString());
6917AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
7004Assert.Equal(typeInfo.Type, propertyRef.Type);
7012AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
7013AssertEx.Equal("System.Object", operation.Value.Type.ToTestDisplayString());
7014AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
7076Assert.Equal(typeInfo.Type, propertyRef.Type);
7179Assert.Equal(typeInfo.Type, propertyRef.Type);
7189AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
7190AssertEx.Equal("System.Int32", operation.Value.Type.ToTestDisplayString());
7191AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
7292Assert.Equal(typeInfo.Type, propertyRef.Type);
7302AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
7303AssertEx.Equal("System.Int32", operation.Value.Type.ToTestDisplayString());
7304AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
7408Assert.Equal(typeInfo.Type, propertyRef.Type);
7418AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
7419AssertEx.Equal("dynamic", operation.Value.Type.ToTestDisplayString());
7420AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
7521Assert.Equal(typeInfo.Type, propertyRef.Type);
7532AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
7533AssertEx.Equal("C2", operation.Value.Type.ToTestDisplayString());
7534AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
7535Assert.False(operation.Type.IsErrorType());
7598Assert.Equal(typeInfo.Type, propertyRef.Type);
7703Assert.Equal(typeInfo.Type, propertyRef.Type);
7713AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
7714AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
7809Assert.Equal(typeInfo.Type, propertyRef.Type);
7819AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
7820AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
7913Assert.Equal(typeInfo.Type, propertyRef.Type);
7924AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
7925AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
7984Assert.Equal(typeInfo.Type, propertyRef.Type);
7994AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
7995AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
8090Assert.Equal(typeInfo.Type, propertyRef.Type);
8100AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
8101AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
8195Assert.Equal(typeInfo.Type, propertyRef.Type);
8205AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
8206AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
8300Assert.Equal(typeInfo.Type, propertyRef.Type);
8308AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
8309AssertEx.Equal("dynamic", operation.Value.Type.ToTestDisplayString());
8310AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
8409Assert.Equal(typeInfo.Type, propertyRef.Type);
8417AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
8418AssertEx.Equal("dynamic", operation.Value.Type.ToTestDisplayString());
8419AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
8518Assert.Equal(typeInfo.Type, propertyRef.Type);
8526AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
8527AssertEx.Equal("dynamic", operation.Value.Type.ToTestDisplayString());
8528AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
8628Assert.Equal(typeInfo.Type, propertyRef.Type);
8636AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
8637AssertEx.Equal("dynamic", operation.Value.Type.ToTestDisplayString());
8638AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
8737Assert.Equal(typeInfo.Type, propertyRef.Type);
8745AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
8746AssertEx.Equal("dynamic", operation.Value.Type.ToTestDisplayString());
8747AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
8806Assert.Equal(typeInfo.Type, propertyRef.Type);
8814AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
8815AssertEx.Equal("dynamic", operation.Value.Type.ToTestDisplayString());
8816AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
8878Assert.Equal(typeInfo.Type, propertyRef.Type);
8886AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
8887AssertEx.Equal("dynamic", operation.Value.Type.ToTestDisplayString());
8888AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
8934Assert.Equal(typeInfo.Type, propertyRef.Type);
8942AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
8943AssertEx.Equal("dynamic", operation.Value.Type.ToTestDisplayString());
8944AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
9024Assert.Equal(typeInfo.Type, propertyRef.Type);
9032AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
9033AssertEx.Equal("dynamic", operation.Value.Type.ToTestDisplayString());
9034AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
9115Assert.Equal(typeInfo.Type, propertyRef.Type);
9123AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
9124AssertEx.Equal("dynamic", operation.Value.Type.ToTestDisplayString());
9125AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
9205Assert.Equal(typeInfo.Type, propertyRef.Type);
9213AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
9214AssertEx.Equal("dynamic", operation.Value.Type.ToTestDisplayString());
9215AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
9261Assert.Equal(typeInfo.Type, propertyRef.Type);
9269AssertEx.Equal("dynamic", operation.Target.Type.ToTestDisplayString());
9270AssertEx.Equal("dynamic", operation.Value.Type.ToTestDisplayString());
9271AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
9322Assert.Equal(typeInfo.Type, propertyRef.Type);
9330AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
9443Assert.Equal(typeInfo.Type, propertyRef.Type);
9451AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
9563Assert.Equal(typeInfo.Type, propertyRef.Type);
9571AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
9677Assert.Equal(typeInfo.Type, propertyRef.Type);
9685AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
9788Assert.Equal(typeInfo.Type, propertyRef.Type);
9796AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
9899Assert.Equal(typeInfo.Type, propertyRef.Type);
9907AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
10030Assert.Equal(typeInfo.Type, propertyRef.Type);
10045Assert.Equal(tupleTypeInfo.Type, operation.Target.Type);
10046Assert.Equal(tupleTypeInfo.Type, operation.Value.Type);
10047Assert.Equal(typeInfo.Type, operation.Type);
10158Assert.Equal(typeInfo.Type, propertyRef.Type);
10173Assert.Equal(tupleTypeInfo.Type, operation.Target.Type);
10174Assert.Equal(tupleTypeInfo.Type, operation.Value.Type);
10175Assert.Equal(typeInfo.Type, operation.Type);
10286Assert.Equal(typeInfo.Type, propertyRef.Type);
10301Assert.Equal(tupleTypeInfo.Type, operation.Target.Type);
10302Assert.Equal(tupleTypeInfo.Type, operation.Value.Type);
10303Assert.Equal(typeInfo.Type, operation.Type);
10440Assert.Equal(typeInfo.Type, propertyRef.Type);
10455Assert.Equal(tupleTypeInfo.Type, operation.Target.Type);
10456Assert.Equal(tupleTypeInfo.Type, operation.Value.Type);
10457Assert.Equal(typeInfo.Type, operation.Type);
10574Assert.Equal(typeInfo.Type, propertyRef.Type);
10589Assert.Equal(tupleTypeInfo.Type, operation.Target.Type);
10590Assert.Equal("C2", operation.Value.Type.ToTestDisplayString());
10591Assert.Equal(typeInfo.Type, operation.Type);
10722Assert.Equal(typeInfo.Type, propertyRef.Type);
10737Assert.Equal(tupleTypeInfo.Type, operation.Target.Type);
10738Assert.Equal("C2", operation.Value.Type.ToTestDisplayString());
10739Assert.Equal(typeInfo.Type, operation.Type);
10992Assert.Equal(typeInfo.Type, propertyRef.Type);
11007Assert.Equal(tupleTypeInfo.Type, operation.Target.Type);
11008Assert.Equal("C2", operation.Value.Type.ToTestDisplayString());
11009Assert.Equal(typeInfo.Type, operation.Type);
11335AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
11388AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
11464AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
11508AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
11549AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
11601AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
11653AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
11693AssertEx.Equal("dynamic", operation.Type.ToTestDisplayString());
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (7)
Microsoft.CodeAnalysis.CSharp.Workspaces (23)
Microsoft.CodeAnalysis.Features (36)
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 (24)
System.Text.RegularExpressions.Generator (1)
Test.Utilities (8)
Text.Analyzers (13)