www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14841] New: Don't warn on myArray.sort when it makes no


          Issue ID: 14841
           Summary: Don't warn on myArray.sort when it makes no difference
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: markisaa umich.edu

Just upgraded the compiler at work and found:
"foo.d(6): Warning: use std.algorithm.sort instead of .sort property"

to be the most jarring change in the compiler so far. Namely, I've written code
of the form:
import std.algorithm;
auto x = [1, 2, 3, 5, 4];

which should behave the same regardless of whether or not std.algorithm.sort is
used or the .sort property is used. The deprecation statement in the changelog
for the .sort property removal basically just says that it belongs in Phobos
instead. Why then do we nag users about this when the code is functionally
correct and robust even if/when we remove the .sort property from the language?

Proposed enhancement: don't warn if std.algorithm.sort has been imported (aka,
don't warn if the removal of the .sort property would be transparent).

Jul 27 2015