[Issue 16035] Compiler error when compiling specific union

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue May 17 08:36:17 PDT 2016


Steven Schveighoffer <schveiguy at yahoo.com> changed:

           What    |Removed                     |Added
           Keywords|ice                         |ice-on-invalid-code

--- Comment #3 from Steven Schveighoffer <schveiguy at yahoo.com> ---
It has something to do with inout, not with unions.

Reduced case:

struct Value {
    auto toString() inout {

    T get(T)() {

    const(Value)* a;

Remove inout, and this fails to compile:

testunion.d(7): Error: mutable method testunion.Value.toString is not callable
using a const object
testunion.d(3): Error: template instance testunion.Value.get!string error


More information about the Digitalmars-d-bugs mailing list