Nick Treleaven
Nick Treleaven
> I can change it so a pointer tagged scope will flag as an error when trying to return it in @safe code. Is there a good reason why we...
```d struct R { bool empty(); // not const } R f() out (r) { pragma(msg, typeof(r)); // const R bool b = r.empty; // Error: mutable method `R.empty` is...
> It seems the parameters in an in contract are only head-const, rather than fully const. Not even that (R has no indirections). Only direct modifications are prevented. Calling a...
Looks like this may be fixed now.
> I know if `return 0` is bug prone as `return 1` `return 0` is fine iff none of the delegate calls returned non-zero. > foreach (x; &myLoop) that &...
BTW instead of `Val` you can use `std.meta.Alias`.
> alias b = extern(C) pure nothrow @safe @nogc void function() p; // OK (Without the `p` that compiles). `alias` [supports](https://dlang.org/spec/declaration.html#AliasAssignment) *StorageClass*, so that works. > void fun(extern(C) pure nothrow...
Reduced: ```d import std.stdio : File; void write(ref File f, real[1]) { auto w = f.lockingTextWriter(); // SEGV } void main() { import std.stdio : stdout; real[1] arr = 0;...
Reduced more: ```d struct File { void* _p; } void write(ref File f, real[1]) { // &f is null here auto w = f._p; // SEGV } void main() {...
There is another deficiency with `update` - we can't read an existing value when the key exists, e.g. to increment it (whilst also handling the case of a missing key,...