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
a local clone.
ddmd.dcast
Compiler implementation of the
D programming language.
Authors:
License:
Source: dcast.d
- Expression
implicitCastTo
(Expressione
, Scope*sc
, Typet
); - Do an implicit cast. Issue error if it can'
t
be done. - MATCH
implicitConvTo
(Expressione
, Typet
); - Return MATCH level of implicitly converting
e
to typet
. Don't
do the actual cast; don't
changee
. - Expression
castTo
(Expressione
, Scope*sc
, Typet
); - Do an explicit cast. Assume that the 'this' expression does not have any indirections.
- Expression
inferType
(Expressione
, Typet
, intflag
= 0); - Set type inference target
t
Target typeflag
1: don't
put an error when inference fails - Expression
scaleFactor
(BinExpbe
, Scope*sc
); - Scale addition/subtraction to/from pointer.
- bool
isVoidArrayLiteral
(Expressione
, Typeother
); - Return
true
ife
is an empty array literal with dimensionality equal to or less than type ofother
array. [], [[]], [[[]]], etc. I.e
., make sure that [1,2] is compatible with [], [[1,2]] is compatible with [[]], etc. - bool
typeMerge
(Scope*sc
, TOKop
, Type*pt
, Expression*pe1
, Expression*pe2
); - Combine types.
Output: *
pt
merged type, if *pt
is not NULL *pe1
rewritten e1 *pe2
rewritten e2Returns:true
successfalse
failed - Expression
typeCombine
(BinExpbe
, Scope*sc
); - Bring leaves to common type.Returns:
null
on success, ErrorExp if error occurs - Expression
integralPromotions
(Expressione
, Scope*sc
); - Do integral promotions (convertchk). Don't convert
to - bool
arrayTypeCompatible
(Locloc
, Typet1
, Typet2
); - 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. - bool
arrayTypeCompatibleWithoutCasting
(Locloc
, Typet1
, Typet2
); - 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. - IntRange
getIntRange
(Expressione
);
Copyright © 1999-2017 by the D Language Foundation | Page generated by
Ddoc on (no date time)