Bug 12819 – Refused purity conversion of immutable array of arrays

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-05-29T12:30:31Z
Last change time
2024-12-13T18:21:10Z
Keywords
rejects-valid
Assigned to
No Owner
Creator
bearophile_hugs
Moved to GitHub: dmd#17662 →

Comments

Comment #0 by bearophile_hugs — 2014-05-29T12:30:31Z
I am not sure, but perhaps both functions should compile: immutable(string)[] foo() pure { char[][] a; return a; // OK } string[] bar() pure { char[][] b; return b; // Error } void main() {} DMD 2.066alpha gives: test.d(7,12): Error: cannot implicitly convert expression (b) of type char[][] to string[]
Comment #1 by robert.schadek — 2024-12-13T18:21:10Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17662 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB