Understanding DIP 1000 semantics -- Where's the bug?

Sebastiaan Koppe mail at skoppe.eu
Sun Sep 22 10:39:51 UTC 2019


On Sunday, 22 September 2019 at 10:24:39 UTC, Mike Franklin wrote:
> I wouldn't say that `scope` only works for pointers, but rather 
> `scope` only works for references (i.e. pointers and `ref` 
> types).  The issue is that `ref int i` behaves differently than 
> `int* i`.  I understand that scope doesn't make any sense for 
> something like `int i` because it's not a "reference type" (for 
> lack of a better term).

I know that an argument passed to a `ref int i` parameter is 
implemented with a pointer. And you would expect dip1000 to apply 
there as well, but the underlying type is still `int`, and scope 
only works on pointers.

Don't get me wrong, I rather see this work with value types as 
well, but this is how it currently works.




More information about the Digitalmars-d mailing list