[Issue 19936] New: Deprecated alias get this falsely triggers on appending to array
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Jun 3 08:02:26 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=19936
Issue ID: 19936
Summary: Deprecated alias get this falsely triggers on
appending to array
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: default_357-line at yahoo.de
Consider the following code:
struct Bla
{
deprecated("bla")
int get() { return 5; }
alias get this;
}
void main()
{
Bla[] blaArray;
blaArray ~= Bla();
}
There is no reason that appending to Bla[] should justify an access to the
deprecated get() function. And yet, when compiled with `-de`, `blaArray ~=
Bla()` errors with a deprecation error. Note that this does not happen with
`blaArray ~ Bla()`.
--
More information about the Digitalmars-d-bugs
mailing list