# HG changeset patch # User Tomas Lindquist Olsen # Date 1240789409 -7200 # Node ID b8a51aa44d4c4301aeb1424265da601540004cee # Parent 4ae3b3ceea11fc7d99508895fe882f4baf963610 Added testcase for overlapping struct default initializer I has missed. Slight tweak of the relevant error message. diff -r 4ae3b3ceea11 -r b8a51aa44d4c ir/irtypestruct.cpp --- a/ir/irtypestruct.cpp Sun Apr 26 20:36:53 2009 +0200 +++ b/ir/irtypestruct.cpp Mon Apr 27 01:43:29 2009 +0200 @@ -110,7 +110,7 @@ if (v_begin >= f_end || v_end <= f_begin) continue; - sd->error(vd->loc, "overlapping initialization for %s and %s", + sd->error(vd->loc, "has overlapping initialization for %s and %s", field_it->toChars(), vd->toChars()); } } diff -r 4ae3b3ceea11 -r b8a51aa44d4c tests/mini/nocompile_initoverlap2.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/mini/nocompile_initoverlap2.d Mon Apr 27 01:43:29 2009 +0200 @@ -0,0 +1,8 @@ +struct S +{ + union + { + float f = 1; + int i = 2; + } +}