[Issue 17635] [REG 2.066.0] cannot convert unique immutable(int)** to immutable

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Feb 24 13:01:32 UTC 2021


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
                 CC|                            |razvan.nitu1305 at gmail.com
         Resolution|---                         |FIXED

--- Comment #10 from RazvanN <razvan.nitu1305 at gmail.com> ---
(In reply to ag0aep6g from comment #9)
> The original test case has been fixed, but it can be made to fail again by
> changing the parameter type slightly. As far as I can tell, the parameter
> type shouldn't matter, as long as it's not mutable.
> 
> ----
> alias T = immutable int;
> 
> T** f(I)(const I input) pure
> {
>     T** output;
>     return output;
> }
> 
> void main()
> {
>     /* Not regressions in 2.066 (i.e. 2.065 also rejected these): */
>     
>     T*** a1;
>     immutable T** r1 = f(a1);
>     
>     static struct S2 { T* foo; }
>     S2* a2;
>     immutable T** r2 = f(a2);
>     
>     /* But this one compiles with 2.065, so it's another regression: */
>     
>     static struct S3 { T foo; }
>     S3* a3;
>     immutable T** r3 = f(a3);
> }
> ----
> 
> Tested with DMD64 D Compiler v2.076.1-b1-166-g2f98e66e5.
> 
> Reopening. Let me know if I should file a new issue (or multiple ones)
> instead.

Yes, the procedure is that every bug report is associated with one test case.
The test case for this specific bug has been fixed. Furthermore, the proposed
test case has never compiled with dmd, therefore it is not a regression.

I am closing this, please file the new test case as a new bug report.

--


More information about the Digitalmars-d-bugs mailing list