"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "test/fail_compilation/dassert.d" between
dmd-2.095.0.tar.gz and dmd-2.095.1.tar.gz

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

dassert.d  (dmd-2.095.0):dassert.d  (dmd-2.095.1)
/* /*
REQUIRED_ARGS: -checkaction=context REQUIRED_ARGS: -checkaction=context
TEST_OUTPUT: TEST_OUTPUT:
--- ---
fail_compilation/dassert.d(11): Error: expression `tuple(0, 0)` of type `(int, i fail_compilation/dassert.d(14): Error: expression `tuple(0, 0)` of type `(int, i
nt)` does not have a boolean value nt)` does not have a boolean value
fail_compilation/dassert.d(21): Error: assignment cannot be used as a condition,
perhaps `==` was meant?
fail_compilation/dassert.d(29): Error: assignment cannot be used as a condition,
perhaps `==` was meant?
--- ---
*/ */
struct Baguette { int bread, floor; } struct Baguette { int bread, floor; }
void main () void main ()
{ {
assert(Baguette.init.tupleof); assert(Baguette.init.tupleof);
} }
// https://issues.dlang.org/show_bug.cgi?id=21590
void issue21590()
{
int a, b = 1;
assert (a = b);
static ref int get()
{
static int i;
return i;
}
assert(get() = 1);
// No errors for binary assignments (regardless of -checkaction=context)
int[] arr;
assert(arr ~= 1);
assert(a += b);
}
 End of changes. 3 change blocks. 
2 lines changed or deleted 7 lines changed or added

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