[Issue 20142] Incorrect auto ref inference for manifest constant member

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Aug 19 13:39:40 UTC 2019


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

Simen Kjaeraas <simen.kjaras at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simen.kjaras at gmail.com
            Summary|Reading member of enum      |Incorrect auto ref
                   |considered modifying access |inference for manifest
                   |                            |constant member

--- Comment #1 from Simen Kjaeraas <simen.kjaras at gmail.com> ---
Reduced example:

struct S {
    int i;
}

void fun(T)(auto ref T x) {}

unittest {
    enum s = S();
    fun(s.i);
}

The call to fun() should infer x as int, but somehow thinks it's ref int.

--


More information about the Digitalmars-d-bugs mailing list