Re: must scope for delegates restrict compilation?

2019-10-03 Thread Daniel Kozak via Digitalmars-d-learn
On Thu, Oct 3, 2019 at 2:00 PM Oleg B via Digitalmars-d-learn wrote: > > Hello all > > I think this code must get compilation error, but it didn't, > furthermore result program get UB. > > https://run.dlang.io/is/Qpr278 > > Is this correct behavior and why? when you change it a litle it seems

Re: must scope for delegates restrict compilation?

2019-10-03 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 3 October 2019 at 11:56:55 UTC, Oleg B wrote: I think this code must get compilation error, but it didn't, furthermore result program get UB. Indeed, the spec allows the compiler to issue an error, but doesn't require it. tbh it was due to difficulty in implementing the compile

must scope for delegates restrict compilation?

2019-10-03 Thread Oleg B via Digitalmars-d-learn
Hello all I think this code must get compilation error, but it didn't, furthermore result program get UB. https://run.dlang.io/is/Qpr278 Is this correct behavior and why?