[Issue 17818] Deprecation: std.container.array.RangeT(A) is not visiable

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Sep 10 03:37:34 UTC 2017


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

Jonathan M Davis <issues.dlang at jmdavisProg.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |issues.dlang at jmdavisProg.co
                   |                            |m
           Hardware|x86                         |All
         Resolution|---                         |INVALID
                 OS|Windows                     |All

--- Comment #1 from Jonathan M Davis <issues.dlang at jmdavisProg.com> ---
As was pointed out in the forum, this is not a bug:
http://forum.dlang.org/thread/uyxtepofhcfdapvluwpw@forum.dlang.org#post-ooui7v:241er1:241:40digitalmars.com

Rather, it's the result of a compiler bug being fixed.
std.container.array,RangeT is private, and it's not supposed to be possible to
refer to it by name any more than it's possible to refer to the result of
almost any range-based function by name (though most of them use Voldemort
types, whereas std.container.array is just making the type private). The buggy
behavior that made it possoble has been deprecated - hence the deprecation
message - and you need to update your code so that it does not refer to RangeT
by name.

In general, code should be using auto for the type of range variables, and when
the type name is actually needed (e.g. for a member variable declaration), then
using typeof on the expression that results in the range will give you the type
(and if you need refer to it multiple times in ways that won't work with auto,
then you can always alias the result of typeof to then have an explicit type
name to use).

--


More information about the Digitalmars-d-bugs mailing list