903 references to ConversionKind
Microsoft.CodeAnalysis.VisualBasic (903)
Analysis\InitializerRewriter.vb (1)
78
ConversionKind
.WideningNothingLiteral,
Binding\Binder_Conversions.vb (64)
87
Dim conv As
ConversionKind
= Conversions.ClassifyDirectCastConversion(argument, targetType, Me, useSiteInfo)
99
argument = New BoundDirectCast(node, argument,
ConversionKind
.Identity, targetType)
153
conv =
ConversionKind
.WideningNothingLiteral OrElse
197
Dim conv As
ConversionKind
216
argument = New BoundTryCast(node, argument,
ConversionKind
.Identity, targetType)
356
Dim conv As KeyValuePair(Of
ConversionKind
, MethodSymbol)
428
convKind As KeyValuePair(Of
ConversionKind
, MethodSymbol),
447
If (convKind.Key And
ConversionKind
.UserDefined) = 0 AndAlso
455
argument = New BoundConversion(tree, argument,
ConversionKind
.Identity, CheckOverflow, isExplicit, targetType)
474
Debug.Assert(argument.Kind <> BoundKind.ArrayLiteral OrElse (convKind.Key And
ConversionKind
.UserDefined) <> 0)
519
(convKind.Key And
ConversionKind
.InvolvesNarrowingFromNumericConstant) = 0 Then
546
If (convKind.Key And
ConversionKind
.VarianceConversionAmbiguity) <> 0 Then
561
If (convKind.Key And
ConversionKind
.AnonymousDelegate) = 0 OrElse
562
(convKind.Key And
ConversionKind
.DelegateRelaxationLevelMask) <>
ConversionKind
.DelegateRelaxationLevelWideningDropReturnOrArgs Then
568
If (convKind.Key And
ConversionKind
.VarianceConversionAmbiguity) <> 0 Then
583
If (convKind.Key And
ConversionKind
.UserDefined) <> 0 AndAlso convKind.Value IsNot Nothing Then
595
Return New BoundConversion(tree, argument, convKind.Key And (Not
ConversionKind
.UserDefined), CheckOverflow, isExplicit, targetType, hasErrors:=True)
599
If (convKind.Key And
ConversionKind
.UserDefined) <> 0 Then
660
convKind As
ConversionKind
,
674
convKind As
ConversionKind
,
683
If (convKind And
ConversionKind
.UserDefined) <> 0 Then
837
Dim conv As
ConversionKind
= Nothing
849
If Not Conversions.IsNarrowingConversion(conv) OrElse (conv And
ConversionKind
.VarianceConversionAmbiguity) = 0 Then
865
(conv And
ConversionKind
.VarianceConversionAmbiguity) = 0 Then
980
convKind As
ConversionKind
,
985
Debug.Assert(Conversions.ConversionExists(convKind) AndAlso (convKind And
ConversionKind
.UserDefined) = 0)
990
If (convKind And
ConversionKind
.AnonymousDelegate) <> 0 Then
1002
If (convKind And
ConversionKind
.NeedAStub) <> 0 Then
1017
convKind And
ConversionKind
.DelegateRelaxationLevelMask,
1053
If (convKind =
ConversionKind
.WideningReference OrElse convKind =
ConversionKind
.NarrowingReference) AndAlso
1065
convKind As
ConversionKind
,
1069
If (convKind And
ConversionKind
.Tuple) <> 0 Then
1091
convKind As KeyValuePair(Of
ConversionKind
, MethodSymbol),
1097
Debug.Assert((convKind.Key And
ConversionKind
.UserDefined) <> 0 AndAlso convKind.Value IsNot Nothing AndAlso
1109
Dim intermediateConv As
ConversionKind
1196
convKind As
ConversionKind
,
1305
convKind As
ConversionKind
,
1325
Debug.Assert(Conversions.NoConversion(convKind) AndAlso (convKind And
ConversionKind
.DelegateRelaxationLevelMask) = 0)
1328
(convKind And
ConversionKind
.DelegateRelaxationLevelMask) >=
ConversionKind
.DelegateRelaxationLevelWideningToNonLambda)
1345
Debug.Assert((convKind And
ConversionKind
.DelegateRelaxationLevelMask) = 0)
1367
Debug.Assert(delegateInvoke IsNot Nothing OrElse (convKind And
ConversionKind
.DelegateRelaxationLevelMask) = 0)
1379
Debug.Assert((convKind And
ConversionKind
.DelegateRelaxationLevelMask) = 0)
1407
Debug.Assert((convKind And
ConversionKind
.DelegateRelaxationLevelMask) >= boundLambda.DelegateRelaxation)
1409
((convKind And
ConversionKind
.DelegateRelaxationLevelMask) <>
ConversionKind
.DelegateRelaxationLevelNone AndAlso
1418
If (convKind And
ConversionKind
.DelegateRelaxationLevelMask) =
ConversionKind
.DelegateRelaxationLevelInvalid AndAlso
1452
Dim anonymousDelegateInstance = New BoundConversion(tree, boundLambda,
ConversionKind
.Widening Or
ConversionKind
.Lambda,
1507
convKind As
ConversionKind
,
1617
Private Function ReclassifyInterpolatedStringExpression(conversionSemantics As SyntaxKind, tree As SyntaxNode, convKind As
ConversionKind
, isExplicit As Boolean, node As BoundInterpolatedStringExpression, targetType As TypeSymbol, diagnostics As BindingDiagnosticBag) As BoundExpression
1619
If (convKind And
ConversionKind
.InterpolatedString) =
ConversionKind
.InterpolatedString Then
1623
ConversionKind
.InterpolatedString, False, isExplicit, targetType)
1631
convKind As
ConversionKind
,
1640
Dim isNullableTupleConversion = (convKind And
ConversionKind
.Nullable) <> 0
1692
ConversionKind
.Identity,
1702
convKind As
ConversionKind
,
1782
(elemConv And (
ConversionKind
.Reference Or
ConversionKind
.Value Or
ConversionKind
.TypeParameter)) <> 0) Then
Binding\Binder_Delegates.vb (13)
22
Public ReadOnly DelegateConversions As
ConversionKind
28
DelegateConversions As
ConversionKind
,
137
boundFirstArgument = New BoundConversion(node, boundFirstArgument,
ConversionKind
.Identity, CheckOverflow, True, delegateType)
324
Dim delegateConversions As
ConversionKind
= Conversions.DetermineDelegateRelaxationLevel(methodConversions)
326
If (delegateConversions And
ConversionKind
.DelegateRelaxationLevelInvalid) <>
ConversionKind
.DelegateRelaxationLevelInvalid Then
328
delegateConversions = delegateConversions Or
ConversionKind
.Narrowing
330
delegateConversions = delegateConversions Or
ConversionKind
.Widening
905
) As
ConversionKind
1021
delegateResolutionResult.DelegateConversions And
ConversionKind
.DelegateRelaxationLevelMask,
1073
delegateRelaxation As
ConversionKind
,
1142
delegateRelaxation As
ConversionKind
,
1150
Debug.Assert((delegateRelaxation And (Not
ConversionKind
.DelegateRelaxationLevelMask)) = 0)
Binding\Binder_Expressions.vb (6)
130
Dim reclassified = ReclassifyArrayLiteralExpression(SyntaxKind.CTypeKeyword, arrayLiteral.Syntax,
ConversionKind
.Widening, False, arrayLiteral, arrayLiteral.InferredType, diagnostics)
792
Dim convKind As
ConversionKind
= Conversions.ClassifyTryCastConversion(operandType, targetType, useSiteInfo)
1438
Return New BoundConversion(expr.Syntax, expr,
ConversionKind
.WideningNothingLiteral, False, False, expr.ConstantValueOpt,
1490
conv As
ConversionKind
,
1496
Debug.Assert((conv And
ConversionKind
.UserDefined) = 0)
1499
If Conversions.NoConversion(conv) AndAlso (conv And
ConversionKind
.FailedDueToArrayLiteralElementConversion) = 0 Then
Binding\Binder_Invocation.vb (16)
2322
Dim arrayConversion As KeyValuePair(Of
ConversionKind
, MethodSymbol) = Nothing
2496
Dim conv As KeyValuePair(Of
ConversionKind
, MethodSymbol) = Conversions.ClassifyConversion(boundTemp, copyBackType, Me, CompoundUseSiteInfo(Of AssemblySymbol).Discarded)
2503
Debug.Assert((conv.Key And
ConversionKind
.InvolvesNarrowingFromNumericConstant) = 0)
2554
Dim conv As KeyValuePair(Of
ConversionKind
, MethodSymbol) = Conversions.ClassifyConversion(argument, targetType, Me, CompoundUseSiteInfo(Of AssemblySymbol).Discarded)
2571
If (conv.Key And
ConversionKind
.InvolvesNarrowingFromNumericConstant) = 0 Then
2589
ElseIf (conv.Key And
ConversionKind
.InvolvesNarrowingFromNumericConstant) <> 0 Then
2699
Dim conversion As KeyValuePair(Of
ConversionKind
, MethodSymbol) = Conversions.Identity
2700
Dim conversionBack As KeyValuePair(Of
ConversionKind
, MethodSymbol) = Conversions.Identity
2795
conversionTo As KeyValuePair(Of
ConversionKind
, MethodSymbol),
2797
conversionFrom As KeyValuePair(Of
ConversionKind
, MethodSymbol),
2818
conversionTo As KeyValuePair(Of
ConversionKind
, MethodSymbol),
2819
conversionFrom As KeyValuePair(Of
ConversionKind
, MethodSymbol),
2826
Dim checkAgainst As KeyValuePair(Of
ConversionKind
, MethodSymbol) = Conversions.ClassifyConversion(argument, targetType, Me, CompoundUseSiteInfo(Of AssemblySymbol).Discarded)
2956
conversion As KeyValuePair(Of
ConversionKind
, MethodSymbol),
2961
Dim checkAgainst As KeyValuePair(Of
ConversionKind
, MethodSymbol) = Conversions.ClassifyConversion(argument, targetType, Me, CompoundUseSiteInfo(Of AssemblySymbol).Discarded)
3188
If Not (convertedValue.Kind = BoundKind.Conversion AndAlso (DirectCast(convertedValue, BoundConversion).ConversionKind And
ConversionKind
.UserDefined) <> 0) Then
Binding\Binder_Lambda.vb (18)
155
Dim maxRelaxationLevel As
ConversionKind
=
ConversionKind
.DelegateRelaxationLevelNone
220
Dim delegateRelaxation As
ConversionKind
= Nothing
226
delegateRelaxation =
ConversionKind
.DelegateRelaxationLevelInvalid 'No conversion
230
delegateRelaxation =
ConversionKind
.DelegateRelaxationLevelNone
241
If Not seenReturnWithAValue AndAlso lambdaSymbol.IsAsync AndAlso delegateRelaxation <
ConversionKind
.DelegateRelaxationLevelWideningDropReturnOrArgs AndAlso
243
delegateRelaxation =
ConversionKind
.DelegateRelaxationLevelWideningDropReturnOrArgs
251
If delegateRelaxation <>
ConversionKind
.DelegateRelaxationLevelInvalid Then
273
delegateRelaxation =
ConversionKind
.DelegateRelaxationLevelInvalid 'No conversion
279
If delegateRelaxation <>
ConversionKind
.DelegateRelaxationLevelInvalid Then
286
delegateRelaxation =
ConversionKind
.DelegateRelaxationLevelInvalid 'No conversion
297
delegateRelaxation = CType(Math.Max(delegateRelaxation, Conversions.DetermineDelegateRelaxationLevel(methodConversions)),
ConversionKind
)
309
delegateRelaxation =
ConversionKind
.DelegateRelaxationLevelInvalid 'No conversion
327
Private _delegateRelaxationLevel As
ConversionKind
=
ConversionKind
.DelegateRelaxationLevelNone
342
) As
ConversionKind
384
Dim returnRelaxation As
ConversionKind
= Conversions.DetermineDelegateRelaxationLevelForLambdaReturn(node.ExpressionOpt, _useSiteDiagnostics)
395
Dim returnRelaxation As
ConversionKind
= Conversions.DetermineDelegateRelaxationLevelForLambdaReturn(node.Expression, _useSiteDiagnostics)
Binding\Binder_Operators.vb (1)
824
dbNullOperand = New BoundConversion(dbNullOperand.Syntax, dbNullOperand,
ConversionKind
.Widening,
Binding\Binder_Statements.vb (1)
3511
Dim conversionKind As
ConversionKind
= Conversions.ClassifyTryCastConversion(enumeratorType, idisposableType, useSiteInfo)
Binding\SyntheticBoundTrees\AnonymousTypeSyntheticMethods.vb (5)
69
Dim boundTryCast As BoundExpression = New BoundTryCast(syntax, boundObjReference,
ConversionKind
.NarrowingReference,
151
ConversionKind
.WideningTypeParameter,
213
ConversionKind
.WideningReference, objectType, Nothing).MakeCompilerGenerated(),
304
ConversionKind
.WideningTypeParameter,
356
ConversionKind
.WideningTypeParameter, objectType, Nothing).MakeCompilerGenerated()
Binding\SyntheticBoundTrees\SynthesizedStringSwitchHashMethod.vb (2)
91
textI = F.Convert(i.Type, textI,
ConversionKind
.WideningNumeric)
92
textI = F.Convert(hashCode.Type, textI,
ConversionKind
.WideningNumeric)
BoundTree\BoundAddressOfOperator.vb (1)
34
Friend Function GetConversionClassification(targetType As TypeSymbol) As
ConversionKind
BoundTree\BoundArrayCreation.vb (1)
17
Public Sub New(syntax As SyntaxNode, bounds As ImmutableArray(Of BoundExpression), initializerOpt As BoundArrayInitialization, arrayLiteralOpt As BoundArrayLiteral, arrayLiteralConversion As
ConversionKind
, type As TypeSymbol, Optional hasErrors As Boolean = False)
BoundTree\BoundBinaryConditionalExpression.vb (1)
41
Dim conversion As
ConversionKind
= Conversions.ClassifyDirectCastConversion(TestExpression.Type, Type, CompoundUseSiteInfo(Of AssemblySymbol).Discarded)
BoundTree\BoundConversion.vb (10)
16
conversionKind As
ConversionKind
,
28
conversionKind As
ConversionKind
,
44
Debug.Assert((ConversionKind And VisualBasic.
ConversionKind
.UserDefined) = 0)
46
Debug.Assert(((ConversionKind And VisualBasic.
ConversionKind
.UserDefined) <> 0) = (Operand.Kind = BoundKind.UserDefinedConversion))
52
If (ConversionKind And (
ConversionKind
.Lambda Or
ConversionKind
.AnonymousDelegate)) <> 0 Then
54
Debug.Assert((ConversionKind And
ConversionKind
.AnonymousDelegate) <> 0 OrElse
58
If (ConversionKind And
ConversionKind
.Tuple) <> 0 Then
70
If (ConversionKind And VisualBasic.
ConversionKind
.Nullable) <> 0 Then
83
If (ConversionKind And
ConversionKind
.UserDefined) <> 0 AndAlso
BoundTree\BoundConversionOrCast.vb (1)
8
Public MustOverride ReadOnly Property ConversionKind As
ConversionKind
BoundTree\BoundDirectCast.vb (3)
16
conversionKind As
ConversionKind
,
26
conversionKind As
ConversionKind
,
34
Public Sub New(syntax As SyntaxNode, operand As BoundExpression, conversionKind As
ConversionKind
, constantValueOpt As ConstantValue, type As TypeSymbol, Optional hasErrors As Boolean = False)
BoundTree\BoundLambda.vb (3)
37
Debug.Assert((DelegateRelaxation And (Not
ConversionKind
.DelegateRelaxationLevelMask)) = 0)
44
(DelegateRelaxation And
ConversionKind
.DelegateRelaxationLevelMask) <>
ConversionKind
.DelegateRelaxationLevelNone)
BoundTree\BoundTryCast.vb (3)
15
conversionKind As
ConversionKind
,
25
conversionKind As
ConversionKind
,
33
Public Sub New(syntax As SyntaxNode, operand As BoundExpression, conversionKind As
ConversionKind
, constantValueOpt As ConstantValue, type As TypeSymbol, Optional hasErrors As Boolean = False)
BoundTree\BoundUserDefinedConversion.vb (2)
58
Debug.Assert(Conversions.ConversionExists(outConversion.ConversionKind) AndAlso (outConversion.ConversionKind And
ConversionKind
.UserDefined) = 0)
68
Debug.Assert(Conversions.ConversionExists(inConversion.ConversionKind) AndAlso (inConversion.ConversionKind And
ConversionKind
.UserDefined) = 0)
CodeGen\EmitConversion.vb (1)
179
If (conversion.ConversionKind And
ConversionKind
.Narrowing) <> 0 Then
Compilation\SemanticModel.vb (1)
944
conversion = New Conversion(New KeyValuePair(Of
ConversionKind
, MethodSymbol)(DirectCast(lowestExpr, BoundArrayCreation).ArrayLiteralConversion, Nothing))
Compilation\VisualBasicCompilation.vb (2)
1911
Return New Conversion(New KeyValuePair(Of
ConversionKind
, MethodSymbol)(
ConversionKind
.WideningNothingLiteral, Nothing))
Generated\BoundNodes.xml.Generated.vb (20)
2085
Public Sub New(syntax As SyntaxNode, operand As BoundExpression, conversionKind As
ConversionKind
, checked As Boolean, explicitCastInCode As Boolean, constantValueOpt As ConstantValue, extendedInfoOpt As BoundExtendedConversionInfo, type As TypeSymbol, Optional hasErrors As Boolean = False)
2112
Private ReadOnly _ConversionKind As
ConversionKind
2113
Public Overrides ReadOnly Property ConversionKind As
ConversionKind
2152
Public Function Update(operand As BoundExpression, conversionKind As
ConversionKind
, checked As Boolean, explicitCastInCode As Boolean, constantValueOpt As ConstantValue, extendedInfoOpt As BoundExtendedConversionInfo, type As TypeSymbol) As BoundConversion
2316
Public Sub New(syntax As SyntaxNode, operand As BoundExpression, conversionKind As
ConversionKind
, suppressVirtualCalls As Boolean, constantValueOpt As ConstantValue, relaxationLambdaOpt As BoundLambda, type As TypeSymbol, Optional hasErrors As Boolean = False)
2342
Private ReadOnly _ConversionKind As
ConversionKind
2343
Public Overrides ReadOnly Property ConversionKind As
ConversionKind
2375
Public Function Update(operand As BoundExpression, conversionKind As
ConversionKind
, suppressVirtualCalls As Boolean, constantValueOpt As ConstantValue, relaxationLambdaOpt As BoundLambda, type As TypeSymbol) As BoundDirectCast
2388
Public Sub New(syntax As SyntaxNode, operand As BoundExpression, conversionKind As
ConversionKind
, constantValueOpt As ConstantValue, relaxationLambdaOpt As BoundLambda, type As TypeSymbol, Optional hasErrors As Boolean = False)
2413
Private ReadOnly _ConversionKind As
ConversionKind
2414
Public Overrides ReadOnly Property ConversionKind As
ConversionKind
2439
Public Function Update(operand As BoundExpression, conversionKind As
ConversionKind
, constantValueOpt As ConstantValue, relaxationLambdaOpt As BoundLambda, type As TypeSymbol) As BoundTryCast
3956
Public Sub New(syntax As SyntaxNode, isParamArrayArgument As Boolean, bounds As ImmutableArray(Of BoundExpression), initializerOpt As BoundArrayInitialization, arrayLiteralOpt As BoundArrayLiteral, arrayLiteralConversion As
ConversionKind
, type As TypeSymbol, Optional hasErrors As Boolean = False)
4003
Private ReadOnly _ArrayLiteralConversion As
ConversionKind
4004
Public ReadOnly Property ArrayLiteralConversion As
ConversionKind
4015
Public Function Update(isParamArrayArgument As Boolean, bounds As ImmutableArray(Of BoundExpression), initializerOpt As BoundArrayInitialization, arrayLiteralOpt As BoundArrayLiteral, arrayLiteralConversion As
ConversionKind
, type As TypeSymbol) As BoundArrayCreation
6875
Public Sub New(syntax As SyntaxNode, lambdaSymbol As LambdaSymbol, body As BoundBlock, diagnostics As ReadOnlyBindingDiagnostic(Of AssemblySymbol), lambdaBinderOpt As LambdaBodyBinder, delegateRelaxation As
ConversionKind
, methodConversionKind As MethodConversionKind, Optional hasErrors As Boolean = False)
6923
Private ReadOnly _DelegateRelaxation As
ConversionKind
6924
Public ReadOnly Property DelegateRelaxation As
ConversionKind
6942
Public Function Update(lambdaSymbol As LambdaSymbol, body As BoundBlock, diagnostics As ReadOnlyBindingDiagnostic(Of AssemblySymbol), lambdaBinderOpt As LambdaBodyBinder, delegateRelaxation As
ConversionKind
, methodConversionKind As MethodConversionKind) As BoundLambda
Lowering\Diagnostics\DiagnosticsPass_ExpressionLambdas.vb (6)
324
If (node.ConversionKind And
ConversionKind
.ConvertedToExpressionTree) <> 0 Then
328
If Me.IsInExpressionLambda AndAlso (node.ConversionKind And
ConversionKind
.Lambda) <> 0 Then
340
If (node.ConversionKind And
ConversionKind
.ConvertedToExpressionTree) <> 0 Then
344
If Me.IsInExpressionLambda AndAlso (node.ConversionKind And
ConversionKind
.Lambda) <> 0 Then
356
If (node.ConversionKind And
ConversionKind
.ConvertedToExpressionTree) <> 0 Then
360
If Me.IsInExpressionLambda AndAlso (node.ConversionKind And
ConversionKind
.Lambda) <> 0 Then
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter_BinaryOperator.vb (2)
552
If ((conversion.ConversionKind And
ConversionKind
.Nullable) <> 0) AndAlso Not conversion.ExplicitCastInCode AndAlso Not operandType.IsNullableType Then
736
Return New BoundConversion(oldArg.Syntax, oldArg,
ConversionKind
.NarrowingNullable, False, False, parameterType)
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter_ConditionalExpresion.vb (13)
104
If (conversion.ConversionKind And
ConversionKind
.UserDefined) = 0 Then
110
Dim convKind As
ConversionKind
= Conversions.ClassifyPredefinedConversion(parameterType, conversion.Operand.Type, useSiteInfo)
113
If (convKind And
ConversionKind
.NarrowingNullable) =
ConversionKind
.NarrowingNullable AndAlso Not toType.IsNullableType Then
156
conversionKind:=
ConversionKind
.Narrowing Or
ConversionKind
.UserDefined,
185
Debug.Assert((conversion.ConversionKind And
ConversionKind
.UserDefined) <> 0)
203
Dim innerConversion As
ConversionKind
= Conversions.ClassifyConversion(realParameterType, expectedParameterType, useSiteInfo).Key
208
Debug.Assert((innerConversion And
ConversionKind
.NarrowingNullable) =
ConversionKind
.NarrowingNullable)
243
Dim newConversionKind As
ConversionKind
= conversion.ConversionKind And Not
ConversionKind
.Nullable
246
newConversionKind = newConversionKind Or
ConversionKind
.Nullable
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter_Conversion.vb (6)
53
Private Function ConvertExpression(operand As BoundExpression, conversion As
ConversionKind
, typeFrom As TypeSymbol, typeTo As TypeSymbol,
66
Debug.Assert(conversion =
ConversionKind
.WideningNothingLiteral OrElse
69
(conversion And (
ConversionKind
.Reference Or
ConversionKind
.Array)) <> 0)
95
If (conversion And
ConversionKind
.UserDefined) <> 0 Then
99
Return CreateUserDefinedConversion(userDefinedConversion, typeTo, (conversion And
ConversionKind
.Nullable) <> 0, isChecked)
Lowering\LambdaRewriter\LambdaRewriter.Analysis.vb (3)
346
Return VisitLambda(lambda, (node.ConversionKind And
ConversionKind
.ConvertedToExpressionTree) <> 0)
357
Return VisitLambda(lambda, (node.ConversionKind And
ConversionKind
.ConvertedToExpressionTree) <> 0)
368
Return VisitLambda(lambda, (conversion.ConversionKind And
ConversionKind
.ConvertedToExpressionTree) <> 0)
Lowering\LambdaRewriter\LambdaRewriter.vb (4)
460
New BoundDirectCast(syntaxNode, parameterExpr.MakeRValue(),
ConversionKind
.WideningReference, obj, Nothing),
935
Dim result As BoundExpression = RewriteLambda(lambda, VisitType(node.Type), (node.ConversionKind And
ConversionKind
.ConvertedToExpressionTree) <> 0)
950
Dim result As BoundExpression = RewriteLambda(lambda, VisitType(node.Type), (node.ConversionKind And
ConversionKind
.ConvertedToExpressionTree) <> 0)
965
Dim result As BoundExpression = RewriteLambda(lambda, VisitType(conversion.Type), (conversion.ConversionKind And
ConversionKind
.ConvertedToExpressionTree) <> 0)
Lowering\LocalRewriter\LocalRewriter_AssignmentOperator.vb (2)
411
Dim conversionKind As
ConversionKind
427
Debug.Assert((conversionKind And
ConversionKind
.UserDefined) = 0)
Lowering\LocalRewriter\LocalRewriter_BinaryOperators.vb (2)
606
result = New BoundDirectCast(node.Syntax, op,
ConversionKind
.WideningValue, node.Type, Nothing)
738
result = New BoundConversion(node.Syntax, DirectCast(result, BoundExpression),
ConversionKind
.NarrowingBoolean, node.Checked, False, node.Type)
Lowering\LocalRewriter\LocalRewriter_Call.vb (1)
27
ConversionKind
.WideningNumeric,
Lowering\LocalRewriter\LocalRewriter_ConditionalExpressions.vb (3)
32
If Conversions.IsWideningConversion(conversion) AndAlso Conversions.IsCLRPredefinedConversion(conversion) AndAlso ((conversion And
ConversionKind
.TypeParameter) = 0) Then
138
ConversionKind
.WideningNullable,
150
ConversionKind
.WideningNullable,
Lowering\LocalRewriter\LocalRewriter_Conversion.vb (46)
23
ConversionKind
.Identity,
45
If (node.ConversionKind And
ConversionKind
.Nullable) <> 0 Then
61
If (node.ConversionKind And
ConversionKind
.AnonymousDelegate) <> 0 Then
106
If (node.ConversionKind And (
ConversionKind
.Lambda Or
ConversionKind
.ConvertedToExpressionTree)) = (
ConversionKind
.Lambda Or
ConversionKind
.ConvertedToExpressionTree) Then
113
ElseIf (node.ConversionKind And
ConversionKind
.InterpolatedString) =
ConversionKind
.InterpolatedString Then
116
ElseIf (node.ConversionKind And (
ConversionKind
.Tuple Or
ConversionKind
.Nullable)) =
ConversionKind
.Tuple Then
160
Return conversion.ConversionKind =
ConversionKind
.Identity AndAlso Not conversion.ExplicitCastInCode
444
ConversionKind
.WideningNothingLiteral,
464
node.ConversionKind And (Not
ConversionKind
.Nullable),
537
Debug.Assert((convKind And
ConversionKind
.Tuple) = (node.ConversionKind And
ConversionKind
.Tuple))
553
If (convKind And
ConversionKind
.Tuple) <> 0 Then
720
Debug.Assert(rewrittenConversion.ConversionKind =
ConversionKind
.WideningNothingLiteral OrElse
723
(rewrittenConversion.ConversionKind And (
ConversionKind
.Reference Or
ConversionKind
.Array)) <> 0)
822
(node.ConversionKind And (Not
ConversionKind
.DelegateRelaxationLevelMask)) =
898
Dim conv =
ConversionKind
.NarrowingNumeric Or
ConversionKind
.InvolvesEnumTypeConversions
964
Dim conv As
ConversionKind
967
conv =
ConversionKind
.WideningNumeric Or
ConversionKind
.InvolvesEnumTypeConversions
969
conv =
ConversionKind
.WideningNumeric
1042
Dim conv =
ConversionKind
.NarrowingNumeric Or
ConversionKind
.InvolvesEnumTypeConversions
1103
Dim conv As
ConversionKind
1106
conv =
ConversionKind
.WideningNumeric Or
ConversionKind
.InvolvesEnumTypeConversions
1108
conv =
ConversionKind
.WideningNumeric
1179
Dim conv =
ConversionKind
.NarrowingNumeric Or
ConversionKind
.InvolvesEnumTypeConversions
1218
Debug.Assert(
ConversionKind
.WideningNumeric = Conversions.ClassifyConversion(typeFrom, mathRound.Parameters(0).Type, CompoundUseSiteInfo(Of AssemblySymbol).Discarded).Key)
1220
operand = New BoundConversion(node.Syntax, operand,
ConversionKind
.WideningNumeric, node.Checked, node.ExplicitCastInCode,
1294
If (node.ConversionKind And (
ConversionKind
.Lambda Or
ConversionKind
.ConvertedToExpressionTree)) = (
ConversionKind
.Lambda Or
ConversionKind
.ConvertedToExpressionTree) Then
1320
If (node.ConversionKind And (
ConversionKind
.Lambda Or
ConversionKind
.ConvertedToExpressionTree)) = (
ConversionKind
.Lambda Or
ConversionKind
.ConvertedToExpressionTree) Then
Lowering\LocalRewriter\LocalRewriter_DelegateCreation.vb (2)
45
ConversionKind
.Lambda Or
ConversionKind
.Widening,
Lowering\LocalRewriter\LocalRewriter_InterpolatedString.vb (2)
57
Debug.Assert((conversion.ConversionKind And
ConversionKind
.InterpolatedString) =
ConversionKind
.InterpolatedString)
Lowering\LocalRewriter\LocalRewriter_LateAddressOf.vb (2)
142
ConversionKind
.DelegateRelaxationLevelWidening,
148
ConversionKind
.DelegateRelaxationLevelWidening,
Lowering\LocalRewriter\LocalRewriter_NullableHelpers.vb (5)
230
Return (conversion.ConversionKind And (
ConversionKind
.Widening Or
ConversionKind
.Nullable Or
ConversionKind
.UserDefined)) = (
ConversionKind
.Widening Or
ConversionKind
.Nullable) AndAlso
Lowering\LocalRewriter\LocalRewriter_ObjectCreation.vb (1)
43
Dim conv As
ConversionKind
= Conversions.ClassifyDirectCastConversion(result.Type, node.Type, useSiteInfo)
Lowering\LocalRewriter\LocalRewriter_Query.vb (1)
209
ConversionKind
.DelegateRelaxationLevelNone,
Lowering\LocalRewriter\LocalRewriter_With.vb (1)
121
ConversionKind
.WideningNothingLiteral,
Lowering\SyntheticBoundNodeFactory.vb (5)
644
ConversionKind
.WideningNothingLiteral,
1016
Return Convert(type, arg,
ConversionKind
.WideningNothingLiteral, isChecked)
1018
Return Convert(type, arg,
ConversionKind
.WideningReference, isChecked) ' will abort before code gen due to error, so doesn't matter if conversion kind is wrong.
1024
Public Function Convert(type As TypeSymbol, arg As BoundExpression, convKind As
ConversionKind
, Optional isChecked As Boolean = False) As BoundConversion
1025
Debug.Assert((convKind And
ConversionKind
.UserDefined) = 0)
Operations\VisualBasicOperationFactory_Methods.vb (1)
578
If conversionKind.HasFlag(VisualBasic.
ConversionKind
.UserDefined) AndAlso conversion.Operand.Kind = BoundKind.UserDefinedConversion Then
Semantics\Conversions.vb (506)
21
Private ReadOnly _convKind As
ConversionKind
24
Friend Sub New(conv As KeyValuePair(Of
ConversionKind
, MethodSymbol))
29
Friend ReadOnly Property Kind As
ConversionKind
84
Return (_convKind And
ConversionKind
.WideningNothingLiteral) =
ConversionKind
.WideningNothingLiteral
94
Return (_convKind And
ConversionKind
.Numeric) <> 0
103
Return (_convKind And
ConversionKind
.Boolean) <> 0
113
Return (_convKind And
ConversionKind
.Reference) <> 0
123
Return (_convKind And
ConversionKind
.AnonymousDelegate) <> 0
132
Return (_convKind And
ConversionKind
.Lambda) <> 0
142
Return (_convKind And
ConversionKind
.Array) <> 0
152
Return (_convKind And
ConversionKind
.Value) <> 0
162
Return (_convKind And
ConversionKind
.Nullable) <> 0
172
Return (_convKind And
ConversionKind
.String) <> 0
182
Return (_convKind And
ConversionKind
.TypeParameter) <> 0
196
Return (_convKind And
ConversionKind
.UserDefined) <> 0
278
If _convKind =
ConversionKind
.DelegateRelaxationLevelNone Then
319
''' Can be combined with <see cref="
ConversionKind
.Tuple"/> to indicate that the underlying value conversion is a predefined tuple conversion
405
''' Can be combined with <see cref="
ConversionKind
.Nullable"/> to indicate that the underlying value conversion is a predefined tuple conversion
465
Public Shared ReadOnly Identity As New KeyValuePair(Of
ConversionKind
, MethodSymbol)(
ConversionKind
.Identity, Nothing)
481
Const IDN As Integer =
ConversionKind
.Identity
482
Const NUM As Integer =
ConversionKind
.WideningNumeric
483
Const NNM As Integer =
ConversionKind
.NarrowingNumeric
484
Const IRF As Integer =
ConversionKind
.WideningReference
485
Const NRF As Integer =
ConversionKind
.NarrowingReference
486
Const WIV As Integer =
ConversionKind
.WideningValue
487
Const NAV As Integer =
ConversionKind
.NarrowingValue
488
Const NST As Integer =
ConversionKind
.NarrowingString
489
Const WST As Integer =
ConversionKind
.WideningString
490
Const NBO As Integer =
ConversionKind
.NarrowingBoolean
516
Public Shared Function ClassifyPredefinedConversion(source As TypeSymbol, target As TypeSymbol) As
ConversionKind
?
562
Return
ConversionKind
.WideningValue
567
Return
ConversionKind
.NarrowingValue
571
Dim conv As
ConversionKind
= CType(s_convkind(sourceIndex.Value, targetIndex.Value),
ConversionKind
)
598
conv =
ConversionKind
.NarrowingNumeric Or
ConversionKind
.InvolvesEnumTypeConversions
604
conv = conv Or
ConversionKind
.InvolvesEnumTypeConversions
605
If (conv And
ConversionKind
.Identity) <> 0 Then
606
conv = (conv And Not
ConversionKind
.Identity) Or
ConversionKind
.Widening Or
ConversionKind
.Numeric
612
conv = conv Or
ConversionKind
.InvolvesEnumTypeConversions
619
conv = (conv And Not
ConversionKind
.Widening) Or
ConversionKind
.Narrowing Or
ConversionKind
.InvolvesEnumTypeConversions
620
If (conv And
ConversionKind
.Identity) <> 0 Then
621
conv = (conv And Not
ConversionKind
.Identity) Or
ConversionKind
.Numeric
625
Debug.Assert(Conversions.IsIdentityConversion(conv) OrElse (conv And
ConversionKind
.InvolvesEnumTypeConversions) <> 0)
651
conv =
ConversionKind
.NarrowingNullable
655
conv =
ConversionKind
.WideningNullable
663
conv =
ConversionKind
.NarrowingNullable
672
conv =
ConversionKind
.WideningNullable
676
conv =
ConversionKind
.NarrowingNullable
685
Private Shared Function FastClassifyPredefinedConversion(source As TypeSymbol, target As TypeSymbol) As
ConversionKind
?
870
conversion As
ConversionKind
,
885
conversion As
ConversionKind
,
897
If conversion =
ConversionKind
.WideningNothingLiteral OrElse
899
(conversion And
ConversionKind
.WideningReference) =
ConversionKind
.WideningReference OrElse
900
(conversion And
ConversionKind
.WideningArray) =
ConversionKind
.WideningArray Then
910
Public Shared Function ClassifyConversion(source As TypeSymbol, destination As TypeSymbol, <[In], Out> ByRef useSiteInfo As CompoundUseSiteInfo(Of AssemblySymbol)) As KeyValuePair(Of
ConversionKind
, MethodSymbol)
917
Dim predefinedConversion As
ConversionKind
= ClassifyPredefinedConversion(source, destination, useSiteInfo)
920
Return New KeyValuePair(Of
ConversionKind
, MethodSymbol)(predefinedConversion, Nothing)
930
Public Shared Function ClassifyPredefinedConversion(source As BoundExpression, destination As TypeSymbol, binder As Binder, <[In], Out> ByRef useSiteInfo As CompoundUseSiteInfo(Of AssemblySymbol)) As
ConversionKind
940
) As
ConversionKind
946
Dim conv As
ConversionKind
1001
Dim predefinedConversion As
ConversionKind
= ClassifyPredefinedConversion(sourceType, destination, useSiteInfo)
1016
Public Shared Function ClassifyConversion(source As BoundExpression, destination As TypeSymbol, binder As Binder, <[In], Out> ByRef useSiteInfo As CompoundUseSiteInfo(Of AssemblySymbol)) As KeyValuePair(Of
ConversionKind
, MethodSymbol)
1021
Dim conv As
ConversionKind
1026
(conv And (
ConversionKind
.Lambda Or
ConversionKind
.FailedDueToArrayLiteralElementConversion)) <> 0 Then
1027
Return New KeyValuePair(Of
ConversionKind
, MethodSymbol)(conv, Nothing)
1034
Return New KeyValuePair(Of
ConversionKind
, MethodSymbol)(conv, Nothing)
1046
Private Shared Function ClassifyExpressionReclassification(source As BoundExpression, destination As TypeSymbol, binder As Binder, <[In], Out> ByRef useSiteInfo As CompoundUseSiteInfo(Of AssemblySymbol)) As
ConversionKind
1080
Private Shared Function ClassifyUnboundLambdaConversion(source As UnboundLambda, destination As TypeSymbol) As
ConversionKind
1081
Dim leastRelaxationLevel As
ConversionKind
=
ConversionKind
.DelegateRelaxationLevelNone
1082
Dim conversionKindExpressionTree As
ConversionKind
= Nothing ' Set to ConversionKind.ConvertedToExpressionTree if expression tree involved.
1089
leastRelaxationLevel =
ConversionKind
.DelegateRelaxationLevelWideningToNonLambda
1096
Return
ConversionKind
.Lambda ' No conversion
1107
conversionKindExpressionTree =
ConversionKind
.ConvertedToExpressionTree
1111
Return
ConversionKind
.Lambda Or conversionKindExpressionTree ' No conversion
1119
Return
ConversionKind
.Lambda Or conversionKindExpressionTree ' No conversion
1129
bound.DelegateRelaxation =
ConversionKind
.DelegateRelaxationLevelInvalid)
1131
If bound.DelegateRelaxation =
ConversionKind
.DelegateRelaxationLevelInvalid Then
1132
Return
ConversionKind
.Lambda Or
ConversionKind
.DelegateRelaxationLevelInvalid Or conversionKindExpressionTree ' No conversion
1135
Return
ConversionKind
.Lambda Or conversionKindExpressionTree Or
1136
If(IsNarrowingMethodConversion(bound.MethodConversionKind, isForAddressOf:=False),
ConversionKind
.Narrowing,
ConversionKind
.Widening) Or
1137
CType(Math.Max(bound.DelegateRelaxation, leastRelaxationLevel),
ConversionKind
)
1140
Public Shared Function ClassifyArrayLiteralConversion(source As BoundArrayLiteral, destination As TypeSymbol, binder As Binder, <[In], Out> ByRef useSiteInfo As CompoundUseSiteInfo(Of AssemblySymbol)) As
ConversionKind
1194
Dim conv As
ConversionKind
= ClassifyStringConversion(sourceType, destination)
1220
Return
ConversionKind
.Narrowing
1226
Public Shared Function ClassifyInterpolatedStringConversion(source As BoundInterpolatedStringExpression, destination As TypeSymbol, binder As Binder) As
ConversionKind
1232
Return
ConversionKind
.InterpolatedString
1239
Public Shared Function ClassifyTupleConversion(source As BoundTupleLiteral, destination As TypeSymbol, binder As Binder, <[In], Out> ByRef useSiteInfo As CompoundUseSiteInfo(Of AssemblySymbol)) As
ConversionKind
1241
Return
ConversionKind
.Identity
1246
Dim wideningConversion =
ConversionKind
.WideningTuple
1247
Dim narrowingConversion =
ConversionKind
.NarrowingTuple
1252
wideningConversion =
ConversionKind
.WideningNullableTuple
1253
narrowingConversion =
ConversionKind
.NarrowingNullableTuple
1272
Dim result As
ConversionKind
= wideningConversion
1276
Dim involvesNarrowingFromNumericConstant As
ConversionKind
= Nothing
1277
Dim allNarrowingIsFromNumericConstant =
ConversionKind
.InvolvesNarrowingFromNumericConstant
1279
Dim maxDelegateRelaxationLevel =
ConversionKind
.DelegateRelaxationLevelNone
1295
Dim elementDelegateRelaxationLevel = elementConversion And
ConversionKind
.DelegateRelaxationLevelMask
1308
Debug.Assert((allNarrowingIsFromNumericConstant And Not
ConversionKind
.InvolvesNarrowingFromNumericConstant) = 0)
1312
Private Shared Function ClassifyArrayInitialization(source As BoundArrayInitialization, targetElementType As TypeSymbol, binder As Binder, <[In], Out> ByRef useSiteInfo As CompoundUseSiteInfo(Of AssemblySymbol)) As
ConversionKind
1318
Return
ConversionKind
.FailedDueToArrayLiteralElementConversion
1321
Dim result =
ConversionKind
.Widening
1322
Dim mergedInvolvesNarrowingFromNumericConstant As
ConversionKind
=
ConversionKind
.InvolvesNarrowingFromNumericConstant
1328
Dim elementConv As
ConversionKind
1337
result =
ConversionKind
.Narrowing
1344
result =
ConversionKind
.FailedDueToArrayLiteralElementConversion
1349
If IsWideningConversion(result) AndAlso (elementConv And
ConversionKind
.InvolvesNarrowingFromNumericConstant) <> 0 Then
1353
Debug.Assert((mergedInvolvesNarrowingFromNumericConstant And
ConversionKind
.InvolvesNarrowingFromNumericConstant) <> 0)
1365
Private Shared Function ClassifyAddressOfConversion(source As BoundAddressOfOperator, destination As TypeSymbol) As
ConversionKind
1369
Private Shared Function ClassifyQueryLambdaConversion(source As BoundQueryLambda, destination As TypeSymbol, binder As Binder, <[In], Out> ByRef useSiteInfo As CompoundUseSiteInfo(Of AssemblySymbol)) As
ConversionKind
1378
Dim conversionKindExpressionTree As
ConversionKind
= If(wasExpressionTree,
ConversionKind
.ConvertedToExpressionTree, Nothing)
1407
Dim conv As KeyValuePair(Of
ConversionKind
, MethodSymbol)
1416
Return conv.Key And (Not
ConversionKind
.Identity) Or (
ConversionKind
.Widening Or
ConversionKind
.Lambda) Or conversionKindExpressionTree
1418
Return conv.Key Or (
ConversionKind
.Lambda Or
ConversionKind
.FailedDueToQueryLambdaBodyMismatch) Or conversionKindExpressionTree
1420
Debug.Assert(((conv.Key And
ConversionKind
.UserDefined) <> 0) = (conv.Value IsNot Nothing))
1421
Return (conv.Key And (Not (
ConversionKind
.UserDefined Or
ConversionKind
.Nullable Or
ConversionKind
.Tuple))) Or
ConversionKind
.Lambda Or conversionKindExpressionTree
1425
Return
ConversionKind
.Widening Or
ConversionKind
.Lambda Or conversionKindExpressionTree
1438
) As KeyValuePair(Of
ConversionKind
, MethodSymbol)
1460
Dim conv As KeyValuePair(Of
ConversionKind
, MethodSymbol) = Conversions.ClassifyConversion(operand, booleanType, binder, useSiteInfo)
1474
Dim convToNullableOfBoolean As KeyValuePair(Of
ConversionKind
, MethodSymbol) = Nothing
1513
Return New KeyValuePair(Of
ConversionKind
, MethodSymbol)(
ConversionKind
.Widening, Nothing)
1515
Not ((convToNullableOfBoolean.Key And (
ConversionKind
.UserDefined Or
ConversionKind
.Nullable)) =
1516
ConversionKind
.UserDefined AndAlso
1530
Private Shared Function ClassifyGroupTypeInferenceLambdaConversion(source As GroupTypeInferenceLambda, destination As TypeSymbol) As
ConversionKind
1582
Return (
ConversionKind
.Widening Or
ConversionKind
.Lambda)
1585
Private Shared Function ClassifyNumericConstantConversion(constantExpression As BoundExpression, destination As TypeSymbol, binder As Binder) As
ConversionKind
1600
Return
ConversionKind
.WideningNumeric Or
ConversionKind
.InvolvesEnumTypeConversions
1603
Return
ConversionKind
.NarrowingNullable Or
ConversionKind
.InvolvesNarrowingFromNumericConstant
1616
Return
ConversionKind
.Identity
1619
Dim conv As
ConversionKind
= Nothing 'ConversionKind.NoConversions
1635
conv = conv Or
ConversionKind
.InvolvesNarrowingFromNumericConstant
1646
conv = (conv And (Not
ConversionKind
.Narrowing)) Or
ConversionKind
.Widening
1652
Return
ConversionKind
.FailedDueToIntegerOverflow
1667
conv = conv Or
ConversionKind
.InvolvesNarrowingFromNumericConstant
1687
conv =
ConversionKind
.FailedDueToNumericOverflow
1691
Return
ConversionKind
.FailedDueToIntegerOverflow
1699
Private Shared Function ClassifyNothingLiteralConversion(constantExpression As BoundExpression, destination As TypeSymbol) As
ConversionKind
1709
Return
ConversionKind
.Identity
1712
Return
ConversionKind
.WideningNothingLiteral
1722
) As
ConversionKind
1733
Dim result As
ConversionKind
1747
Return
ConversionKind
.NarrowingNumeric Or
ConversionKind
.InvolvesEnumTypeConversions
1752
Return
ConversionKind
.WideningNumeric Or
ConversionKind
.InvolvesEnumTypeConversions
1759
Return
ConversionKind
.NarrowingNumeric Or
ConversionKind
.InvolvesEnumTypeConversions
1787
Public Shared Function ClassifyDirectCastConversion(source As BoundExpression, destination As TypeSymbol, binder As Binder, <[In], Out> ByRef useSiteInfo As CompoundUseSiteInfo(Of AssemblySymbol)) As
ConversionKind
1792
Dim conv As
ConversionKind
1804
If ConversionExists(conv) OrElse (conv And (
ConversionKind
.Lambda Or
ConversionKind
.FailedDueToArrayLiteralElementConversion)) <> 0 Then
1826
Public Shared Function ClassifyTryCastConversion(source As TypeSymbol, destination As TypeSymbol, <[In], Out> ByRef useSiteInfo As CompoundUseSiteInfo(Of AssemblySymbol)) As
ConversionKind
1833
Dim result As
ConversionKind
1843
Public Shared Function ClassifyTryCastConversion(source As BoundExpression, destination As TypeSymbol, binder As Binder, <[In], Out> ByRef useSiteInfo As CompoundUseSiteInfo(Of AssemblySymbol)) As
ConversionKind
1848
Dim conv As
ConversionKind
1860
If ConversionExists(conv) OrElse (conv And (
ConversionKind
.Lambda Or
ConversionKind
.FailedDueToArrayLiteralElementConversion)) <> 0 Then
1882
Private Shared Function ClassifyTryCastConversionForTypeParameters(source As TypeSymbol, destination As TypeSymbol, <[In], Out> ByRef useSiteInfo As CompoundUseSiteInfo(Of AssemblySymbol)) As
ConversionKind
1975
Return
ConversionKind
.Narrowing
1983
Dim conv As
ConversionKind
= ClassifyDirectCastConversion(src, dst, useSiteInfo)
1986
Debug.Assert((conv And
ConversionKind
.VarianceConversionAmbiguity) = 0)
2001
Return
ConversionKind
.Narrowing Or (conv And
ConversionKind
.InvolvesEnumTypeConversions)
2008
Debug.Assert((conv And
ConversionKind
.VarianceConversionAmbiguity) = 0)
2023
Return
ConversionKind
.Narrowing Or (conv And
ConversionKind
.InvolvesEnumTypeConversions)
2084
Private Shared Function ClassifyUserDefinedConversion(source As TypeSymbol, destination As TypeSymbol, <[In], Out> ByRef useSiteInfo As CompoundUseSiteInfo(Of AssemblySymbol)) As KeyValuePair(Of
ConversionKind
, MethodSymbol)
2108
Private Shared Function ClassifyUserDefinedConversion(source As BoundExpression, destination As TypeSymbol, binder As Binder, <[In], Out> ByRef useSiteInfo As CompoundUseSiteInfo(Of AssemblySymbol)) As KeyValuePair(Of
ConversionKind
, MethodSymbol)
2132
Dim conv As KeyValuePair(Of
ConversionKind
, MethodSymbol) = ClassifyUserDefinedConversion(sourceType, destination, useSiteInfo)
2142
Dim inConversion As
ConversionKind
2159
conv = New KeyValuePair(Of
ConversionKind
, MethodSymbol)((conv.Key And Not
ConversionKind
.Narrowing) Or
2160
(inConversion And
ConversionKind
.FailedDueToNumericOverflowMask),
2171
If (inConversion And
ConversionKind
.InvolvesNarrowingFromNumericConstant) <> 0 AndAlso
2175
Dim newConv As
ConversionKind
= conv.Key Or
ConversionKind
.InvolvesNarrowingFromNumericConstant
2179
newConv = (newConv And Not
ConversionKind
.Narrowing) Or
ConversionKind
.Widening
2182
conv = New KeyValuePair(Of
ConversionKind
, MethodSymbol)(newConv, conv.Value)
2193
Public Shared Function ClassifyPredefinedConversion(source As TypeSymbol, destination As TypeSymbol, <[In], Out> ByRef useSiteInfo As CompoundUseSiteInfo(Of AssemblySymbol)) As
ConversionKind
2209
Private Shared Function ClassifyPredefinedConversionSlow(source As TypeSymbol, destination As TypeSymbol, <[In], Out> ByRef useSiteInfo As CompoundUseSiteInfo(Of AssemblySymbol)) As
ConversionKind
2211
Dim result As
ConversionKind
2267
Private Shared Function AddDelegateRelaxationInformationForADelegate(source As TypeSymbol, destination As TypeSymbol, convKind As
ConversionKind
) As
ConversionKind
2268
Debug.Assert((convKind And
ConversionKind
.DelegateRelaxationLevelMask) = 0)
2273
convKind = convKind And (Not
ConversionKind
.DelegateRelaxationLevelMask)
2276
Return convKind Or
ConversionKind
.DelegateRelaxationLevelInvalid
2281
Return convKind Or
ConversionKind
.DelegateRelaxationLevelWideningToNonLambda
2283
Return convKind Or
ConversionKind
.DelegateRelaxationLevelWidening
2287
Return convKind Or
ConversionKind
.DelegateRelaxationLevelNarrowing
2294
Private Shared Function ClassifyIdentityConversion(source As TypeSymbol, destination As TypeSymbol) As
ConversionKind
2302
Return
ConversionKind
.Identity
2314
) As
ConversionKind
2352
Return
ConversionKind
.WideningReference
2358
Return
ConversionKind
.NarrowingReference
2361
Dim conv As
ConversionKind
= ClassifyReferenceConversionFromArrayToAnInterface(destination, source, varianceCompatibilityClassificationDepth, useSiteInfo)
2368
Return
ConversionKind
.NarrowingReference Or (conv And
ConversionKind
.InvolvesEnumTypeConversions)
2378
Dim conv As
ConversionKind
= ToInterfaceConversionClassifier.ClassifyConversionToVariantCompatibleInterface(DirectCast(source, NamedTypeSymbol),
2386
Debug.Assert((conv And Not (
ConversionKind
.Widening Or
ConversionKind
.Narrowing Or
2387
ConversionKind
.InvolvesEnumTypeConversions Or
2388
ConversionKind
.VarianceConversionAmbiguity)) = 0)
2389
Return conv Or
ConversionKind
.Reference
2396
Return
ConversionKind
.NarrowingReference
2410
Return
ConversionKind
.WideningReference
2414
Return
ConversionKind
.NarrowingReference
2418
Dim conv As
ConversionKind
= ClassifyConversionToVariantCompatibleDelegateType(DirectCast(source, NamedTypeSymbol),
2424
Debug.Assert((conv And Not (
ConversionKind
.Widening Or
ConversionKind
.Narrowing Or
2425
ConversionKind
.InvolvesEnumTypeConversions Or
2426
ConversionKind
.NarrowingDueToContraVarianceInDelegate)) = 0)
2427
Return conv Or
ConversionKind
.Reference
2428
ElseIf (conv And
ConversionKind
.MightSucceedAtRuntime) <> 0 Then
2429
Return
ConversionKind
.MightSucceedAtRuntime
2444
) As
ConversionKind
2455
Return
ConversionKind
.WideningReference
2497
Return
ConversionKind
.WideningReference
2500
Dim conv As
ConversionKind
= ClassifyArrayConversionBasedOnElementTypes(arrayElement, dstUnderlyingElement, varianceCompatibilityClassificationDepth, useSiteInfo)
2502
Debug.Assert((conv And
ConversionKind
.VarianceConversionAmbiguity) = 0)
2503
Return
ConversionKind
.WideningReference Or (conv And
ConversionKind
.InvolvesEnumTypeConversions)
2505
Return
ConversionKind
.NarrowingReference Or
2506
(conv And (
ConversionKind
.InvolvesEnumTypeConversions Or
ConversionKind
.VarianceConversionAmbiguity))
2512
Return
ConversionKind
.NarrowingReference
2520
Dim conv As
ConversionKind
= ClassifyDirectCastConversion(source, destination, useSiteInfo)
2523
(conv And
ConversionKind
.InvolvesEnumTypeConversions) = 0 Then
2535
) As
ConversionKind
2539
Const validBits As
ConversionKind
= (
ConversionKind
.Widening Or
ConversionKind
.Narrowing Or
2540
ConversionKind
.InvolvesEnumTypeConversions Or
2541
ConversionKind
.VarianceConversionAmbiguity Or
2542
ConversionKind
.MightSucceedAtRuntime Or
2543
ConversionKind
.NarrowingDueToContraVarianceInDelegate)
2545
Dim forwardConv As
ConversionKind
= ClassifyImmediateVarianceCompatibility(source, destination, varianceCompatibilityClassificationDepth, useSiteInfo)
2552
Dim backwardConv As
ConversionKind
= ClassifyImmediateVarianceCompatibility(destination, source, varianceCompatibilityClassificationDepth, useSiteInfo)
2556
Return (backwardConv And Not (
ConversionKind
.Widening Or
ConversionKind
.NarrowingDueToContraVarianceInDelegate)) Or
ConversionKind
.Narrowing
2559
Return ((forwardConv Or backwardConv) And
ConversionKind
.MightSucceedAtRuntime)
2567
Private _conv As
ConversionKind
2570
Public ReadOnly Property Result As
ConversionKind
2573
Return
ConversionKind
.Widening
2578
(_conv =
ConversionKind
.Widening OrElse
2579
_conv =
ConversionKind
.Narrowing OrElse
2580
_conv = (
ConversionKind
.Widening Or
ConversionKind
.InvolvesEnumTypeConversions) OrElse
2581
_conv = (
ConversionKind
.Narrowing Or
ConversionKind
.InvolvesEnumTypeConversions) OrElse
2582
_conv = (
ConversionKind
.Narrowing Or
ConversionKind
.VarianceConversionAmbiguity))))
2598
) As
ConversionKind
2654
Dim addConv As
ConversionKind
= ClassifyImmediateVarianceCompatibility(source, destination, varianceCompatibilityClassificationDepth, useSiteInfo)
2656
Debug.Assert((addConv And
ConversionKind
.NarrowingDueToContraVarianceInDelegate) = 0)
2658
If (addConv And
ConversionKind
.MightSucceedAtRuntime) <> 0 Then
2660
addConv =
ConversionKind
.Narrowing Or (addConv And (
ConversionKind
.InvolvesEnumTypeConversions Or
ConversionKind
.VarianceConversionAmbiguity))
2663
Const validNonidentityBits As
ConversionKind
= (
ConversionKind
.Widening Or
ConversionKind
.Narrowing Or
2664
ConversionKind
.InvolvesEnumTypeConversions Or
2665
ConversionKind
.VarianceConversionAmbiguity)
2671
_conv =
ConversionKind
.Identity
2678
If (_conv And
ConversionKind
.VarianceConversionAmbiguity) <> 0 Then
2683
_conv =
ConversionKind
.Narrowing Or
ConversionKind
.VarianceConversionAmbiguity
2703
) As
ConversionKind
2726
Return
ConversionKind
.Narrowing
2758
Dim involvesEnumTypeConversions As
ConversionKind
= Nothing
2759
Dim varianceConversionAmbiguity As
ConversionKind
=
ConversionKind
.VarianceConversionAmbiguity
2786
Dim conv As
ConversionKind
= Nothing
2793
(conv And
ConversionKind
.NarrowingDueToContraVarianceInDelegate) <> 0 Then
2817
If (conv And
ConversionKind
.MightSucceedAtRuntime) = 0 Then
2824
If (conv And
ConversionKind
.InvolvesEnumTypeConversions) <> 0 Then
2825
involvesEnumTypeConversions =
ConversionKind
.InvolvesEnumTypeConversions
2833
Debug.Assert((conv And
ConversionKind
.VarianceConversionAmbiguity) = 0)
2845
Return
ConversionKind
.Identity
2848
Return
ConversionKind
.MightSucceedAtRuntime Or varianceConversionAmbiguity Or involvesEnumTypeConversions
2851
Return
ConversionKind
.Narrowing Or
ConversionKind
.NarrowingDueToContraVarianceInDelegate Or involvesEnumTypeConversions
2853
Return
ConversionKind
.Widening Or involvesEnumTypeConversions
2943
Private Shared Function ClassifyAnonymousDelegateConversion(source As TypeSymbol, destination As TypeSymbol, <[In], Out> ByRef useSiteInfo As CompoundUseSiteInfo(Of AssemblySymbol)) As
ConversionKind
2966
Dim additionalFlags As
ConversionKind
= DetermineDelegateRelaxationLevel(methodConversion)
2969
additionalFlags = additionalFlags Or
ConversionKind
.NeedAStub
2980
Return
ConversionKind
.AnonymousDelegate Or
ConversionKind
.Narrowing Or additionalFlags
2982
Return
ConversionKind
.AnonymousDelegate Or
ConversionKind
.Widening Or additionalFlags
2994
) As
ConversionKind
3037
Public Shared Function ClassifyArrayElementConversion(srcElem As TypeSymbol, dstElem As TypeSymbol, <[In], Out> ByRef useSiteInfo As CompoundUseSiteInfo(Of AssemblySymbol)) As
ConversionKind
3039
Dim result As
ConversionKind
3055
) As
ConversionKind
3058
If NoConversion(conv) AndAlso (conv And
ConversionKind
.MightSucceedAtRuntime) = 0 Then
3061
If NoConversion(conv) AndAlso (conv And
ConversionKind
.MightSucceedAtRuntime) = 0 Then
3079
) As
ConversionKind
3111
Debug.Assert((conv And
ConversionKind
.VarianceConversionAmbiguity) = 0)
3117
Return
ConversionKind
.WideningArray Or (conv And
ConversionKind
.InvolvesEnumTypeConversions)
3135
Return
ConversionKind
.WideningArray Or (conv And
ConversionKind
.InvolvesEnumTypeConversions)
3144
Return
ConversionKind
.NarrowingArray Or (conv And
ConversionKind
.InvolvesEnumTypeConversions)
3152
Return
ConversionKind
.NarrowingArray Or (conv And
ConversionKind
.InvolvesEnumTypeConversions)
3162
Return
ConversionKind
.NarrowingArray Or (conv And
ConversionKind
.InvolvesEnumTypeConversions)
3169
Return
ConversionKind
.NarrowingArray Or
3170
(conv And (
ConversionKind
.InvolvesEnumTypeConversions Or
ConversionKind
.VarianceConversionAmbiguity))
3172
ElseIf (conv And
ConversionKind
.MightSucceedAtRuntime) <> 0 Then
3174
Return
ConversionKind
.MightSucceedAtRuntime
3186
Dim mightSucceedAtRuntime As
ConversionKind
= Nothing
3192
Debug.Assert((conv And
ConversionKind
.VarianceConversionAmbiguity) = 0)
3197
Return
ConversionKind
.WideningArray Or (conv And
ConversionKind
.InvolvesEnumTypeConversions)
3201
Return
ConversionKind
.NarrowingArray Or (conv And
ConversionKind
.InvolvesEnumTypeConversions)
3204
If (conv And
ConversionKind
.MightSucceedAtRuntime) <> 0 Then
3205
mightSucceedAtRuntime =
ConversionKind
.MightSucceedAtRuntime
3242
Return
ConversionKind
.NarrowingArray Or
ConversionKind
.InvolvesEnumTypeConversions
3249
Return
ConversionKind
.WideningArray Or
ConversionKind
.InvolvesEnumTypeConversions
3252
Return
ConversionKind
.NarrowingArray Or
ConversionKind
.InvolvesEnumTypeConversions
3260
Return
ConversionKind
.NarrowingArray Or
ConversionKind
.InvolvesEnumTypeConversions
3275
mightSucceedAtRuntime =
ConversionKind
.MightSucceedAtRuntime
3290
Debug.Assert((conv And
ConversionKind
.VarianceConversionAmbiguity) = 0)
3291
Return
ConversionKind
.NarrowingArray Or (conv And
ConversionKind
.InvolvesEnumTypeConversions)
3296
If (conv And
ConversionKind
.MightSucceedAtRuntime) <> 0 Then
3297
Return
ConversionKind
.MightSucceedAtRuntime
3303
Return
ConversionKind
.MightSucceedAtRuntime
3320
Return
ConversionKind
.NarrowingArray Or (conv And
ConversionKind
.InvolvesEnumTypeConversions)
3325
If (conv And
ConversionKind
.MightSucceedAtRuntime) <> 0 Then
3326
Return
ConversionKind
.MightSucceedAtRuntime
3330
Return
ConversionKind
.MightSucceedAtRuntime
3376
Private Shared Function ClassifyValueTypeConversion(source As TypeSymbol, destination As TypeSymbol, <[In], Out> ByRef useSiteInfo As CompoundUseSiteInfo(Of AssemblySymbol)) As
ConversionKind
3397
Return
ConversionKind
.WideningValue ' Shortcut
3403
Return
ConversionKind
.WideningValue
3408
Dim conv As
ConversionKind
= ToInterfaceConversionClassifier.ClassifyConversionToVariantCompatibleInterface(
3418
Debug.Assert((conv And Not (
ConversionKind
.Widening Or
ConversionKind
.Narrowing Or
3419
ConversionKind
.InvolvesEnumTypeConversions Or
3420
ConversionKind
.VarianceConversionAmbiguity)) = 0)
3421
Return conv Or
ConversionKind
.Value
3430
Return
ConversionKind
.NarrowingValue ' Shortcut
3436
Return
ConversionKind
.NarrowingValue
3447
Return
ConversionKind
.NarrowingValue
3457
Private Shared Function ClassifyNullableConversion(source As TypeSymbol, destination As TypeSymbol, <[In], Out> ByRef useSiteInfo As CompoundUseSiteInfo(Of AssemblySymbol)) As
ConversionKind
3495
Const preserveConversionKindFromUnderlyingPredefinedConversion As
ConversionKind
=
ConversionKind
.Tuple Or
ConversionKind
.DelegateRelaxationLevelMask
3499
Dim conv As
ConversionKind
3504
Debug.Assert((conv And
ConversionKind
.VarianceConversionAmbiguity) = 0)
3505
Debug.Assert((conv And
ConversionKind
.DelegateRelaxationLevelMask) = 0 OrElse (conv And
ConversionKind
.Tuple) <> 0)
3509
Return
ConversionKind
.WideningNullable Or (conv And preserveConversionKindFromUnderlyingPredefinedConversion)
3512
Return
ConversionKind
.NarrowingNullable Or (conv And preserveConversionKindFromUnderlyingPredefinedConversion)
3519
Debug.Assert((conv And
ConversionKind
.Tuple) = 0)
3523
Return
ConversionKind
.WideningNullable
3526
Return
ConversionKind
.NarrowingNullable
3531
Return
ConversionKind
.NarrowingNullable
3534
Debug.Assert((conv And
ConversionKind
.DelegateRelaxationLevelMask) = 0 OrElse (conv And
ConversionKind
.Tuple) <> 0)
3538
Return
ConversionKind
.NarrowingNullable Or (conv And preserveConversionKindFromUnderlyingPredefinedConversion)
3548
Return
ConversionKind
.WideningNullable
3552
Debug.Assert((conv And
ConversionKind
.VarianceConversionAmbiguity) = 0)
3553
Debug.Assert((conv And
ConversionKind
.DelegateRelaxationLevelMask) = 0 OrElse (conv And
ConversionKind
.Tuple) <> 0)
3557
Return
ConversionKind
.WideningNullable Or (conv And preserveConversionKindFromUnderlyingPredefinedConversion)
3560
Return
ConversionKind
.NarrowingNullable Or (conv And preserveConversionKindFromUnderlyingPredefinedConversion)
3568
Private Shared Function ClassifyTupleConversion(source As TypeSymbol, destination As TypeSymbol, <[In], Out> ByRef useSiteInfo As CompoundUseSiteInfo(Of AssemblySymbol)) As
ConversionKind
3585
Dim result As
ConversionKind
=
ConversionKind
.WideningTuple
3586
Dim maxDelegateRelaxationLevel =
ConversionKind
.DelegateRelaxationLevelNone
3602
Debug.Assert((elementConversion And
ConversionKind
.InvolvesNarrowingFromNumericConstant) = 0)
3603
Dim elementDelegateRelaxationLevel = elementConversion And
ConversionKind
.DelegateRelaxationLevelMask
3609
result =
ConversionKind
.NarrowingTuple
3616
Public Shared Function ClassifyStringConversion(source As TypeSymbol, destination As TypeSymbol) As
ConversionKind
3637
Return
ConversionKind
.WideningString
3639
Return
ConversionKind
.NarrowingString
3652
) As
ConversionKind
3676
Dim conv As
ConversionKind
3696
Return
ConversionKind
.MightSucceedAtRuntime
3707
) As
ConversionKind
3711
Return
ConversionKind
.WideningTypeParameter
3715
Dim result As
ConversionKind
= ClassifyConversionFromTypeParameter(typeParameter, destination, queue, varianceCompatibilityClassificationDepth, useSiteInfo)
3730
) As
ConversionKind
3753
Return
ConversionKind
.WideningTypeParameter
3765
Return
ConversionKind
.WideningTypeParameter
3783
Return
ConversionKind
.WideningTypeParameter
3788
Return
ConversionKind
.WideningTypeParameter Or
ConversionKind
.InvolvesEnumTypeConversions
3815
Return
ConversionKind
.WideningTypeParameter
3820
Dim conv As
ConversionKind
= ClassifyReferenceConversionFromArrayToAnInterface(constraint, destination, varianceCompatibilityClassificationDepth, useSiteInfo)
3824
Debug.Assert((conv And
ConversionKind
.VarianceConversionAmbiguity) = 0)
3825
Return
ConversionKind
.WideningTypeParameter Or (conv And
ConversionKind
.InvolvesEnumTypeConversions)
3833
Return
ConversionKind
.WideningTypeParameter
3838
Dim conv As
ConversionKind
= ClassifyArrayConversion(constraint, destination, varianceCompatibilityClassificationDepth, useSiteInfo)
3842
Debug.Assert((conv And
ConversionKind
.VarianceConversionAmbiguity) = 0)
3843
Return
ConversionKind
.WideningTypeParameter Or (conv And
ConversionKind
.InvolvesEnumTypeConversions)
3877
Dim conv As
ConversionKind
= convToInterface.Result
3885
Debug.Assert((conv And Not (
ConversionKind
.Widening Or
ConversionKind
.Narrowing Or
3886
ConversionKind
.InvolvesEnumTypeConversions Or
3887
ConversionKind
.VarianceConversionAmbiguity)) = 0)
3888
Return
ConversionKind
.TypeParameter Or conv
3893
Return
ConversionKind
.NarrowingTypeParameter
3904
) As
ConversionKind
3907
Return
ConversionKind
.NarrowingTypeParameter
3913
Return
ConversionKind
.NarrowingTypeParameter
3921
Return
ConversionKind
.NarrowingTypeParameter
3935
Return
ConversionKind
.NarrowingTypeParameter
3947
Return
ConversionKind
.NarrowingTypeParameter
3952
Return
ConversionKind
.NarrowingTypeParameter Or
ConversionKind
.InvolvesEnumTypeConversions
3969
Return
ConversionKind
.NarrowingTypeParameter
3978
Debug.Assert((conv And
ConversionKind
.VarianceConversionAmbiguity) = 0)
3979
Return
ConversionKind
.NarrowingTypeParameter Or (conv And
ConversionKind
.InvolvesEnumTypeConversions)
3991
Dim conv As
ConversionKind
= ClassifyTypeParameterConversion(source, constraint, varianceCompatibilityClassificationDepth, useSiteInfo)
3997
Return
ConversionKind
.NarrowingTypeParameter Or (conv And
ConversionKind
.InvolvesEnumTypeConversions)
4074
Dim typeConversion As
ConversionKind
= ClassifyConversion(returnTypeOfConvertFromMethod, returnTypeOfConvertToMethod, useSiteInfo).Key
4092
(typeConversion And
ConversionKind
.UserDefined) <> 0 Then
4125
conversion As
ConversionKind
,
4234
) As
ConversionKind
4237
Return
ConversionKind
.DelegateRelaxationLevelNone
4243
Return
ConversionKind
.DelegateRelaxationLevelNone
4272
) As
ConversionKind
4273
Dim result As
ConversionKind
4276
result =
ConversionKind
.DelegateRelaxationLevelNone
4279
result =
ConversionKind
.DelegateRelaxationLevelInvalid
4282
result =
ConversionKind
.DelegateRelaxationLevelNarrowing
4285
result =
ConversionKind
.DelegateRelaxationLevelWidening
4288
result =
ConversionKind
.DelegateRelaxationLevelWideningDropReturnOrArgs
4439
Public Shared Function IsWideningConversion(conv As
ConversionKind
) As Boolean
4441
((conv And
ConversionKind
.Widening) <> 0) <> ((conv And
ConversionKind
.Narrowing) <> 0))
4442
Return (conv And
ConversionKind
.Widening) <> 0
4445
Public Shared Function IsNarrowingConversion(conv As
ConversionKind
) As Boolean
4447
((conv And
ConversionKind
.Widening) <> 0) <> ((conv And
ConversionKind
.Narrowing) <> 0))
4448
Return (conv And
ConversionKind
.Narrowing) <> 0
4451
Public Shared Function NoConversion(conv As
ConversionKind
) As Boolean
4452
Return (conv And (
ConversionKind
.Narrowing Or
ConversionKind
.Widening)) = 0
4455
Public Shared Function ConversionExists(conv As
ConversionKind
) As Boolean
4456
Return (conv And (
ConversionKind
.Narrowing Or
ConversionKind
.Widening)) <> 0
4459
Public Shared Function IsIdentityConversion(conv As
ConversionKind
) As Boolean
4461
((conv And
ConversionKind
.Widening) <> 0) <> ((conv And
ConversionKind
.Narrowing) <> 0))
4462
Return (conv And
ConversionKind
.Identity) =
ConversionKind
.Identity
4465
Public Shared Function FailedDueToNumericOverflow(conv As
ConversionKind
) As Boolean
4466
Return (conv And (
ConversionKind
.Narrowing Or
ConversionKind
.Widening Or
ConversionKind
.FailedDueToNumericOverflow)) =
ConversionKind
.FailedDueToNumericOverflow
4469
Public Shared Function FailedDueToQueryLambdaBodyMismatch(conv As
ConversionKind
) As Boolean
4470
Return (conv And (
ConversionKind
.Narrowing Or
ConversionKind
.Widening Or
ConversionKind
.FailedDueToQueryLambdaBodyMismatch)) =
ConversionKind
.FailedDueToQueryLambdaBodyMismatch
4479
Public Shared Function IsCLRPredefinedConversion(conversion As
ConversionKind
) As Boolean
4484
Const combinedClrConversions =
ConversionKind
.Reference Or
ConversionKind
.Array Or
ConversionKind
.TypeParameter
Semantics\Operators.vb (37)
1930
) As KeyValuePair(Of
ConversionKind
, MethodSymbol)
1934
Dim result As KeyValuePair(Of
ConversionKind
, MethodSymbol) = Nothing
1961
Dim conversionKinds = ArrayBuilder(Of KeyValuePair(Of
ConversionKind
,
ConversionKind
)).GetInstance()
1969
result = New KeyValuePair(Of
ConversionKind
, MethodSymbol)(
ConversionKind
.Widening Or
ConversionKind
.UserDefined, bestMatch)
1979
result = New KeyValuePair(Of
ConversionKind
, MethodSymbol)(
ConversionKind
.Narrowing Or
ConversionKind
.UserDefined, bestMatch)
2004
result = New KeyValuePair(Of
ConversionKind
, MethodSymbol)(
ConversionKind
.Widening Or
2005
ConversionKind
.UserDefined Or
2006
ConversionKind
.Nullable, bestMatch)
2012
result = New KeyValuePair(Of
ConversionKind
, MethodSymbol)(
ConversionKind
.Narrowing Or
2013
ConversionKind
.UserDefined Or
2014
ConversionKind
.Nullable, bestMatch)
2035
conversionKinds As ArrayBuilder(Of KeyValuePair(Of
ConversionKind
,
ConversionKind
)),
2115
Dim conversionIn As
ConversionKind
2116
Dim conversionOut As
ConversionKind
2119
conversionKinds(currentIndex) = New KeyValuePair(Of
ConversionKind
,
ConversionKind
)(conversionIn, conversionOut)
2302
<Out()> ByRef conversionIn As
ConversionKind
,
2303
<Out()> ByRef conversionOut As
ConversionKind
,
2327
conversionIn =
ConversionKind
.Identity
2372
conversionKinds As ArrayBuilder(Of KeyValuePair(Of
ConversionKind
,
ConversionKind
)),
2459
Dim conversionIn As
ConversionKind
2460
Dim conversionOut As
ConversionKind
2466
Dim conversion As KeyValuePair(Of
ConversionKind
,
ConversionKind
) = conversionKinds(currentIndex)
2475
conversionKinds(currentIndex) = New KeyValuePair(Of
ConversionKind
,
ConversionKind
)(conversionIn, conversionOut)
2695
Dim conv As
ConversionKind
= Conversions.ClassifyPredefinedConversion(type, typeSet(j), useSiteInfo)
2740
Dim conv As
ConversionKind
= Conversions.ClassifyPredefinedConversion(typeSet(j), type, useSiteInfo)
Semantics\OverloadResolution.vb (45)
555
Private Const s_delegateRelaxationLevelMask_AssertZero = SmallFieldMask.DelegateRelaxationLevelMask -
ConversionKind
.DelegateRelaxationLevelMask
566
Public ReadOnly Conversion As KeyValuePair(Of
ConversionKind
, MethodSymbol)
569
Public Sub New(value As BoundExpression, conversion As KeyValuePair(Of
ConversionKind
, MethodSymbol), dependencies As ImmutableArray(Of AssemblySymbol))
647
Public ReadOnly Property MaxDelegateRelaxationLevel As
ConversionKind
649
Return CType(_smallFields And SmallFieldMask.DelegateRelaxationLevelMask,
ConversionKind
)
653
Public Sub RegisterDelegateRelaxationLevel(conversionKind As
ConversionKind
)
657
Debug.Assert(relaxationLevel <=
ConversionKind
.DelegateRelaxationLevelNarrowing)
659
If relaxationLevel =
ConversionKind
.DelegateRelaxationLevelNarrowing Then
746
Public ConversionsOpt As ImmutableArray(Of KeyValuePair(Of
ConversionKind
, MethodSymbol))
747
Public ConversionsBackOpt As ImmutableArray(Of KeyValuePair(Of
ConversionKind
, MethodSymbol))
1011
candidate.MaxDelegateRelaxationLevel =
ConversionKind
.DelegateRelaxationLevelNarrowing))
1334
If candidate.RequiresNarrowingConversion OrElse candidate.MaxDelegateRelaxationLevel =
ConversionKind
.DelegateRelaxationLevelNarrowing Then
1986
Dim minMaxRelaxation As
ConversionKind
=
ConversionKind
.DelegateRelaxationLevelInvalid
1993
Dim relaxation As
ConversionKind
= current.MaxDelegateRelaxationLevel
2013
Dim relaxation As
ConversionKind
= current.MaxDelegateRelaxationLevel
2758
Dim conv As KeyValuePair(Of
ConversionKind
, MethodSymbol) = current.ConversionsOpt(j)
2764
If (conv.Key And
ConversionKind
.UserDefined) = 0 Then
2770
If (conv.Key And
ConversionKind
.Nullable) = 0 Then
2895
conv As
ConversionKind
,
2899
Debug.Assert((conv And
ConversionKind
.UserDefined) = 0)
2900
Return (conv And
ConversionKind
.Nullable) <> 0 AndAlso
3231
Dim conversionKinds As KeyValuePair(Of
ConversionKind
, MethodSymbol)() = Nothing
3232
Dim conversionBackKinds As KeyValuePair(Of
ConversionKind
, MethodSymbol)() = Nothing
3313
Dim arrayConversion As KeyValuePair(Of
ConversionKind
, MethodSymbol) = Nothing
3344
conversionKinds = New KeyValuePair(Of
ConversionKind
, MethodSymbol)(arguments.Length - 1) {}
3391
Dim conv As KeyValuePair(Of
ConversionKind
, MethodSymbol) = Nothing
3408
conversionKinds = New KeyValuePair(Of
ConversionKind
, MethodSymbol)(arguments.Length - 1) {}
3471
Dim conversion As KeyValuePair(Of
ConversionKind
, MethodSymbol) = Nothing
3472
Dim conversionBack As KeyValuePair(Of
ConversionKind
, MethodSymbol) = Nothing
3492
conversionKinds = New KeyValuePair(Of
ConversionKind
, MethodSymbol)(arguments.Length - 1) {}
3519
conversionBackKinds = New KeyValuePair(Of
ConversionKind
, MethodSymbol)(arguments.Length - 1) {}
3565
<Out()> ByRef outConversionKind As KeyValuePair(Of
ConversionKind
, MethodSymbol),
3566
<Out()> ByRef outConversionBackKind As KeyValuePair(Of
ConversionKind
, MethodSymbol),
3584
Dim conv As KeyValuePair(Of
ConversionKind
, MethodSymbol) = Conversions.ClassifyConversion(targetType, copyBackType, useSiteInfo)
3598
Debug.Assert((conv.Key And
ConversionKind
.InvolvesNarrowingFromNumericConstant) = 0)
3644
<Out()> ByRef outConversionKind As KeyValuePair(Of
ConversionKind
, MethodSymbol),
3660
Dim conv As KeyValuePair(Of
ConversionKind
, MethodSymbol) = Conversions.ClassifyConversion(argument, targetType, binder, useSiteInfo)
3668
If (conv.Key And (
ConversionKind
.DelegateRelaxationLevelMask Or
ConversionKind
.Lambda)) = (
ConversionKind
.DelegateRelaxationLevelInvalid Or
ConversionKind
.Lambda) Then
3715
If (conv.Key And
ConversionKind
.InvolvesNarrowingFromNumericConstant) = 0 Then
3735
ElseIf (conv.Key And
ConversionKind
.InvolvesNarrowingFromNumericConstant) <> 0 Then
3793
<Out()> ByRef outConvKind As KeyValuePair(Of
ConversionKind
, MethodSymbol),
Semantics\TypeInference\TypeInferenceCollection.vb (14)
258
Dim conversion As
ConversionKind
270
conversion =
ConversionKind
.Identity
429
Dim conversion As
ConversionKind
436
conversion =
ConversionKind
.Identity
458
conversion =
ConversionKind
.Identity
459
ElseIf (conversion And
ConversionKind
.InvolvesNarrowingFromNumericConstant) <> 0 Then
468
conversion =
ConversionKind
.Narrowing
479
Dim inConversion As
ConversionKind
= Conversions.ClassifyConversion(hint, candidate, useSiteInfo).Key
482
Dim outConversion As
ConversionKind
= Conversions.ClassifyConversion(candidate, hint, useSiteInfo).Key
488
conversion =
ConversionKind
.Narrowing
490
conversion =
ConversionKind
.Identity
494
conversion =
ConversionKind
.Widening
514
conversion =
ConversionKind
.Identity
530
conversion =
ConversionKind
.Identity
Symbols\Metadata\PE\PEFieldSymbol.vb (1)
259
ConversionKind
.WideningNothingLiteral,
Symbols\Source\SynthesizedEventAccessorSymbol.vb (12)
325
Dim conversionKind1 As
ConversionKind
326
Dim conversionKind2 As
ConversionKind
333
Debug.Assert(conversionKind1 =
ConversionKind
.WideningReference)
334
Debug.Assert(conversionKind2 =
ConversionKind
.WideningReference)
344
New BoundDirectCast(syntax, boundBackingField.MakeRValue(),
ConversionKind
.WideningReference, updateMethod.Parameters(0).Type),
345
New BoundDirectCast(syntax, boundParameter,
ConversionKind
.WideningReference, updateMethod.Parameters(1).Type)),
348
ConversionKind
.NarrowingReference,
410
Debug.Assert(conversionKind1 =
ConversionKind
.WideningReference)
411
Debug.Assert(conversionKind2 =
ConversionKind
.WideningReference)
421
New BoundDirectCast(syntax, boundTmps(1).MakeRValue(),
ConversionKind
.WideningReference, updateMethod.Parameters(0).Type),
422
New BoundDirectCast(syntax, boundParameter,
ConversionKind
.WideningReference, updateMethod.Parameters(1).Type)),
425
ConversionKind
.NarrowingReference,
Symbols\Source\SynthesizedSubmissionConstructorSymbol.vb (3)
80
New BoundDirectCast(syntax, meReference,
ConversionKind
.Reference, type:=objectType),
94
ConversionKind
.Reference, type:=hostObjectField.Type),
114
ConversionKind
.Reference,
Utilities\VarianceAmbiguity.vb (1)
126
(Conversions.ClassifyDirectCastConversion(typeArgument1, typeArgument2, useSiteInfo) And
ConversionKind
.Reference) <> 0