View source code
Display the source code in dmd/dcast.d from which this page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.

Module dmd.dcast

Compiler implementation of the D programming language.

Documentation

https://dlang.org/phobos/dmd_dcast.html

Coverage

https://codecov.io/gh/dlang/dmd/src/master/src/dmd/dcast.d

Functions

NameDescription
arrayTypeCompatible(loc, t1, t2) See if both types are arrays that can be compared for equality. Return true if so. If they are arrays, but incompatible, issue error. This is to enable comparing things like an immutable array with a mutable one.
arrayTypeCompatibleWithoutCasting(t1, 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(e, sc, t) Do an explicit cast. Assume that the 'this' expression does not have any indirections.
charPromotions(e, sc) Do char promotions. char -> dchar wchar -> dchar dchar -> dchar
fix16997(sc, ue) This provides a transition from the non-promoting behavior of unary + - ~ to the C-like integral promotion behavior.
getIntRange(e)
implicitCastTo(e, sc, t) Do an implicit cast. Issue error if it can't be done.
implicitConvTo(e, t) Return MATCH level of implicitly converting e to type t. Don't do the actual cast; don't change e.
inferType(e, t, flag) Set type inference target t Target type flag 1: don't put an error when inference fails
integralPromotions(e, sc) Do integral promotions (convertchk). Don't convert to
scaleFactor(be, sc) Scale addition/subtraction to/from pointer.
typeCombine(be, sc) Bring leaves to common type.
typeMerge(sc, op, pt, pe1, pe2) Combine types.

Authors

Walter Bright

License

Boost License 1.0