dmd.dcast
Semantic analysis for cast-expressions.
License
Source: dcast.d
Documentation: https://dlang.org/phobos/dmd_dcast.html
-
Declaration
ExpressionimplicitCastTo(Expressione, Scope*sc, Typet);Do an implicit cast. Issue error if it can'
tbe done. -
Declaration
MATCHimplicitConvTo(Expressione, Typet);Return MATCH level of implicitly converting
eto typet. Don'tdo the actual cast; don'tchangee. -
Declaration
ExpressioncastTo(Expressione, Scope*sc, Typet);Do an explicit cast. Assume that the 'this' expression does not have any indirections.
-
Declaration
ExpressioninferType(Expressione, Typet, intflag= 0);Set type inference target
tTarget typeflag1: don'tput an error when inference fails -
Declaration
ExpressionscaleFactor(BinExpbe, Scope*sc);Scale addition/subtraction to/from pointer.
-
Declaration
booltypeMerge(Scope*sc, TOKop, Type*pt, Expression*pe1, Expression*pe2);Combine types.
Output: *
ptmerged type, if *ptis not NULL *pe1rewritten e1 *pe2rewritten e2Return Value
truesuccessfalsefailed -
Declaration
ExpressiontypeCombine(BinExpbe, Scope*sc);Bring leaves to common type.
Return Value
nullon success, ErrorExp if error occurs -
Declaration
ExpressionintegralPromotions(Expressione, Scope*sc);Do integral promotions (convertchk). Don't convert
to -
Declaration
voidfix16997(Scope*sc, UnaExpue);This provides a transition from the non-promoting behavior of unary + - ~ to the C-like integral promotion behavior.
Parameters
Scope*sccontext
UnaExpueNegExp, UAddExp, or ComExp which is revised per rules
References: https://issues.dlang.org/show_bug.cgi?id=16997
-
Declaration
boolarrayTypeCompatibleWithoutCasting(Typet1, Typet2);See if both types are arrays that can be compared for equality without any casting. Return
trueif so. This is to enable comparing things like an immutable array with a mutable one. -
Declaration
IntRangegetIntRange(Expressione);