Re: So these two compile and, in non-debug builds, run just fine

2016-11-28 Thread Walter Bright via Digitalmars-d
On 11/25/2016 2:51 PM, Ethan Watson wrote: On Friday, 25 November 2016 at 15:30:35 UTC, Steven Schveighoffer wrote: But I think Walter's scope changes (DIP 1001 I think?) will make it so the compiler rejects this even in non-safe mode. -Steve I really hope this is the case. Because, it needs

Re: So these two compile and, in non-debug builds, run just fine

2016-11-28 Thread Somebody via Digitalmars-d
On Friday, 25 November 2016 at 23:04:44 UTC, Mathias Lang wrote: You are correct that DIP1000 will fix that. However it will only be enforced in @safe mode, sadly. I wonder why. If @system code wanted to bypass it, it could cast the scoped ref into a traditional one. Wouldn't it be better i

Re: So these two compile and, in non-debug builds, run just fine

2016-11-26 Thread Era Scarecrow via Digitalmars-d
On Friday, 25 November 2016 at 15:30:35 UTC, Steven Schveighoffer wrote: But I think Walter's scope changes (DIP 1001 I think?) will make it so the compiler rejects this even in non-safe mode. Rejecting it would be nice... Although I wonder... I've been wondering and thinking about if we co

Re: So these two compile and, in non-debug builds, run just fine

2016-11-25 Thread Mathias Lang via Digitalmars-d
2016-11-25 16:30 GMT+01:00 Steven Schveighoffer via Digitalmars-d < digitalmars-d@puremagic.com>: > > But I think Walter's scope changes (DIP 1001 I think?) will make it so the > compiler rejects this even in non-safe mode. > > -Steve > You are correct that DIP1000 will fix that. However it will

Re: So these two compile and, in non-debug builds, run just fine

2016-11-25 Thread Ethan Watson via Digitalmars-d
On Friday, 25 November 2016 at 15:30:35 UTC, Steven Schveighoffer wrote: But I think Walter's scope changes (DIP 1001 I think?) will make it so the compiler rejects this even in non-safe mode. -Steve I really hope this is the case. Because, it needs to be said. If a modern language fails som

Re: So these two compile and, in non-debug builds, run just fine

2016-11-25 Thread Steven Schveighoffer via Digitalmars-d
On 11/25/16 9:57 AM, Ethan Watson wrote: @safe: // now it fails. MyClass* getAPointer() { MyClass* ptr; MyClass instance = new MyClass(); ptr = &instance; return ptr; } MyStruct* getAnotherPointer() { MyStruct* ptr; MyStruct instance; ptr = &instance; return ptr; } But I think

So these two compile and, in non-debug builds, run just fine

2016-11-25 Thread Ethan Watson via Digitalmars-d
MyClass* getAPointer() { MyClass* ptr; MyClass instance = new MyClass(); ptr = &instance; return ptr; } MyStruct* getAnotherPointer() { MyStruct* ptr; MyStruct instance; ptr = &instance; return ptr; } One of the guys here is working on some GC stuff (ARC related), and gave me a