93 references to CONVERTTYPE
Microsoft.CSharp (93)
Microsoft\CSharp\RuntimeBinder\RuntimeBinder.cs (2)
1217CONVERTTYPE.CHECKOVERFLOW | CONVERTTYPE.NOUDC);
Microsoft\CSharp\RuntimeBinder\Semantics\Conversion.cs (34)
51CONVERTTYPE flags); 233(!canConvert(GetPredefindType((PredefinedType)i), GetPredefindType((PredefinedType)j), CONVERTTYPE.NOUDC) || s_simpleTypeBetter[i][j] == left) && 234(!canConvert(GetPredefindType((PredefinedType)j), GetPredefindType((PredefinedType)i), CONVERTTYPE.NOUDC) || s_simpleTypeBetter[j][i] == left)); 339private bool canConvert(CType src, CType dest, CONVERTTYPE flags) => BindImplicitConversion(null, src, dest, flags); 349private bool canConvert(Expr expr, CType dest, CONVERTTYPE flags) => 358private Expr mustConvertCore(Expr expr, CType dest, CONVERTTYPE flags) 412private Expr tryConvert(Expr expr, CType dest, CONVERTTYPE flags) 426public Expr mustConvert(Expr expr, CType dest) => mustConvert(expr, dest, (CONVERTTYPE)0); 429private Expr mustConvert(Expr expr, CType dest, CONVERTTYPE flags) => mustConvertCore(expr, dest, flags); 439private Expr mustCastCore(Expr expr, CType dest, CONVERTTYPE flags) 473if (!CanExplicitConversionBeBoundInUncheckedContext(expr, expr.Type, dest, flags | CONVERTTYPE.NOUDC)) 525public Expr mustCast(Expr expr, CType dest, CONVERTTYPE flags) => mustCastCore(expr, dest, flags); 528private Expr MustCastInUncheckedContext(Expr expr, CType dest, CONVERTTYPE flags) => 533private bool canCast(CType src, CType dest, CONVERTTYPE flags) => BindExplicitConversion(null, src, dest, flags); 536private bool BindImplicitConversion(Expr pSourceExpr, CType pSourceType, CType destinationType, CONVERTTYPE flags) 543private bool BindImplicitConversion(Expr pSourceExpr, CType pSourceType, CType destinationType, out Expr ppDestinationExpr, CONVERTTYPE flags) 552private bool BindImplicitConversion(Expr pSourceExpr, CType pSourceType, CType destinationType, bool needsExprDest, out Expr ppDestinationExpr, CONVERTTYPE flags) 561private bool BindExplicitConversion(Expr pSourceExpr, CType pSourceType, CType destinationType, bool needsExprDest, out Expr ppDestinationExpr, CONVERTTYPE flags) 570private bool BindExplicitConversion(Expr pSourceExpr, CType pSourceType, CType destinationType, out Expr ppDestinationExpr, CONVERTTYPE flags) 579private bool BindExplicitConversion(Expr pSourceExpr, CType pSourceType, CType destinationType, CONVERTTYPE flags) 764bool fFromImplicit = exprSrc != null ? canConvert(exprSrc, typeFrom, CONVERTTYPE.STANDARDANDNOUDC) : canConvert(typeSrc, typeFrom, CONVERTTYPE.STANDARDANDNOUDC); 766!canConvert(typeFrom, typeSrc, CONVERTTYPE.STANDARDANDNOUDC) && 769(!fIntPtrStandard || typeSrc is PointerType || typeFrom is PointerType || !canCast(typeSrc, typeFrom, CONVERTTYPE.NOUDC)))) 773bool fToImplicit = canConvert(typeTo, typeDst, CONVERTTYPE.STANDARDANDNOUDC); 775!canConvert(typeDst, typeTo, CONVERTTYPE.STANDARDANDNOUDC) && 778(!fIntPtrStandard || typeDst is PointerType || typeTo is PointerType || !canCast(typeTo, typeDst, CONVERTTYPE.NOUDC)))) 1101Expr pTransformedArgument = mustCastCore(pFrom, pTypeFrom, CONVERTTYPE.NOUDC); 1105Expr pCast = mustCastCore(pCall, pTypeDestination, CONVERTTYPE.NOUDC); 1330bool fCon1 = canConvert(type1, type2, CONVERTTYPE.NOUDC); 1331bool fCon2 = canConvert(type2, type1, CONVERTTYPE.NOUDC); 1364bool fCon1 = canConvert(type1, type2, CONVERTTYPE.NOUDC); 1365bool fCon2 = canConvert(type2, type1, CONVERTTYPE.NOUDC); 1485private bool CanExplicitConversionBeBoundInUncheckedContext(Expr exprSrc, CType typeSrc, CType typeDest, CONVERTTYPE flags)
Microsoft\CSharp\RuntimeBinder\Semantics\ExplicitConversion.cs (13)
40private readonly CONVERTTYPE _flags; 46public ExplicitConversion(ExpressionBinder binder, Expr exprSrc, CType typeSrc, CType typeDest, bool needsExprDest, CONVERTTYPE flags) 74Debug.Assert((_flags & CONVERTTYPE.STANDARD) == 0); 100if (_binder.BindImplicitConversion(_exprSrc, _typeSrc, _typeDest, _needsExprDest, out _exprDest, _flags | CONVERTTYPE.ISEXPLICIT)) 178if (0 == (_flags & CONVERTTYPE.NOUDC)) 194if (_typeDest.IsValueType && _binder.BindExplicitConversion(null, _typeSrc.StripNubs(), _typeDest, _flags | CONVERTTYPE.NOUDC)) 205if (!_binder.BindExplicitConversion(valueSrc, valueSrc.Type, _typeDest, _needsExprDest, out _exprDest, _flags | CONVERTTYPE.NOUDC)) 218if ((_flags & CONVERTTYPE.NOUDC) == 0) 364if (_binder.canConvert(GetPredefindType(PredefinedType.PT_ARRAY), _typeSrc, CONVERTTYPE.NOUDC)) 468if (result == ConstCastResult.CheckFailure && 0 == (_flags & CONVERTTYPE.CHECKOVERFLOW)) 527if (result == ConstCastResult.CheckFailure && 0 == (_flags & CONVERTTYPE.CHECKOVERFLOW)) 638if (result == ConstCastResult.CheckFailure && 0 == (_flags & CONVERTTYPE.CHECKOVERFLOW)) 657_binder.bindSimpleCast(_exprSrc, _typeDest, out _exprDest, (_flags & CONVERTTYPE.CHECKOVERFLOW) != 0 ? EXPRFLAG.EXF_CHECKOVERFLOW : 0);
Microsoft\CSharp\RuntimeBinder\Semantics\ExpressionBinder.cs (2)
655if (!(arg.Type is NullableType) || !canConvert(arg.Type.StripNubs(), typeRaw, CONVERTTYPE.NOUDC)) 1002pObject = tryConvert(pObject, swt.GetType(), CONVERTTYPE.NOUDC);
Microsoft\CSharp\RuntimeBinder\Semantics\ImplicitConversion.cs (24)
18public ImplicitConversion(ExpressionBinder binder, Expr exprSrc, CType typeSrc, CType typeDest, bool needsExprDest, CONVERTTYPE flags) 35private CONVERTTYPE _flags; 118((_flags & CONVERTTYPE.ISEXPLICIT) == 0 || (!_typeSrc.IsPredefType(PredefinedType.PT_FLOAT) && !_typeSrc.IsPredefType(PredefinedType.PT_DOUBLE)))) 137if ((_flags & CONVERTTYPE.ISEXPLICIT) != 0) 139_flags |= CONVERTTYPE.NOUDC; 215if (0 == (_flags & CONVERTTYPE.NOUDC)) 268Debug.Assert(0 != (~_flags & (CONVERTTYPE.STANDARD | CONVERTTYPE.ISEXPLICIT))); 282if (0 == (_flags & CONVERTTYPE.ISEXPLICIT)) 298ConversionFunc pfn = (_flags & CONVERTTYPE.ISEXPLICIT) != 0 ? 324if (_typeSrc == typeDstBase || pfn(_exprSrc, _typeSrc, typeDstBase, _needsExprDest, out exprTmp, _flags | CONVERTTYPE.NOUDC)) 354return 0 == (_flags & CONVERTTYPE.NOUDC) && _binder.bindUserDefinedConversion(_exprSrc, _typeSrc, nubDst, _needsExprDest, out _exprDest, 0 == (_flags & CONVERTTYPE.ISEXPLICIT)); 359if (typeSrcBase != typeDstBase && !pfn(null, typeSrcBase, typeDstBase, false, out _exprDest, _flags | CONVERTTYPE.NOUDC)) 362return 0 == (_flags & CONVERTTYPE.NOUDC) && _binder.bindUserDefinedConversion(_exprSrc, _typeSrc, nubDst, _needsExprDest, out _exprDest, 0 == (_flags & CONVERTTYPE.ISEXPLICIT)); 374bool convertible = (_flags & CONVERTTYPE.ISEXPLICIT) != 0 376arg1, arg1.Type, typeDstBase, out arg1, _flags | CONVERTTYPE.NOUDC) 378arg1, arg1.Type, typeDstBase, out arg1, _flags | CONVERTTYPE.NOUDC); 462return 0 == (_flags & CONVERTTYPE.NOUDC) && _binder.bindUserDefinedConversion(_exprSrc, nubSrc, _typeDest, _needsExprDest, out _exprDest, true); 4970 != (_flags & CONVERTTYPE.FORCECAST)))) 499(0 != (_flags & CONVERTTYPE.FORCECAST) || 6510 == (_flags & CONVERTTYPE.STANDARD)) 702Debug.Assert(0 != (_flags & CONVERTTYPE.ISEXPLICIT));
Microsoft\CSharp\RuntimeBinder\Semantics\Operators.cs (18)
980if (!canCast(type1, type2, CONVERTTYPE.NOUDC) && !canCast(type2, type1, CONVERTTYPE.NOUDC)) 1288mustCast(pArgument, uofs.GetType(), CONVERTTYPE.NOUDC); 1698return typeTmp != type ? mustCast(pExprResult, type, CONVERTTYPE.NOUDC) : pExprResult; 1721Expr op = mustCast(exprVal, arg.Type, CONVERTTYPE.NOUDC); 1958arg1 = binder.mustConvert(arg1, GetPredefindType(PredefinedType.PT_OBJECT), CONVERTTYPE.NOUDC); 1959arg2 = binder.mustConvert(arg2, GetPredefindType(PredefinedType.PT_OBJECT), CONVERTTYPE.NOUDC); 2024arg1 = binder.mustCast(arg1, typeOp, CONVERTTYPE.NOUDC); 2025arg2 = binder.mustCast(arg2, typeOp, CONVERTTYPE.NOUDC); 2032exprRes = binder.mustCast(exprRes, typeDst, CONVERTTYPE.NOUDC); 2065arg1 = mustCast(arg1, typeOp, CONVERTTYPE.NOUDC); 2066arg2 = mustCast(arg2, typeOp, CONVERTTYPE.NOUDC); 2075return mustCast(exprRes, typeDst, CONVERTTYPE.NOUDC); 2101arg = binder.mustCast(arg, typeOp, CONVERTTYPE.NOUDC); 2104return binder.MustCastInUncheckedContext(exprRes, typeEnum, CONVERTTYPE.NOUDC); 2256op = mustConvertCore(op, GetPredefindType(PredefinedType.PT_LONG), CONVERTTYPE.NOUDC); 2624if (!canConvert(arg1.Type.StripNubs(), paramsRaw[0], CONVERTTYPE.NOUDC)) 2628if (!canConvert(arg2.Type.StripNubs(), paramsRaw[1], CONVERTTYPE.NOUDC))