the following code should compile: void main(){ immutable a = new int[1]; int[] b = new immutable(int)[1]; }
I can see why that would be nice with regards to primitives, but I would point out that that wouldn't work with structs or classes (or with arrays of structs or classes).
It works with any type that has a pure constructor where all (unscoped) constructor arguments convert to the respective qualifier.
(In reply to timon.gehr from comment #0) > the following code should compile: > void main(){ > immutable a = new int[1]; > int[] b = new immutable(int)[1]; > } Works now (dmd 2.075) and has been working for a while. Closing as WORKSFORME.