http://d.puremagic.com/issues/show_bug.cgi?id=9418
Maxim Fomin <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #2 from Maxim Fomin <[email protected]> 2013-02-05 09:51:39 PST --- (In reply to comment #1) > How strange, what is the tilde operating on in this code? For example: Indeed this is strange. > import std.datetime; > import std.stdio; > > void main() > { > auto x1 = ~Clock; // NG > auto x2 = ~Clock.currTime(); // NG > auto x3 = ~Clock.currTime().toISOString(); // NG > auto x4 = Clock.currTime().toISOString()[0 .. 8]; > auto x5 = ~x4; // NG > auto x5 = ~Clock.currTime().toISOString()[0 .. 8]; // works?! > } Actually it operates on dynamic array honestly corrupting (complementing) both length and ptr properties. import core.stdc.stdio : printf; void main() { string foo = "foo"; printf(".length = %d, .ptr=%p\n", foo.length, foo.ptr); foo = ~foo[] ; printf(".length = %d, .ptr=%p\n", foo.length, foo.ptr); } My guess is that slice expression escapes internal dmd checks. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
