Re: 2.067 Beta: Behavior of enum and ref changed

2015-03-11 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, March 10, 2015 13:26:00 Ali Çehreli via Digitalmars-d-learn wrote: On 03/10/2015 11:05 AM, Ali Çehreli wrote: In other words, the result of the implicit conversion is an rvalue Steven Schveighoffer says there is no rvalue in this case; an enum is a derivative:

Re: 2.067 Beta: Behavior of enum and ref changed

2015-03-10 Thread Andre via Digitalmars-d-learn
Thanks a lot! Kind regards André On Tuesday, 10 March 2015 at 09:25:02 UTC, Meta wrote: On Tuesday, 10 March 2015 at 08:37:46 UTC, Jonathan M Davis wrote: It's the base type that isn't implicitly convertible to the enum type. Err, yes. I had that the wrong way around. Anyway, I filed an

Re: 2.067 Beta: Behavior of enum and ref changed

2015-03-10 Thread Ali Çehreli via Digitalmars-d-learn
On 03/10/2015 01:37 AM, Jonathan M Davis via Digitalmars-d-learn wrote: However, the code in question still shouldn't compile because while a Bits variable may be implicitly convertible to ulong, it _isn't_ a ulong, In other words, the result of the implicit conversion is an rvalue,

Re: 2.067 Beta: Behavior of enum and ref changed

2015-03-10 Thread Ali Çehreli via Digitalmars-d-learn
On 03/10/2015 11:05 AM, Ali Çehreli wrote: In other words, the result of the implicit conversion is an rvalue Steven Schveighoffer says there is no rvalue in this case; an enum is a derivative: https://issues.dlang.org/show_bug.cgi?id=14269#c14 Ali

2.067 Beta: Behavior of enum and ref changed

2015-03-10 Thread Andre via Digitalmars-d-learn
Hi, following coding raises a compiler error with the beta of 2.067. Is this error intended or not? It is working if I change first line of main to: ulong bits; enum Bits: ulong { none = 0 } bool hasBit(ref ulong rBits, ulong rBit) { return cast(bool)(rBits rBit); } void

Re: 2.067 Beta: Behavior of enum and ref changed

2015-03-10 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, March 10, 2015 08:19:27 Meta via Digitalmars-d-learn wrote: On Tuesday, 10 March 2015 at 07:04:48 UTC, Andre wrote: Hi, following coding raises a compiler error with the beta of 2.067. Is this error intended or not? It is working if I change first line of main to: ulong

Re: 2.067 Beta: Behavior of enum and ref changed

2015-03-10 Thread Meta via Digitalmars-d-learn
On Tuesday, 10 March 2015 at 07:04:48 UTC, Andre wrote: Hi, following coding raises a compiler error with the beta of 2.067. Is this error intended or not? It is working if I change first line of main to: ulong bits; enum Bits: ulong { none = 0 } bool hasBit(ref ulong rBits, ulong

Re: 2.067 Beta: Behavior of enum and ref changed

2015-03-10 Thread Meta via Digitalmars-d-learn
On Tuesday, 10 March 2015 at 08:37:46 UTC, Jonathan M Davis wrote: It's the base type that isn't implicitly convertible to the enum type. Err, yes. I had that the wrong way around. Anyway, I filed an issue. https://issues.dlang.org/show_bug.cgi?id=14269