Bug in compiler?

2014-12-15 Thread Shachar Shemesh via Digitalmars-d
Please consider the following program: import std.exception; void main() { struct A { int a; @disable this(this); @disable ref A opAssign(const ref A); ref A opOpAssign(string op: ~)(int data) { a += data; return this; }

Re: Bug in compiler?

2014-12-15 Thread ketmar via Digitalmars-d
lambda manually: assertThrown!Exception((ref A aa) { aa ~= 3; }(a)); tl;dr: no, it's not a bug in the compiler. but the error message is misleading and you are required to understang some internals to make sense out of it. signature.asc Description: PGP signature

Re: Bug in compiler?

2014-12-15 Thread John Colvin via Digitalmars-d
`. it can't see `ref` there, as `a` type is `A`, not `ref A`. you can workaround that with creating the necessary lambda manually: assertThrown!Exception((ref A aa) { aa ~= 3; }(a)); tl;dr: no, it's not a bug in the compiler. but the error message is misleading and you are required to understang

Re: Bug in compiler?

2014-12-15 Thread via Digitalmars-d
A`. you can workaround that with creating the necessary lambda manually: assertThrown!Exception((ref A aa) { aa ~= 3; }(a)); tl;dr: no, it's not a bug in the compiler. but the error message is misleading and you are required to understang some internals to make sense out of it. Another

[Issue 6948] Possible bug in compiler or documentation regarding signature of opCmp()

2012-01-21 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6948 Walter Bright bugzi...@digitalmars.com changed: What|Removed |Added Keywords||spec

[Issue 6948] New: Possible bug in compiler or documentation regarding signature of opCmp()

2011-11-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6948 Summary: Possible bug in compiler or documentation regarding signature of opCmp() Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW

[Issue 6948] Possible bug in compiler or documentation regarding signature of opCmp()

2011-11-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6948 Alex R�nne Petersen xtzgzo...@gmail.com changed: What|Removed |Added CC|