[Issue 7564] Implicit conversion from static to dynamic array in loops

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Feb 23 13:40:13 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=7564



--- Comment #2 from Sebastian <sebastian.sandberg1000 at gmail.com> 2012-02-23 13:40:11 PST ---
Ok, I understand, I was wrong. However on a related matter, I think that,
import std.stdio;
int[1] f(int i)
{
  int[1] a = i;
  return a;
}
void main() {
   foreach (i; 0 .. 2) {
     writeln(f(i).ptr);
   }
  writeln(f(0).ptr);
  writeln(f(1).ptr);
}

prints
7FFFF03A05E0
7FFFF03A05E0
7FFFF03A05E4
7FFFF03A05E8

is a little bit strange, but I guess that just how it works.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list