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