Bug 510 – Nonworking implicit conversions between arrays and pointers

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P4
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-11-15T05:22:00Z
Last change time
2014-02-15T13:22:09Z
Keywords
spec
Assigned to
bugzilla
Creator
matti.niemenmaa+dbugzilla
Blocks
511

Comments

Comment #0 by matti.niemenmaa+dbugzilla — 2006-11-15T05:22:37Z
The comments should explain it: class U {} class T : U {} void main() { T* ptr; T[2] sar; T[] dar; // all of the following should work according to the "Implicit Conversions" section of the spec tPtr(ptr); tPtr(sar); tPtr(dar); tDar(sar); uPtr(ptr); uPtr(sar); uPtr(dar); // none of these work uSar(sar); // doesn't work uDar(sar); uDar(dar); // the first of these doesn't work vPtr(ptr); vPtr(sar); vPtr(dar); vDar(sar); vDar(dar); // the latter of these two works, but isn't mentioned in the spec } void tPtr(T*t){} void tDar(T[]t){} void uPtr(U*u){} void uSar(U[2]u){} void uDar(U[]u){} void vPtr(void*v){} void vDar(void[]v){}
Comment #1 by matti.niemenmaa+dbugzilla — 2006-12-03T03:48:12Z
Spec partially corrected for DMD 0.176. The "uDar(dar)" case still isn't mentioned in the spec.
Comment #2 by bugzilla — 2006-12-12T04:14:05Z
Fixed DMD 0.176