dmd.dcast

Semantic analysis for cast-expressions.

Members

Functions

arrayTypeCompatibleWithoutCasting
bool arrayTypeCompatibleWithoutCasting(Type t1, Type t2)

See if both types are arrays that can be compared for equality without any casting. Return true if so. This is to enable comparing things like an immutable array with a mutable one.

castTo
Expression castTo(Expression e, Scope* sc, Type t)

Do an explicit cast. Assume that the 'this' expression does not have any indirections.

fix16997
void fix16997(Scope* sc, UnaExp ue)

This provides a transition from the non-promoting behavior of unary + - ~ to the C-like integral promotion behavior.

getIntRange
IntRange getIntRange(Expression e)
implicitCastTo
Expression implicitCastTo(Expression e, Scope* sc, Type t)

Do an implicit cast. Issue error if it can't be done.

implicitConvTo
MATCH implicitConvTo(Expression e, Type t)

Return MATCH level of implicitly converting e to type t. Don't do the actual cast; don't change e.

inferType
Expression inferType(Expression e, Type t, int flag)

Set type inference target t Target type flag 1: don't put an error when inference fails

integralPromotions
Expression integralPromotions(Expression e, Scope* sc)

Do integral promotions (convertchk). Don't convert <array of> to <pointer to>

scaleFactor
Expression scaleFactor(BinExp be, Scope* sc)

Scale addition/subtraction to/from pointer.

toStaticArrayType
Type toStaticArrayType(SliceExp e)
Undocumented in source. Be warned that the author may not have intended to support it.
typeCombine
Expression typeCombine(BinExp be, Scope* sc)

Bring leaves to common type.

typeMerge
bool typeMerge(Scope* sc, TOK op, Type* pt, Expression* pe1, Expression* pe2)

Combine types. Output: *pt merged type, if *pt is not NULL *pe1 rewritten e1 *pe2 rewritten e2

Manifest constants

LOG
enum LOG;
Undocumented in source.

Meta