digitalmars.D.bugs - [Issue 1381] New: Dereference operator still works with arrays and array types even though T[] -> T* is gone
- d-bugmail puremagic.com (27/27) Jul 27 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1381
- d-bugmail puremagic.com (12/12) Dec 22 2011 http://d.puremagic.com/issues/show_bug.cgi?id=1381
http://d.puremagic.com/issues/show_bug.cgi?id=1381 Summary: Dereference operator still works with arrays and array types even though T[] -> T* is gone Product: D Version: 1.005 Platform: PC OS/Version: Windows Status: NEW Keywords: accepts-invalid Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: jarrett.billingsley gmail.com I'm reporting this as 1.005 since I originally found this (and posted an un-replied-to topic on the bugs NG) back in February. Basically the implicit T[] -> T* conversion became illegal before 1.0 but some bits of it probably still remain in the compiler. First, you can dereference an array to get the first element: int[] a = [1, 2, 3]; writefln(*a); // writes 1 The other, more important problem, is that a naive "isPointerType" template that uses "is(*T)" will actually return true for array types, even though they're not pointer types. If this is intended behavior, I'm not sure what the purpose is, and it's certainly not documented. --
Jul 27 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1381 Don <clugdbug yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |clugdbug yahoo.com.au Resolution| |DUPLICATE --- Comment #1 from Don <clugdbug yahoo.com.au> 2011-12-22 00:48:28 PST --- *** This issue has been marked as a duplicate of issue 3990 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 22 2011