[Dlang-internal] DIP1000 discussion and testing

Mathias Lang via Dlang-internal dlang-internal at puremagic.com
Tue Dec 27 14:18:24 PST 2016


On Sunday, 18 December 2016 at 15:25:55 UTC, Walter Bright wrote:
> On 12/18/2016 3:09 AM, Mathias Lang wrote:
>> With the two last P.R. you submitted merged, the following 
>> compiles
>>
>> ```
>> void escape () @safe
>> {
>>     Foo f;
>>     bar(f);
>> }
>>
>> void bar (scope ref Foo f) @safe
>> {
>>     int[10] i;
>>     f.v = i;
>> }
>>
>> struct Foo
>> {
>>     int[] v;
>> }
>> ```
>
> Thanks, I'll look at it tomorrow.

Just tested again with the HEAD of scope (e46873f66), it compiles 
with just `ref` instead of `scope ref` for bar's parameter.
Which brings me to the question, is `scope ref` supposed to apply 
to the `ref` or to the type (i.e. `Foo` in this case) ?


More information about the Dlang-internal mailing list