[Issue 20076] [2.087.0] structs won't copy when using alias this and being assigned a const instance of said struct

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Apr 4 10:40:35 UTC 2023


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

RazvanN <razvan.nitu1305 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |razvan.nitu1305 at gmail.com
         Resolution|---                         |WORKSFORME

--- Comment #3 from RazvanN <razvan.nitu1305 at gmail.com> ---
The error message for the reduced test case is now:

test.d(13): Error: constructor `test.S.this(int* t1)` is not callable using
argument types `(const(int*))`
test.d(13):        cannot pass argument `t3.ip` of type `const(int)*` to
parameter `int* t1`

The alias this is not mentioned because once the compiler uses it it just has
`t3.ip`, it does not have any information on how the expressions is obtained. I
think this is the best we can do with regards to the error message.

So this seems to have been improved. Closing as WORKSFORME.

--


More information about the Digitalmars-d-bugs mailing list