Why I can take address of Foo variable but not Bar?

```d
//-dip1000

struct Foo{
    private double d;
}

struct Bar{
    private void* ptr;
}



void main()@safe{
    ///this is OK:
    {
        scope Foo x;
        scope ptr = &x;
    }

///Error: cannot take address of `scope` local `x` in `@safe` function `main`:
    {
        scope Bar x;
        scope ptr = &x;
    }
}
```

Reply via email to