402 references to Conversions
Microsoft.CodeAnalysis.VisualBasic (402)
Binding\Binder_Attributes.vb (3)
765Not Conversions.IsWideningConversion(conv.ConversionKind) OrElse 779Not Conversions.IsWideningConversion(conv.ConversionKind) OrElse 793Not Conversions.IsWideningConversion(conv.ConversionKind) OrElse
Binding\Binder_Conversions.vb (61)
87Dim conv As ConversionKind = Conversions.ClassifyDirectCastConversion(argument, targetType, Me, useSiteInfo) 120If Conversions.NoConversion(conv) Then 130If Conversions.NoConversion(conv) Then 135If Conversions.IsIdentityConversion(conv) Then 146Dim constantResult = Conversions.TryFoldConstantConversion( 152Debug.Assert(Conversions.IsIdentityConversion(conv) OrElse 158constantResult = Conversions.TryFoldNothingReferenceConversion(argument, conv, targetType) 161If Not Conversions.IsIdentityConversion(conv) Then 201conv = Conversions.ClassifyTryCastConversion(argument, targetType, Me, useSiteInfo) 237If Conversions.NoConversion(conv) Then 257If Conversions.NoConversion(conv) Then 262Dim constantResult = Conversions.TryFoldNothingReferenceConversion(argument, conv, targetType) 264If Not Conversions.IsIdentityConversion(conv) Then 367conv = Conversions.ClassifyConversionOfOperandOfConditionalBranch(argument, targetType, Me, 403conv = Conversions.ClassifyConversion(argument, targetType, Me, useSiteInfo) 441If (Not isExplicit OrElse explicitSemanticForConcatArgument) AndAlso Conversions.IsIdentityConversion(convKind.Key) Then 486Conversions.IsNarrowingConversion(convKind.Key) AndAlso 487Conversions.IsNarrowingConversion(Conversions.ClassifyArrayLiteralConversion(DirectCast(argument, BoundArrayLiteral), sourceType, Me, useSiteInfo)) 507If Conversions.NoConversion(convKind.Key) Then 518If Not isExplicit AndAlso Conversions.IsNarrowingConversion(convKind.Key) AndAlso 579If Conversions.NoConversion(convKind.Key) Then 580If Conversions.FailedDueToNumericOverflow(convKind.Key) Then 741Conversions.IsWideningConversion(Conversions.Classify_Reference_Array_TypeParameterConversion(sourceTypeArgument, 844conv = Conversions.Classify_Reference_Array_TypeParameterConversion(sourceArg, destinationArg, 848If Not Conversions.IsWideningConversion(conv) Then 849If Not Conversions.IsNarrowingConversion(conv) OrElse (conv And ConversionKind.VarianceConversionAmbiguity) = 0 Then 858conv = Conversions.Classify_Reference_Array_TypeParameterConversion(destinationArg, sourceArg, 862If Not Conversions.IsWideningConversion(conv) Then 864Not Conversions.IsNarrowingConversion(conv) OrElse 872conv = Conversions.ClassifyDirectCastConversion(sourceArg, destinationArg, useSiteInfo) 874If Conversions.IsWideningConversion(conv) Then 877conv = Conversions.ClassifyDirectCastConversion(destinationArg, sourceArg, useSiteInfo) 879If Conversions.IsWideningConversion(conv) Then 985Debug.Assert(Conversions.ConversionExists(convKind) AndAlso (convKind And ConversionKind.UserDefined) = 0) 993If isExplicit OrElse OptionStrict <> VisualBasic.OptionStrict.On OrElse Conversions.IsWideningConversion(convKind) Then 994Debug.Assert(Not Conversions.IsIdentityConversion(convKind)) 1038Dim constantResult = Conversions.TryFoldConstantConversion( 1048constantResult = Conversions.TryFoldNothingReferenceConversion(argument, convKind, targetType) 1117intermediateConv = Conversions.ClassifyArrayLiteralConversion(arrayLiteral, inType, arrayLiteralBinder, useSiteInfo) 1126intermediateConv = Conversions.ClassifyPredefinedConversion(argument, inType, conversionBinder, useSiteInfo) 1128If Not Conversions.IsIdentityConversion(intermediateConv) Then 1159intermediateConv = Conversions.ClassifyPredefinedConversion(argument, targetType, conversionBinder, useSiteInfo) 1161If Not Conversions.IsIdentityConversion(intermediateConv) Then 1247If Conversions.ConversionExists(delegateResolutionResult.DelegateConversions) Then 1325Debug.Assert(Conversions.NoConversion(convKind) AndAlso (convKind And ConversionKind.DelegateRelaxationLevelMask) = 0) 1327Debug.Assert(Conversions.NoConversion(convKind) OrElse 1390Debug.Assert(Conversions.NoConversion(convKind)) 1408Debug.Assert(Conversions.ClassifyMethodConversionForLambdaOrAnonymousDelegate(delegateInvoke, boundLambda.LambdaSymbol, CompoundUseSiteInfo(Of AssemblySymbol).Discarded) = MethodConversionKind.Identity OrElse 1439ElseIf Conversions.IsStubRequiredForMethodConversion(boundLambda.MethodConversionKind) Then 1440Debug.Assert(Conversions.IsDelegateRelaxationSupportedFor(boundLambda.MethodConversionKind)) 1517If Conversions.NoConversion(convKind) Then 1536Conversions.FailedDueToQueryLambdaBodyMismatch(convKind) Then 1708If Conversions.IsNarrowingConversion(convKind) Then 1728Not Conversions.IsWideningConversion(Conversions.ClassifyDirectCastConversion(classType, interfaceType, useSiteInfo)) Then 1772Dim elemConv = Conversions.ClassifyDirectCastConversion(sourceElement, targetElement, CompoundUseSiteInfo(Of AssemblySymbol).Discarded) 1774If Not Conversions.IsIdentityConversion(elemConv) AndAlso 1780ElseIf Not Conversions.IsIdentityConversion(elemConv) AndAlso 1781Not (Conversions.IsWideningConversion(elemConv) AndAlso
Binding\Binder_Delegates.vb (15)
324Dim delegateConversions As ConversionKind = Conversions.DetermineDelegateRelaxationLevel(methodConversions) 327If Conversions.IsNarrowingMethodConversion(methodConversions, isForAddressOf:=Not isForHandles) Then 640Conversions.ClassifyMethodConversionBasedOnReturn(targetMethodSymbol.ReturnType, targetMethodSymbol.ReturnsByRef, 683Conversions.IsDelegateRelaxationSupportedFor(methodConversions) AndAlso 684Conversions.IsStubRequiredForMethodConversion(methodConversions) Then 688If Conversions.IsDelegateRelaxationSupportedFor(methodConversions) Then 818Not Conversions.IsIdentityConversion(bestResult.ConversionsOpt(lastCommonIndex).Key) Then 834Debug.Assert(Conversions.IsWideningConversion(bestResult.ConversionsOpt(lastCommonIndex).Key)) 836Dim conv = Conversions.ClassifyConversion(bestCandidate.Parameters(lastCommonIndex).Type, 841Conversions.ClassifyMethodConversionBasedOnArgumentConversion(conv.Key, 876Conversions.ClassifyMethodConversionBasedOnArgumentConversion(conversion.Key, 885If Not Conversions.IsIdentityConversion(conversion.Key) Then 888Conversions.ClassifyMethodConversionBasedOnArgumentConversion(conversion.Key, 993If Me.OptionStrict = OptionStrict.On AndAlso Conversions.IsNarrowingConversion(delegateResolutionResult.DelegateConversions) Then 1008If Conversions.IsStubRequiredForMethodConversion(delegateResolutionResult.MethodConversions) OrElse
Binding\Binder_Expressions.vb (8)
792Dim convKind As ConversionKind = Conversions.ClassifyTryCastConversion(operandType, targetType, useSiteInfo) 797ElseIf Not Conversions.ConversionExists(convKind) Then 1499If Conversions.NoConversion(conv) AndAlso (conv And ConversionKind.FailedDueToArrayLiteralElementConversion) = 0 Then 1571Debug.Assert(Not Conversions.IsIdentityConversion(conv)) 1580conv = Conversions.ClassifyStringConversion(sourceType, destination) 1582If Conversions.IsWideningConversion(conv) Then 4885Not Conversions.IsWideningConversion(Conversions.ClassifyDirectCastConversion(getAwaiter.Type, notifyCompletion, useSiteInfo)) Then
Binding\Binder_Invocation.vb (16)
1040Conversions.ClassifyConversion(receiver, targetType, Me, useSiteInfo), 1042Conversions.ClassifyConversion(targetType, receiver.Type, useSiteInfo), 2496Dim conv As KeyValuePair(Of ConversionKind, MethodSymbol) = Conversions.ClassifyConversion(boundTemp, copyBackType, Me, CompoundUseSiteInfo(Of AssemblySymbol).Discarded) 2498If Conversions.NoConversion(conv.Key) Then 2501ElseIf Conversions.IsNarrowingConversion(conv.Key) Then 2554Dim conv As KeyValuePair(Of ConversionKind, MethodSymbol) = Conversions.ClassifyConversion(argument, targetType, Me, CompoundUseSiteInfo(Of AssemblySymbol).Discarded) 2556If Conversions.NoConversion(conv.Key) Then 2569If Conversions.IsNarrowingConversion(conv.Key) Then 2699Dim conversion As KeyValuePair(Of ConversionKind, MethodSymbol) = Conversions.Identity 2700Dim conversionBack As KeyValuePair(Of ConversionKind, MethodSymbol) = Conversions.Identity 2710Conversions.Identity, 2826Dim checkAgainst As KeyValuePair(Of ConversionKind, MethodSymbol) = Conversions.ClassifyConversion(argument, targetType, Me, CompoundUseSiteInfo(Of AssemblySymbol).Discarded) 2839If isLValue AndAlso Conversions.IsIdentityConversion(conversionTo.Key) Then 2841Debug.Assert(Conversions.IsIdentityConversion(conversionFrom.Key)) 2860checkAgainst = Conversions.ClassifyConversion(outPlaceholder, copyBackType, Me, CompoundUseSiteInfo(Of AssemblySymbol).Discarded) 2961Dim checkAgainst As KeyValuePair(Of ConversionKind, MethodSymbol) = Conversions.ClassifyConversion(argument, targetType, Me, CompoundUseSiteInfo(Of AssemblySymbol).Discarded)
Binding\Binder_Lambda.vb (6)
254methodConversions = Conversions.ClassifyMethodConversionForLambdaOrAnonymousDelegate(target, lambdaSymbol, useSiteInfo) 261If Conversions.IsDelegateRelaxationSupportedFor(methodConversions) Then 262If Conversions.IsStubRequiredForMethodConversion(methodConversions) Then 297delegateRelaxation = CType(Math.Max(delegateRelaxation, Conversions.DetermineDelegateRelaxationLevel(methodConversions)), ConversionKind) 384Dim returnRelaxation As ConversionKind = Conversions.DetermineDelegateRelaxationLevelForLambdaReturn(node.ExpressionOpt, _useSiteDiagnostics) 395Dim returnRelaxation As ConversionKind = Conversions.DetermineDelegateRelaxationLevelForLambdaReturn(node.Expression, _useSiteDiagnostics)
Binding\Binder_Statements.vb (11)
3456If Conversions.IsIdentityConversion(Conversions.ClassifyConversion(elementType, currentType, useSiteInfo:=CompoundUseSiteInfo(Of AssemblySymbol).Discarded).Key) Then 3470Not Conversions.IsIdentityConversion(Conversions.ClassifyConversion(controlVariableType, elementType, useSiteInfo:=CompoundUseSiteInfo(Of AssemblySymbol).Discarded).Key) Then 3511Dim conversionKind As ConversionKind = Conversions.ClassifyTryCastConversion(enumeratorType, idisposableType, useSiteInfo) 3996Dim conversionKind = Conversions.ClassifyDirectCastConversion(getEnumeratorReturnType, idisposable, useSiteInfo) 4000isOrInheritsFromOrImplementsIDisposable = Conversions.IsWideningConversion(conversionKind) 4602Dim conversionKind = Conversions.ClassifyDirectCastConversion(resourceType, iDisposable, useSiteInfo) 4609Dim isValidDispose = Conversions.IsWideningConversion(conversionKind) 5061Not Conversions.ConversionExists(Conversions.ClassifyConversion(arg, retType, Me, useSiteInfo).Key) Then
Binding\MemberSemanticModel.vb (3)
150Return New Conversion(Conversions.ClassifyConversion(boundExpression, vbDestination, GetEnclosingBinder(boundExpression.Syntax), CompoundUseSiteInfo(Of AssemblySymbol).Discarded)) 781currentConversion = New Conversion(Conversions.ClassifyConversion(current.Type, elementType, useSiteInfo:=CompoundUseSiteInfo(Of AssemblySymbol).Discarded)) 789elementConversion = New Conversion(Conversions.ClassifyConversion(elementType, boundCurrentConversion.Type, useSiteInfo:=CompoundUseSiteInfo(Of AssemblySymbol).Discarded))
BoundTree\BoundBinaryConditionalExpression.vb (3)
41Dim conversion As ConversionKind = Conversions.ClassifyDirectCastConversion(TestExpression.Type, Type, CompoundUseSiteInfo(Of AssemblySymbol).Discarded) 42Debug.Assert(Conversions.IsWideningConversion(conversion) AndAlso Conversions.IsCLRPredefinedConversion(conversion))
BoundTree\BoundConversion.vb (2)
43If Conversions.NoConversion(ConversionKind) Then 48If Conversions.IsIdentityConversion(ConversionKind) Then
BoundTree\BoundUserDefinedConversion.vb (2)
58Debug.Assert(Conversions.ConversionExists(outConversion.ConversionKind) AndAlso (outConversion.ConversionKind And ConversionKind.UserDefined) = 0) 68Debug.Assert(Conversions.ConversionExists(inConversion.ConversionKind) AndAlso (inConversion.ConversionKind And ConversionKind.UserDefined) = 0)
CodeGen\EmitConversion.vb (5)
198If Not Conversions.IsIdentityConversion(conversion.ConversionKind) Then 288Not Conversions.IsIdentityConversion(conversion.ConversionKind) AndAlso 324If Not Conversions.IsIdentityConversion(conversion.ConversionKind) Then 389If Conversions.IsWideningConversion(conversion.ConversionKind) Then 483If Not Conversions.IsIdentityConversion(conversion.ConversionKind) Then
CodeGen\EmitExpression.vb (2)
1516If (Conversions.IsWideningConversion(conversionKind)) Then 1523If (Conversions.IsWideningConversion(conversionKind)) Then
Compilation\SemanticModel.vb (4)
920conversion = New Conversion(Conversions.Identity) 982conversion = New Conversion(Conversions.ClassifyConversion(type, convertedType, CompoundUseSiteInfo(Of AssemblySymbol).Discarded)) 1558Return New VisualBasicTypeInfo(type, type, New Conversion(Conversions.Identity)) 2367Return New Conversion(Conversions.ClassifyConversion(bnode, vbdestination, binder, CompoundUseSiteInfo(Of AssemblySymbol).Discarded))
Compilation\TypeInfo.vb (1)
18Friend Shared None As New VisualBasicTypeInfo(Nothing, Nothing, New Conversion(Conversions.Identity))
Compilation\VisualBasicCompilation.vb (1)
1891Return New Conversion(Conversions.ClassifyConversion(vbsource, vbdest, CompoundUseSiteInfo(Of AssemblySymbol).Discarded))
Lowering\AsyncRewriter\AsyncRewriter.AsyncMethodToClassRewriter.Await.vb (2)
219Conversions.IsWideningConversion( 220Conversions.ClassifyDirectCastConversion(
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter_ConditionalExpresion.vb (3)
110Dim convKind As ConversionKind = Conversions.ClassifyPredefinedConversion(parameterType, conversion.Operand.Type, useSiteInfo) 203Dim innerConversion As ConversionKind = Conversions.ClassifyConversion(realParameterType, expectedParameterType, useSiteInfo).Key 206Dim innerConversionApplied As Boolean = Not Conversions.IsIdentityConversion(innerConversion)
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter_Conversion.vb (4)
21If Conversions.IsIdentityConversion(node.ConversionKind) AndAlso Not node.Type.IsFloatingType() Then 30If Conversions.IsIdentityConversion(node.ConversionKind) Then 39If Conversions.IsIdentityConversion(node.ConversionKind) Then 67(Conversions.IsIdentityConversion(conversion) AndAlso
Lowering\LambdaRewriter\LambdaRewriter.vb (1)
1469Conversions.ClassifyMethodConversionForLambdaOrAnonymousDelegate(
Lowering\LocalRewriter\LocalRewriter_AssignmentOperator.vb (1)
432If Not Conversions.IsIdentityConversion(conversionKind) Then
Lowering\LocalRewriter\LocalRewriter_ConditionalExpressions.vb (2)
32If Conversions.IsWideningConversion(conversion) AndAlso Conversions.IsCLRPredefinedConversion(conversion) AndAlso ((conversion And ConversionKind.TypeParameter) = 0) Then
Lowering\LocalRewriter\LocalRewriter_Conversion.vb (26)
13If Not _inExpressionLambda AndAlso Conversions.IsIdentityConversion(node.ConversionKind) Then 314Debug.Assert(Not Conversions.IsIdentityConversion(node.ConversionKind)) 387If Conversions.IsIdentityConversion(node.ConversionKind) Then 425Dim convKind = Conversions.ClassifyConversion(rewrittenOperand.Type, innerTargetType, useSiteInfo).Key 426Debug.Assert(Conversions.ConversionExists(convKind)) 452Dim convKind = Conversions.ClassifyDirectCastConversion(unwrappedOperand.Type, resultType, useSiteInfo) 453Debug.Assert(Conversions.ConversionExists(convKind)) 535Dim convKind = Conversions.ClassifyConversion(operand.Type, unwrappedResultType, useSiteInfo).Key 536Debug.Assert(Conversions.ConversionExists(convKind)) 541Dim constantResult = Conversions.TryFoldConstantConversion(operand, unwrappedResultType, integerOverflow) 721(Conversions.IsIdentityConversion(rewrittenConversion.ConversionKind) AndAlso 806Conversions.ClassifyDirectCastConversion(operand.Type, objectType, useSiteInfo), 823Conversions.ClassifyDirectCastConversion(node.Operand.Type, node.Type, CompoundUseSiteInfo(Of AssemblySymbol).Discarded)) 881Conversions.ClassifyDirectCastConversion(operand.Type, typeFrom, useSiteInfo), 899Debug.Assert(conv = Conversions.ClassifyConversion(memberSymbol.ReturnType, targetResultType, CompoundUseSiteInfo(Of AssemblySymbol).Discarded).Key) 972Debug.Assert(conv = Conversions.ClassifyConversion(operandType, memberSymbol.Parameters(0).Type, CompoundUseSiteInfo(Of AssemblySymbol).Discarded).Key) 1044Debug.Assert(conv = Conversions.ClassifyConversion(memberSymbol.ReturnType, targetResultType, CompoundUseSiteInfo(Of AssemblySymbol).Discarded).Key) 1111Debug.Assert(conv = Conversions.ClassifyConversion(operandType, memberSymbol.Parameters(0).Type, CompoundUseSiteInfo(Of AssemblySymbol).Discarded).Key) 1181Debug.Assert(conv = Conversions.ClassifyConversion(memberSymbol.ReturnType, targetResultType, CompoundUseSiteInfo(Of AssemblySymbol).Discarded).Key) 1218Debug.Assert(ConversionKind.WideningNumeric = Conversions.ClassifyConversion(typeFrom, mathRound.Parameters(0).Type, CompoundUseSiteInfo(Of AssemblySymbol).Discarded).Key) 1227Debug.Assert(node.ConversionKind = Conversions.ClassifyConversion(mathRound.ReturnType, node.Type, CompoundUseSiteInfo(Of AssemblySymbol).Discarded).Key) 1287If Not _inExpressionLambda AndAlso Conversions.IsIdentityConversion(node.ConversionKind) Then 1313If Not _inExpressionLambda AndAlso Conversions.IsIdentityConversion(node.ConversionKind) Then 1327If Conversions.IsWideningConversion(node.ConversionKind) AndAlso 1328Not Conversions.IsIdentityConversion(node.ConversionKind) Then 1338Debug.Assert(node.ConversionKind = Conversions.ClassifyDirectCastConversion(operand.Type, node.Type, CompoundUseSiteInfo(Of AssemblySymbol).Discarded))
Lowering\LocalRewriter\LocalRewriter_LateBindingHelpers.vb (7)
24Dim convKind = Conversions.ClassifyDirectCastConversion(rewrittenReceiver.Type, objectType, useSiteInfo) 129Dim convKind = Conversions.ClassifyDirectCastConversion(argument.Type, objectType, useSiteInfo) 170Dim convKind = Conversions.ClassifyDirectCastConversion(rewrittenValue.Type, objectType, useSiteInfo) 217Dim convKind = Conversions.ClassifyDirectCastConversion(argument.Type, objectType, useSiteInfo) 233Dim convKind = Conversions.ClassifyDirectCastConversion(rewrittenValue.Type, objectType, useSiteInfo) 283Dim convKind = Conversions.ClassifyDirectCastConversion(argument.Type, objectType, useSiteInfo) 386Dim conversionKind = Conversions.ClassifyDirectCastConversion(objectType, targetType, useSiteInfo)
Lowering\LocalRewriter\LocalRewriter_LocalDeclaration.vb (1)
202Conversions.ClassifyDirectCastConversion(flag.Type, objectType, useSiteInfo),
Lowering\LocalRewriter\LocalRewriter_ObjectCreation.vb (3)
43Dim conv As ConversionKind = Conversions.ClassifyDirectCastConversion(result.Type, node.Type, useSiteInfo) 44Debug.Assert(Conversions.ConversionExists(conv)) 90Dim conversion = Conversions.ClassifyDirectCastConversion(createInstance.ReturnType, node.Type, useSiteInfo)
Lowering\LocalRewriter\LocalRewriter_OmittedArgument.vb (1)
24Dim conversion = Conversions.ClassifyDirectCastConversion(fieldAccess.Type, node.Type, useSiteInfo)
Lowering\LocalRewriter\LocalRewriter_RedimClause.vb (3)
55Conversions.ClassifyDirectCastConversion(arrayValueAccess.Type, systemArray, useSiteInfo), 59Conversions.ClassifyDirectCastConversion(valueBeingAssigned.Type, systemArray, useSiteInfo), 71Conversions.ClassifyDirectCastConversion(valueBeingAssigned.Type, assignmentTarget.Type, useSiteInfo),
Lowering\LocalRewriter\LocalRewriter_SyncLock.vb (3)
26Dim conversionKind = Conversions.ClassifyConversion(visitedLockExpression.Type, objectType, useSiteInfo).Key 33If Not Conversions.IsIdentityConversion(conversionKind) Then 35Dim constantResult = Conversions.TryFoldConstantConversion(
Lowering\SyntheticBoundNodeFactory.vb (7)
357Dim conversion = Conversions.ClassifyDirectCastConversion(expression.Type, Me.CurrentMethod.ReturnType, useSiteInfo) 358Debug.Assert(Conversions.IsWideningConversion(conversion)) 361If Not Conversions.IsIdentityConversion(conversion) Then 631Return New BoundTryCast(Me.Syntax, expression, Conversions.ClassifyTryCastConversion(expression.Type, type, CompoundUseSiteInfo(Of AssemblySymbol).Discarded), type) 645Conversions.ClassifyDirectCastConversion(expression.Type, type, CompoundUseSiteInfo(Of AssemblySymbol).Discarded)), 920Debug.Assert(systemReflectionMethodInfo.IsErrorType() OrElse Conversions.IsDerivedFrom(systemReflectionMethodInfo, getMethodFromHandle.ReturnType, discardedUseSiteInfo)) 1020Return Convert(type, arg, Conversions.ClassifyConversion(arg.Type, type, CompoundUseSiteInfo(Of AssemblySymbol).Discarded).Key, isChecked)
Semantics\Conversions.vb (63)
44Return Not Conversions.NoConversion(_convKind) 53Return Conversions.IsNarrowingConversion(_convKind) 62Return Conversions.IsWideningConversion(_convKind) 74Return Conversions.IsIdentityConversion(_convKind) 573If Conversions.NoConversion(conv) Then 596If Not (Conversions.IsIdentityConversion(conv) AndAlso sourceEnum.IsSameTypeIgnoringAll(targetEnum)) Then 601ElseIf Conversions.IsWideningConversion(conv) Then 609Debug.Assert(Conversions.IsNarrowingConversion(conv)) 625Debug.Assert(Conversions.IsIdentityConversion(conv) OrElse (conv And ConversionKind.InvolvesEnumTypeConversions) <> 0) 649If Conversions.IsNarrowingConversion(conv) Then 652ElseIf Not Conversions.IsIdentityConversion(conv) Then 653Debug.Assert(Conversions.IsWideningConversion(conv)) 657Debug.Assert(Conversions.IsIdentityConversion(conv) AndAlso sourceNullable.IsSameTypeIgnoringAll(targetNullable)) 669If Conversions.IsWideningConversion(conv) Then 674Debug.Assert(Conversions.IsNarrowingConversion(conv)) 1196If Conversions.NoConversion(conv) Then 1201If Conversions.NoConversion(conv) Then 1208If Conversions.NoConversion(arrayLiteralElementConv) Then 1213If Conversions.IsWideningConversion(conv) Then 1460Dim conv As KeyValuePair(Of ConversionKind, MethodSymbol) = Conversions.ClassifyConversion(operand, booleanType, binder, useSiteInfo) 1463If Conversions.IsWideningConversion(conv.Key) Then 1478convToNullableOfBoolean = Conversions.Identity 1487convToNullableOfBoolean = Conversions.ClassifyConversion(operand, nullableOfBoolean, binder, useSiteInfo) 1491If Conversions.IsWideningConversion(convToNullableOfBoolean.Key) Then 1514ElseIf Conversions.IsNarrowingConversion(convToNullableOfBoolean.Key) AndAlso 2344If Not Conversions.ClassifyAsReferenceType(source, srcIsClassType, srcIsDelegateType, srcIsInterfaceType, srcIsArrayType) OrElse 2345Not Conversions.ClassifyAsReferenceType(destination, dstIsClassType, dstIsDelegateType, dstIsInterfaceType, dstIsArrayType) Then 2445Debug.Assert(source IsNot Nothing AndAlso Conversions.IsArrayType(source)) 2446Debug.Assert(destination IsNot Nothing AndAlso Conversions.IsInterfaceType(destination)) 2522If Conversions.IsWideningConversion(conv) AndAlso 2536Debug.Assert(source IsNot Nothing AndAlso Conversions.IsDelegateType(source)) 2537Debug.Assert(destination IsNot Nothing AndAlso Conversions.IsDelegateType(destination)) 2616(Conversions.IsInterfaceType(source) OrElse Conversions.IsClassType(source) OrElse Conversions.IsValueType(source))) 2617Debug.Assert(destination IsNot Nothing AndAlso Conversions.IsInterfaceType(destination)) 2624If Conversions.IsInterfaceType(source) Then 2651Debug.Assert(Conversions.IsInterfaceType(source) AndAlso Conversions.IsInterfaceType(destination)) 2704Debug.Assert(Conversions.IsInterfaceType(source) OrElse Conversions.IsDelegateType(source)) 2705Debug.Assert(Conversions.IsInterfaceType(destination) OrElse Conversions.IsDelegateType(destination)) 2706Debug.Assert(Conversions.IsInterfaceType(source) = Conversions.IsInterfaceType(destination)) 2761Dim classifyingInterfaceConversions As Boolean = Conversions.IsInterfaceType(source) 2937(Conversions.IsClassType(derivedType) OrElse Conversions.IsArrayType(derivedType) OrElse Conversions.IsValueType(derivedType))) 2938Debug.Assert(baseType IsNot Nothing AndAlso Conversions.IsClassType(baseType)) 2979If Conversions.IsNarrowingMethodConversion(methodConversion, isForAddressOf:=True) Then 3016If Not Conversions.IsArrayType(source) OrElse Not Conversions.IsArrayType(destination) Then 4128If Conversions.NoConversion(conversion) Then 4130ElseIf Conversions.IsNarrowingConversion(conversion) Then 4132ElseIf Not Conversions.IsIdentityConversion(conversion) Then 4133Debug.Assert(Conversions.IsWideningConversion(conversion)) 4135If Conversions.IsCLRPredefinedConversion(conversion) AndAlso 4161Dim methodConversions = Conversions.ClassifyMethodConversionBasedOnReturn(lambdaOrDelegateInvokeSymbol.ReturnType, lambdaOrDelegateInvokeSymbol.ReturnsByRef, 4210Conversions.ClassifyMethodConversionBasedOnArgumentConversion( 4211Conversions.ClassifyConversion(toParameterType, lambdaParameterType, useSiteInfo).Key, 4217Conversions.ClassifyMethodConversionBasedOnArgumentConversion( 4218Conversions.ClassifyConversion(lambdaParameterType, toParameterType, useSiteInfo).Key,
Semantics\Operators.vb (43)
440If Conversions.HasWideningDirectCastConversionButNotEnumTypeConversion(targetType, sourceType, useSiteInfo) Then 449ElseIf Conversions.HasWideningDirectCastConversionButNotEnumTypeConversion(sourceType, targetType, useSiteInfo) Then 2128If Not (Conversions.IsWideningConversion(conversionIn) AndAlso Conversions.IsWideningConversion(conversionOut)) Then 2132If Not (Conversions.IsIdentityConversion(conversionIn) AndAlso Conversions.IsIdentityConversion(conversionOut)) Then 2147If Conversions.IsIdentityConversion(conversionIn) AndAlso Conversions.IsIdentityConversion(conversionOut) Then 2153If Conversions.IsIdentityConversion(conversionIn) Then 2157If Conversions.IsIdentityConversion(conversionOut) Then 2324conversionIn = Conversions.ClassifyArrayLiteralConversion(arrayLiteral, inputType, arrayLiteral.Binder, useSiteInfo) 2325If Conversions.IsWideningConversion(conversionIn) AndAlso 2330conversionIn = Conversions.ClassifyPredefinedConversion(source, inputType, useSiteInfo) 2333conversionOut = Conversions.ClassifyPredefinedConversion(outputType, destination, useSiteInfo) 2351If Conversions.ConversionExists(Conversions.ClassifyPredefinedConversion(inputType, outputType, localUseSiteInfo)) OrElse 2472Debug.Assert(Not (Conversions.IsWideningConversion(conversionIn) AndAlso Conversions.IsWideningConversion(conversionOut))) 2484If Not (Conversions.ConversionExists(conversionIn) AndAlso Conversions.ConversionExists(conversionOut)) Then 2488If Not (Conversions.IsIdentityConversion(conversionIn) AndAlso Conversions.IsIdentityConversion(conversionOut)) Then 2503If Conversions.IsIdentityConversion(conversionIn) AndAlso Conversions.IsIdentityConversion(conversionOut) Then 2509If Conversions.IsWideningConversion(conversionIn) Then 2510If Conversions.IsIdentityConversion(conversionIn) Then 2516If Conversions.IsWideningConversion(conversionOut) Then 2517If Conversions.IsIdentityConversion(conversionOut) Then 2523Debug.Assert(Conversions.IsNarrowingConversion(conversionOut)) 2526Debug.Assert(Conversions.IsNarrowingConversion(conversionIn)) 2528If Conversions.IsIdentityConversion(conversionOut) Then 2530ElseIf Not Conversions.IsNarrowingConversion(conversionOut) Then 2531Debug.Assert(Conversions.IsWideningConversion(conversionOut) AndAlso Not Conversions.IsIdentityConversion(conversionOut)) 2544Debug.Assert(Conversions.IsNarrowingConversion(conversionOut)) 2593If Not Conversions.IsWideningConversion(conversionKinds(i).Key) Then 2597Debug.Assert(Conversions.IsNarrowingConversion(conversionKinds(i).Key)) 2625If Not Conversions.IsWideningConversion(conversionKinds(i).Value) Then 2629Debug.Assert(Conversions.IsNarrowingConversion(conversionKinds(i).Value)) 2695Dim conv As ConversionKind = Conversions.ClassifyPredefinedConversion(type, typeSet(j), useSiteInfo) 2697If Not Conversions.IsWideningConversion(conv) Then 2740Dim conv As ConversionKind = Conversions.ClassifyPredefinedConversion(typeSet(j), type, useSiteInfo) 2742If Not Conversions.IsWideningConversion(conv) Then
Semantics\OverloadResolution.vb (34)
2025Dim leftToRightConversion = Conversions.ClassifyConversion(left, right, useSiteInfo) 2029If Conversions.IsIdentityConversion(leftToRightConversion.Key) Then 2034If Conversions.IsWideningConversion(leftToRightConversion.Key) Then 2039If Conversions.IsWideningConversion(Conversions.ClassifyConversion(right, left, useSiteInfo).Key) Then 2057If Conversions.IsWideningConversion(Conversions.ClassifyConversion(right, left, useSiteInfo).Key) Then 2400If Conversions.IsNarrowingConversion(conv.Key) Then 2552IsUnwrappingNullable(Conversions.ClassifyPredefinedConversion(sourceType, targetType, useSiteInfo), sourceType, targetType) 2965ElseIf Conversions.IsNarrowingConversion(arrayConversion.Key) Then 2978Debug.Assert(Conversions.IsWideningConversion(arrayConversion.Key)) 2982If Not Conversions.IsIdentityConversion(arrayConversion.Key) Then 2986conversionKinds(i) = Conversions.Identity 3046If Not Conversions.IsIdentityConversion(conv.Key) Then 3050conversionKinds(i) = Conversions.Identity 3125conversionBack = Conversions.Identity 3130If Not Conversions.IsIdentityConversion(conversion.Key) Then 3134conversionKinds(i) = Conversions.Identity 3155If Not Conversions.IsIdentityConversion(conversionBack.Key) Then 3161conversionBackKinds(i) = Conversions.Identity 3214outConversionKind = Conversions.Identity 3215outConversionBackKind = Conversions.Identity 3218outConversionBackKind = Conversions.Identity 3224Dim conv As KeyValuePair(Of ConversionKind, MethodSymbol) = Conversions.ClassifyConversion(targetType, copyBackType, useSiteInfo) 3227If Conversions.NoConversion(conv.Key) Then 3231If Conversions.IsNarrowingConversion(conv.Key) Then 3269outConversionBackKind = Conversions.Identity 3300Dim conv As KeyValuePair(Of ConversionKind, MethodSymbol) = Conversions.ClassifyConversion(argument, targetType, binder, useSiteInfo) 3304If Conversions.NoConversion(conv.Key) Then 3346If Conversions.IsNarrowingConversion(conv.Key) Then 3440outConvKind = Conversions.ClassifyConversion(expression, targetType, binder, useSiteInfo) 3443If Conversions.IsWideningConversion(outConvKind.Key) Then 3450Debug.Assert(Conversions.IsNarrowingConversion(outConvKind.Key)) 4764Return Conversions.HasWideningDirectCastConversionButNotEnumTypeConversion(instanceType, receiverType, useSiteInfo)
Semantics\TypeInference\TypeArgumentInference.vb (9)
380competitor.InferenceRestrictions = Conversions.CombineConversionRequirements( 552inferenceRestrictions = Conversions.CombineConversionRequirements( 554Conversions.InvertConversionRequirement(inferenceRestrictions)) 1489paramInferenceRestrictions = Conversions.InvertConversionRequirement( 1490Conversions.StrengthenConversionRequirementToReference(inferenceRestrictions)) 1494paramInferenceRestrictions = Conversions.StrengthenConversionRequirementToReference(inferenceRestrictions) 1551Conversions.CombineConversionRequirements(inferenceRestrictions, RequiredConversion.ArrayElement)) 1574Conversions.CombineConversionRequirements(inferenceRestrictions, If(argumentIsAarrayLiteral, RequiredConversion.Any, RequiredConversion.ArrayElement))) 1946(addrOf.Binder.OptionStrict = OptionStrict.On AndAlso Conversions.IsNarrowingMethodConversion(methodConversions, isForAddressOf:=True)) Then
Semantics\TypeInference\TypeInferenceCollection.vb (32)
263conversion = Conversions.ClassifyConversion(inner.ResultType, outer.ResultType, useSiteInfo).Key 267conversion = Conversions.ClassifyConversion(arrayLiteral, outer.ResultType, arrayLiteral.Binder, useSiteInfo).Key 268If Conversions.IsWideningConversion(conversion) AndAlso 274If Not Conversions.IsWideningConversion(conversion) Then 438conversion = Conversions.ClassifyDirectCastConversion(hint, candidate, useSiteInfo) 440If Not Conversions.IsIdentityConversion(conversion) Then 450conversion = Conversions.ClassifyConversion(hint, candidate, useSiteInfo).Key 454conversion = Conversions.ClassifyConversion(arrayLiteral, candidate, arrayLiteral.Binder, useSiteInfo).Key 455If Conversions.IsWideningConversion(conversion) Then 475conversion = Conversions.ClassifyConversion(candidate, hint, useSiteInfo).Key 479Dim inConversion As ConversionKind = Conversions.ClassifyConversion(hint, candidate, useSiteInfo).Key 482Dim outConversion As ConversionKind = Conversions.ClassifyConversion(candidate, hint, useSiteInfo).Key 485If Conversions.NoConversion(inConversion) OrElse Conversions.NoConversion(outConversion) Then 487ElseIf Conversions.IsNarrowingConversion(inConversion) OrElse Conversions.IsNarrowingConversion(outConversion) Then 489ElseIf Conversions.IsIdentityConversion(inConversion) AndAlso Conversions.IsIdentityConversion(outConversion) Then 492Debug.Assert(Conversions.IsWideningConversion(inConversion) AndAlso Conversions.IsWideningConversion(outConversion) AndAlso 493Not (Conversions.IsIdentityConversion(inConversion) AndAlso Conversions.IsIdentityConversion(outConversion))) 498conversion = Conversions.ClassifyArrayElementConversion(hint, candidate, useSiteInfo) 503conversion = Conversions.ClassifyDirectCastConversion(hint, candidate, useSiteInfo) 510If Conversions.IsNarrowingConversion(conversion) Then 523conversion = Conversions.ClassifyDirectCastConversion(candidate, hint, useSiteInfo) 526If Conversions.IsNarrowingConversion(conversion) Then 539If Conversions.NoConversion(conversion) Then 541ElseIf Conversions.IsNarrowingConversion(conversion) Then 543ElseIf Conversions.IsIdentityConversion(conversion) Then 545ElseIf Conversions.IsWideningConversion(conversion) Then 588competitor.InferenceRestrictions = Conversions.CombineConversionRequirements(
Symbols\ConstraintsHelper.vb (2)
786If result.IsClassType AndAlso Conversions.IsDerivedFrom(candidate, result, useSiteInfo) Then 928Return Conversions.HasWideningDirectCastConversionButNotEnumTypeConversion(typeArgument, constraintType, useSiteInfo)
Symbols\Metadata\PE\PEFieldSymbol.vb (1)
258Conversions.TryFoldNothingReferenceConversion(value,
Symbols\Source\CustomEventAccessorSymbol.vb (3)
191Dim conversion = Conversions.ClassifyMethodConversionForEventRaise( 197(Not Conversions.IsDelegateRelaxationSupportedFor(conversion) OrElse 198(binder.OptionStrict = OptionStrict.On AndAlso Conversions.IsNarrowingMethodConversion(conversion, False))) Then
Symbols\Source\SourceMemberMethodSymbol.vb (1)
830If Not Conversions.ConversionExists(resolutionResult.DelegateConversions) Then
Symbols\Source\SynthesizedEventAccessorSymbol.vb (4)
331conversionKind1 = Conversions.ClassifyDirectCastConversion(fieldSymbol.Type, updateMethod.Parameters(0).Type, conversionsUseSiteInfo) 332conversionKind2 = Conversions.ClassifyDirectCastConversion(boundParameter.Type, updateMethod.Parameters(1).Type, conversionsUseSiteInfo) 408conversionKind1 = Conversions.ClassifyDirectCastConversion(boundTmps(1).Type, updateMethod.Parameters(0).Type, CompoundUseSiteInfo(Of AssemblySymbol).Discarded) 409conversionKind2 = Conversions.ClassifyDirectCastConversion(boundParameter.Type, updateMethod.Parameters(1).Type, CompoundUseSiteInfo(Of AssemblySymbol).Discarded)
Utilities\VarianceAmbiguity.vb (1)
126(Conversions.ClassifyDirectCastConversion(typeArgument1, typeArgument2, useSiteInfo) And ConversionKind.Reference) <> 0
VisualBasicExtensions.vb (2)
1407Return If(inConversionConvertible IsNot Nothing, DirectCast(inConversionConvertible, Conversion), New Conversion(Conversions.Identity)) 1425Return If(outConversionConvertible IsNot Nothing, DirectCast(outConversionConvertible, Conversion), New Conversion(Conversions.Identity))