[Issue 11761] aa.byKey and aa.byValue are not forward ranges

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Aug 15 02:46:01 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=11761

Kenji Hara <k.hara.pg at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Kenji Hara <k.hara.pg at gmail.com> ---
(In reply to Vladimir Panteleev from comment #0)
> The cause can be reduced to the following code:
> 
> struct R
> {
> 	R save() { return this; }
> }
> 
> void main()
> {
> 	R r1 = void;
> 	static assert (is(typeof(r1.save) == typeof(r1)));
> }
> 
> The compiler complains:
> 
> test.d(9): Error: static assert  (is(R() == R)) is false
> 
> Note the parens in "R() == R".
> 
> The problem goes away, if either r1.save is replaced with r1.save(), or the
> save method declaration is annotated with @property (despite the -property
> switch not being used).

The compiler behavior issue is now filed in bug 13293.

--


More information about the Digitalmars-d-bugs mailing list