Bug 21660 – [REG 2.066.0] cannot convert unique immutable(int)** to immutable

Status
NEW
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-02-24T13:10:39Z
Last change time
2024-12-13T19:14:53Z
Keywords
rejects-valid
Assigned to
No Owner
Creator
ag0aep6g
See also
https://issues.dlang.org/show_bug.cgi?id=22130
Moved to GitHub: dmd#19877 →

Comments

Comment #0 by ag0aep6g — 2021-02-24T13:10:39Z
This is a spin-off from issue 17635. Should compile: ---- 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 a regression: */ static struct S3 { T foo; } S3* a3; immutable T** r3 = f(a3); } ----
Comment #1 by dkorpel — 2022-03-17T13:31:03Z
Version without templates: ``` alias T = immutable int; T** f1(const T*** input) pure { T** output; return output; } T** f2(const S2* input) pure { T** output; return output; } T** f3(const S3* input) pure { T** output; return output; } struct S2 { T* foo; } struct S3 { immutable int foo; } void main() { /* Not regressions in 2.066 (i.e. 2.065 also rejected these): */ immutable int*** a1; immutable int** r1 = f1(a1); S2* a2; immutable int** r2 = f2(a2); /* But this one compiles with 2.065, so it's a regression: */ S3* a3; immutable int** r3 = f3(a3); } ```
Comment #2 by robert.schadek — 2024-12-13T19:14:53Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19877 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB