[Issue 13257] Deprecation message when using std.getopt with string[] parameter
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Mon Aug 4 16:01:55 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=13257
monarchdodra at gmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |monarchdodra at gmail.com
--- Comment #1 from monarchdodra at gmail.com ---
Hum... seems like a limitation of *how* deprecation works. In particular, how
"is(typeof(...))" interacts with it. It's kind of like:
- "Do you have back?"
- "Yes."
- "I'd like to call back."
- "NO! YOU CAN'T! IT'S DEPRECATED!"
Case in point, reduced:
//----
import std.algorithm;
void main(string[] args)
{
int[] a, b;
splitter(a, b); //No warning here
splitter(a, b).map!"a"(); //WARNING HERE
}
//----
Here, 'map' "thinks" (correctly or not) that it splitter is bidirectional, so
generates a 'back', which ends up calling a deprecated 'back'.
What's "funny" is that this only triggers in "deprecated features as warnings".
If you compile with "deprecated features as errors", then the problem actually
goes away. That said, you actually generate a different program. Which is
actually a bit disturbing, IMO.
--
More information about the Digitalmars-d-bugs
mailing list