digitalmars.D.bugs - [Issue 6811] New: Confusion between string* and immutable(char)*, related to AA's
- d-bugmail puremagic.com (30/30) Oct 13 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6811
- d-bugmail puremagic.com (12/12) Oct 13 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6811
http://d.puremagic.com/issues/show_bug.cgi?id=6811 Summary: Confusion between string* and immutable(char)*, related to AA's Product: D Version: D2 Platform: Other OS/Version: Windows Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: dsimcha yahoo.com --- Comment #0 from David Simcha <dsimcha yahoo.com> 2011-10-13 09:43:59 PDT --- void doExclude(string exclude) { string[string] aa; int[] keep; foreach(int i, h; ["a", "b"]) { auto ptr = h in aa; pragma(msg, typeof(ptr)); // string* pragma(msg, typeof(*ptr)); // string if(*h != exclude) keep ~= i; } } test.d(9): Error: incompatible types for ((*cast(immutable(char)*)h) != (exclude)): 'immutable(char)' and 'string' -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 13 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6811 David Simcha <dsimcha yahoo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALID --- Comment #1 from David Simcha <dsimcha yahoo.com> 2011-10-13 09:49:30 PDT --- (Slaps self in forehead.) Never mind, I see what I did now. I used *h where I meant *ptr and forgot that strings implicitly convert to char*. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 13 2011