"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/dmd/dcast.d" between
dmd-2.097.0.tar.gz and dmd-2.097.1.tar.gz

About: DMD (Digital Mars D) is the D reference compiler. D is an object-oriented, imperative, multi-paradigm system programming language.

dcast.d  (dmd-2.097.0):dcast.d  (dmd-2.097.1)
skipping to change at line 2568 skipping to change at line 2568
return; return;
} }
} }
auto ts = toAutoQualChars(tsa ? tsa : e.type, t); auto ts = toAutoQualChars(tsa ? tsa : e.type, t);
e.error("cannot cast expression `%s` of type `%s` to `%s`", e.error("cannot cast expression `%s` of type `%s` to `%s`",
e.toChars(), ts[0], ts[1]); e.toChars(), ts[0], ts[1]);
result = ErrorExp.get(); result = ErrorExp.get();
} }
} }
// Casting to noreturn isn't an actual cast
// Rewrite cast(<qual> noreturn) <exp>
// as <exp>, assert(false)
if (t.isTypeNoreturn())
{
// Don't generate an unreachable assert(false) if e will abort
if (e.type.isTypeNoreturn())
{
// Paint e to accomodate for different type qualifiers
e.type = t;
return e;
}
auto ini = t.defaultInitLiteral(e.loc);
return Expression.combine(e, ini);
}
scope CastTo v = new CastTo(sc, t); scope CastTo v = new CastTo(sc, t);
e.accept(v); e.accept(v);
return v.result; return v.result;
} }
/**************************************** /****************************************
* Set type inference target * Set type inference target
* t Target type * t Target type
* flag 1: don't put an error when inference fails * flag 1: don't put an error when inference fails
*/ */
 End of changes. 1 change blocks. 
0 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)