204 references to Exists
Microsoft.AspNetCore.Components.Analyzers (4)
ComponentFacts.cs (1)
103
if (!conversion.
Exists
|| !conversion.IsExplicit)
ComponentParameterAnalyzer.cs (1)
103
if (!conversion.
Exists
|| conversion.IsExplicit)
ComponentParameterUsageAnalyzer.cs (2)
90
if (conversion.
Exists
&& conversion.IsIdentity)
96
if (conversion.
Exists
&& conversion.IsExplicit)
Microsoft.AspNetCore.Components.SdkAnalyzers (4)
ComponentFacts.cs (1)
103
if (!conversion.
Exists
|| !conversion.IsExplicit)
ComponentParameterAnalyzer.cs (1)
97
if (!conversion.
Exists
|| conversion.IsExplicit)
ComponentParameterUsageAnalyzer.cs (2)
90
if (conversion.
Exists
&& conversion.IsIdentity)
96
if (conversion.
Exists
&& conversion.IsExplicit)
Microsoft.CodeAnalysis.CSharp (130)
Binder\Binder_Conversions.cs (5)
214
Debug.Assert(!conversion.
Exists
);
235
|| !conversion.
Exists
);
256
Debug.Assert(!conversion.
Exists
);
276
if (!hasErrors && conversion.
Exists
)
1531
if (!conversion.
Exists
)
Binder\Binder_Expressions.cs (3)
2890
if (!underlyingConversion.
Exists
)
5416
if (!conv.
Exists
)
9504
if (!conversion.
Exists
)
Binder\Binder_Invocation.cs (2)
1642
&& Conversions.ClassifyBuiltInConversion(Compilation.GetSpecialType(SpecialType.System_String), parameterType, isChecked: false, ref discardedUseSiteInfo).
Exists
1747
if (!conversion.
Exists
)
Binder\Binder_Operators.cs (8)
1070
if (implicitConversion.
Exists
)
3828
if (conversion.
Exists
)
4068
if (rightConversion.
Exists
)
4086
if (rightConversion.
Exists
)
4137
if (leftConversionClassification.
Exists
)
4151
if (leftConversionClassification.
Exists
)
4203
if (underlyingRightConversion.
Exists
&& rightOperand.Type?.IsDynamic() != true)
4218
if (rightConversion.
Exists
)
Binder\Binder_Patterns.cs (1)
770
if (!conversion.
Exists
&& (inputType.ContainsTypeParameter() || patternType.ContainsTypeParameter()))
Binder\DecisionDagBuilder.cs (1)
1545
return (!conversion.
Exists
&& isRuntimeSimilar(expressionType, patternType))
Binder\Semantics\BestTypeInferrer.cs (4)
146
if (conversionsWithoutNullability.ClassifyImplicitConversionFromExpression(expr2, type1, ref useSiteInfo).
Exists
)
161
if (conversionsWithoutNullability.ClassifyImplicitConversionFromExpression(expr1, type2, ref useSiteInfo).
Exists
)
290
var t1tot2 = conversionsWithoutNullability.ClassifyImplicitConversionFromTypeWhenNeitherOrBothFunctionTypes(type1, type2, ref useSiteInfo).
Exists
;
291
var t2tot1 = conversionsWithoutNullability.ClassifyImplicitConversionFromTypeWhenNeitherOrBothFunctionTypes(type2, type1, ref useSiteInfo).
Exists
;
Binder\Semantics\Conversions\Conversion.cs (3)
568
if (!this.
Exists
)
633
return
Exists
&& !IsImplicit;
1154
return new CommonConversion(
Exists
, IsIdentity, IsNumeric, IsReference, IsImplicit, IsNullable, methodSymbol, constrainedToType);
Binder\Semantics\Conversions\Conversions.cs (2)
207
if (!elementConversion.
Exists
)
506
if (spanConversion.
Exists
)
Binder\Semantics\Conversions\ConversionsBase.cs (60)
113
if (conversion.
Exists
)
122
if (fastConversion.
Exists
)
132
if (conversion.
Exists
)
147
if (conversion.
Exists
)
158
if (conversion.
Exists
)
182
if (fastConversion.
Exists
)
189
if (conversion.
Exists
)
300
if (result.
Exists
)
334
if (fastConversion.
Exists
)
341
if (conversion1.
Exists
)
348
if (conversion.
Exists
)
354
if (conversion.
Exists
)
382
if (implicitConversion.
Exists
&& !ExplicitConversionMayDifferFromImplicit(implicitConversion))
388
if (explicitConversion.
Exists
)
436
if (fastConversion.
Exists
)
442
if (implicitBuiltInConversion.
Exists
&& !ExplicitConversionMayDifferFromImplicit(implicitBuiltInConversion))
448
if (explicitBuiltInConversion.
Exists
)
453
if (implicitBuiltInConversion.
Exists
)
475
if (conversion.
Exists
)
506
if (fastConversion.
Exists
)
513
if (conversion.
Exists
)
570
if (conversion.
Exists
)
643
if (conversion.
Exists
&&
717
if (nullableConversion.
Exists
)
749
if (tupleConversion.
Exists
)
774
if (conversion.
Exists
)
823
if (nullableConversion.
Exists
)
839
if (tupleConversion.
Exists
)
922
impliedExplicitConversion = underlyingConversion.
Exists
?
1054
if (constantConversion.
Exists
)
1063
if (nullLiteralConversion.
Exists
)
1076
if (innerConversion.
Exists
)
1084
if (tupleConversion.
Exists
)
1099
if (methodGroupConversion.
Exists
)
1108
if (interpolatedStringConversion.
Exists
)
1115
if (stackAllocConversion.
Exists
)
1123
if (addressOfConversion.
Exists
)
1137
if (collectionExpressionConversion.
Exists
)
1162
if (collectionExpressionConversion.
Exists
)
1174
if (underlyingConversion.
Exists
)
1198
if (!nestedConversion.
Exists
)
1221
if (!trueConversion.
Exists
)
1225
if (!falseConversion.
Exists
)
1298
if (tupleConversion.
Exists
)
1310
if (underlyingTupleConversion.
Exists
)
1324
if (tupleConversion.
Exists
)
1339
if (underlyingTupleConversion.
Exists
)
1413
if (tupleConversion.
Exists
)
1424
if (fastConversion.
Exists
)
1431
if (conversion.
Exists
)
1623
return ClassifyImplicitConversionFromType(multicastDelegateType, type, ref useSiteInfo).
Exists
;
1770
if (constantConversion.
Exists
)
1780
return GetCallerLineNumberConversion(destination, ref useSiteInfo).
Exists
;
1787
return conversion.
Exists
;
1965
if (tupleConversion.
Exists
)
1988
if (tupleConversion.
Exists
)
2273
if (tupleConversion.
Exists
)
2348
if (!result.
Exists
)
2421
if (!conversion.
Exists
)
2470
if (tupleConversion.
Exists
)
Binder\Semantics\Conversions\UserDefinedExplicitConversions.cs (8)
273
if (!fromConversion.
Exists
&&
276
EncompassingExplicitConversion(source.GetNullableUnderlyingType(), convertsFrom, ref useSiteInfo).
Exists
)
282
if (!toConversion.
Exists
&&
285
EncompassingExplicitConversion(convertsTo, target.GetNullableUnderlyingType(), ref useSiteInfo).
Exists
)
315
if (fromConversion.
Exists
&& toConversion.
Exists
)
323
Debug.Assert(liftedFromConversion.
Exists
);
324
Debug.Assert(liftedToConversion.
Exists
);
Binder\Semantics\Conversions\UserDefinedImplicitConversions.cs (5)
303
if (fromConversion.
Exists
&& toConversion.
Exists
)
351
if (liftedFromConversion.
Exists
&& liftedToConversion.
Exists
)
580
return EncompassingImplicitConversion(aExpr, a, b, ref useSiteInfo).
Exists
;
Binder\Semantics\Operators\BinaryOperatorEasyOut.cs (2)
317
Debug.Assert(leftConversion.
Exists
&& leftConversion.IsImplicit);
318
Debug.Assert(rightConversion.
Exists
&& rightConversion.IsImplicit);
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (1)
3025
return conversions.ClassifyImplicitConversionFromTypeWhenNeitherOrBothFunctionTypes(source, destination, ref useSiteInfo).
Exists
;
Binder\Semantics\OverloadResolution\OverloadResolution.cs (2)
4507
if (!conversion.
Exists
)
4613
Debug.Assert((!conversion.
Exists
) || conversion.IsImplicit, "ClassifyImplicitConversion should only return implicit conversions");
Binder\SwitchExpressionBinder.cs (1)
163
if (!this.Conversions.ClassifyImplicitConversionFromExpression(@case.Value, commonType, ref useSiteInfo).
Exists
)
FlowAnalysis\NullableWalker.cs (10)
5198
if (conversion.
Exists
&& !conversion.IsExplicit)
5639
GenerateConversionForConditionalOperator(node.LeftOperand, leftType, rightType, reportMismatch: false, isChecked: node.Checked) is {
Exists
: true } conversion)
7369
if (!conversion.
Exists
&& !argumentNoConversion.IsSuppressed)
8082
bool canConvertNestedNullability = conversion.
Exists
;
8980
canConvertNestedNullability = conversion.
Exists
;
9006
canConvertNestedNullability = conversion.
Exists
;
9058
canConvertNestedNullability = conversion.
Exists
;
9076
canConvertNestedNullability = conversion.
Exists
;
9087
canConvertNestedNullability = conversion.
Exists
&& conversion.IsSpan;
9562
if (reportWarnings && !conversion.
Exists
)
Lowering\DiagnosticsPass_Warnings.cs (1)
288
if (!node.Operator.Kind.IsDynamic() && node.LeftConversion is BoundConversion { Conversion: { IsIdentity: false,
Exists
: true } conversion })
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (1)
216
if (conversion.
Exists
)
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (4)
1763
if (!fromConversion.
Exists
)
1769
if (!toConversion.
Exists
)
1869
if (!fromConversion.
Exists
)
1875
if (!toConversion.
Exists
)
Lowering\LocalRewriter\LocalRewriter_NullCoalescingOperator.cs (1)
50
if (leftConversion is not BoundConversion { Conversion: {
Exists
: true } })
Lowering\SyntheticBoundNodeFactory.cs (2)
1479
if (allowBoxingByRefLikeTypeParametersToObject && !c.
Exists
&&
1485
Debug.Assert(c.
Exists
);
Operations\CSharpOperationFactory.cs (1)
1595
if (valueConversion.
Exists
&& !valueConversion.IsIdentity &&
Symbols\ReducedExtensionMethodSymbol.cs (1)
53
if (!conversion.
Exists
)
Symbols\Source\ParameterHelpers.cs (1)
777
else if (!conversion.
Exists
||
Microsoft.CodeAnalysis.CSharp.CodeStyle (12)
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
154
if (conversion.
Exists
&&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (5)
101
semanticModel.ClassifyConversion(cast.Expression, parentConversionType).
Exists
)
290
if (!originalConversion.
Exists
)
349
if (rewrittenConvertedType is null || rewrittenConvertedType.TypeKind == TypeKind.Error || !rewrittenConversion.
Exists
)
490
originalSemanticModel.Compilation.ClassifyConversion(castedExpressionType, isType).
Exists
)
1052
if (parentConversion.
Exists
&& parentConversion.IsBoxing)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (6)
448
if (originalConversion.
Exists
!= newConversion.
Exists
)
714
return originalConversion.
Exists
!= newConversion.
Exists
;
855
if (originalConversion.
Exists
!= newConversion.
Exists
||
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Analyzers\CSharp\CodeFixes\AddExplicitCast\CSharpAddExplicitCastCodeFixProvider.cs (1)
103
if (conversion.
Exists
&& conversion.IsExplicit)
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
153
if (!model.Compilation.ClassifyConversion(typeArgument, returnExpressionType).
Exists
)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Semantics\OutVarTests.cs (1)
1059
Assert.False(conversion.
Exists
);
Microsoft.CodeAnalysis.CSharp.Features (4)
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
154
if (conversion.
Exists
&&
src\Analyzers\CSharp\CodeFixes\AddExplicitCast\CSharpAddExplicitCastCodeFixProvider.cs (1)
103
if (conversion.
Exists
&& conversion.IsExplicit)
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
153
if (!model.Compilation.ClassifyConversion(typeArgument, returnExpressionType).
Exists
)
UseNamedArguments\CSharpUseNamedArgumentsCodeRefactoringProvider.cs (1)
50
if (!conversion.
Exists
|| conversion.IsExplicit)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (7)
Semantics\InterpolationTests.cs (1)
4610
Assert.True(semanticInfo.ImplicitConversion.
Exists
);
Semantics\RawInterpolationTests_Handler.cs (1)
2911
Assert.True(semanticInfo.ImplicitConversion.
Exists
);
Semantics\Utf8StringsLiteralsTests.cs (5)
2979
Assert.False(model.GetConversion(node).
Exists
);
3035
Assert.False(model.GetConversion(node).
Exists
);
3091
Assert.False(model.GetConversion(node).
Exists
);
3147
Assert.False(model.GetConversion(node).
Exists
);
3203
Assert.False(model.GetConversion(node).
Exists
);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (29)
Compilation\GetSemanticInfoTests.cs (27)
671
Assert.False(conv.
Exists
);
676
Assert.True(conv.
Exists
);
682
Assert.True(conv.
Exists
);
688
Assert.True(conv.
Exists
);
694
Assert.True(conv.
Exists
);
700
Assert.True(conv.
Exists
);
706
Assert.True(conv.
Exists
);
712
Assert.True(conv.
Exists
);
718
Assert.True(conv.
Exists
);
724
Assert.True(conv.
Exists
);
730
Assert.True(conv.
Exists
);
736
Assert.True(conv.
Exists
);
742
Assert.True(conv.
Exists
);
748
Assert.True(conv.
Exists
);
754
Assert.True(conv.
Exists
);
760
Assert.True(conv.
Exists
);
766
Assert.True(conv.
Exists
);
772
Assert.True(conv.
Exists
);
778
Assert.True(conv.
Exists
);
784
Assert.True(conv.
Exists
);
790
Assert.True(conv.
Exists
);
797
Assert.True(conv.
Exists
);
804
Assert.True(conv.
Exists
);
811
Assert.True(conv.
Exists
);
818
Assert.True(conv.
Exists
);
825
Assert.True(conv.
Exists
);
5992
Assert.True(foreachSymbolInfo.CurrentConversion.
Exists
);
Symbols\ConversionTests.cs (2)
409
Assert.False(conversion.
Exists
);
421
Assert.False(conversion.
Exists
);
Microsoft.CodeAnalysis.CSharp.Workspaces (11)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (5)
101
semanticModel.ClassifyConversion(cast.Expression, parentConversionType).
Exists
)
290
if (!originalConversion.
Exists
)
349
if (rewrittenConvertedType is null || rewrittenConvertedType.TypeKind == TypeKind.Error || !rewrittenConversion.
Exists
)
490
originalSemanticModel.Compilation.ClassifyConversion(castedExpressionType, isType).
Exists
)
1052
if (parentConversion.
Exists
&& parentConversion.IsBoxing)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (6)
448
if (originalConversion.
Exists
!= newConversion.
Exists
)
714
return originalConversion.
Exists
!= newConversion.
Exists
;
855
if (originalConversion.
Exists
!= newConversion.
Exists
||