Nick Treleaven

Results 134 comments of Nick Treleaven

> we can't read an existing value when the key exists Sorry, that's wrong and the `object` docs are wrong too, I'll make a fix. *Update:* It was fixed in...

```d void main() { final int[2] a; a[0]++; // no error final S s; s.i++; // no error } struct S { int i; } ``` The DIP says: >...

Casting a pointer to final should probably be allowed in `@system` code. It currently errors: ```d final int i = 3; int* pm = cast(int*) &i; // Error: cannot implicitly...

> As final is local to a function `final` can apply to a module scope variable too, and the user of that variable may not have write access to the...

> ref: protects the reference already, final is redundant here When I tried this a few days ago, the final actually applied to the pointed-to data, and I think that...

How would it handle literals with an element index? Presumably allow missing elements in that case? >Any missing elements will be initialized to the default value of the element type....

Also, it seems to depend on whether the declaration is in a function: ```d immutable int[5] x = [1, 2, 3, 4]; // OK void f(){ immutable int[5] x =...

I think we need a way to suppress the proposed warning. I thought using `0: first` would work, but it doesn't. It seems the current 'mismatched array lengths' error (in...

Seems to be a duplicate of #17408, though this is interesting as it points out `immutable` violation too.

Note: if this gets fixed, the AA properties docs (updated in dlang/dlang.org#4339) need to have the 2 bug notes removed.