"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/dmd/dinterpret.d" between
dmd-2.093.0.tar.gz and dmd-2.093.1.tar.gz

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

dinterpret.d  (dmd-2.093.0):dinterpret.d  (dmd-2.093.1)
skipping to change at line 2134 skipping to change at line 2134
debug (LOG) debug (LOG)
{ {
printf("%s VarExp::interpret() `%s`, goal = %d\n", e.loc.toChars(), e.toChars(), goal); printf("%s VarExp::interpret() `%s`, goal = %d\n", e.loc.toChars(), e.toChars(), goal);
} }
if (e.var.isFuncDeclaration()) if (e.var.isFuncDeclaration())
{ {
result = e; result = e;
return; return;
} }
if (goal == ctfeNeedLvalue) // Note: This is a workaround for
// https://issues.dlang.org/show_bug.cgi?id=17351
// The aforementioned bug triggers when passing manifest constant by `re
f`.
// If there was not a previous reference to them, they are
// not cached and trigger a "cannot be read at compile time".
// This fix is a crude solution to get it to work. A more proper
// approach would be to resolve the forward reference, but that is
// much more involved.
if (goal == ctfeNeedLvalue && e.var.type.isMutable())
{ {
VarDeclaration v = e.var.isVarDeclaration(); VarDeclaration v = e.var.isVarDeclaration();
if (v && !v.isDataseg() && !v.isCTFE() && !istate) if (v && !v.isDataseg() && !v.isCTFE() && !istate)
{ {
e.error("variable `%s` cannot be read at compile time", v.toChar s()); e.error("variable `%s` cannot be read at compile time", v.toChar s());
result = CTFEExp.cantexp; result = CTFEExp.cantexp;
return; return;
} }
if (v && !hasValue(v)) if (v && !hasValue(v))
{ {
 End of changes. 1 change blocks. 
1 lines changed or deleted 10 lines changed or added

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