[Issue 15702] std.socket.Socket.receive breaks @safe

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Feb 19 17:56:13 PST 2016


https://issues.dlang.org/show_bug.cgi?id=15702

--- Comment #6 from hsteoh at quickfur.ath.cx ---
Changing std.socket.Socket.receive to use templates to check for array
indirections will break too much code, and does not play nice with inheritance.

Proposed alternative solution is to make it illegal to implicitly convert T[]
to void[] in @safe code if T has indirections. As a compromise, continue to
allow explicit cast to void[]. This will plug this particular hole as well as
highlight potentially dangerous implicit conversions to void[], but still
continue to allow it if the user explicitly casts to void[]. Seems like a
reasonable compromise.

--


More information about the Digitalmars-d-bugs mailing list