www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14075] New: [REG2.067a] ICE with ambiguous overloading

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

          Issue ID: 14075
           Summary: [REG2.067a] ICE with ambiguous overloading functions
                    without body
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: ice
          Severity: regression
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: sinkuupump gmail.com

A regression introduced in
https://github.com/D-Programming-Language/dmd/pull/4309 


struct Foo
{
    auto opAssign(this X)(ref typeof(this));
    auto opAssign(this X, V)(ref V) if (!is(V == typeof(this)));
}

void test()
{
    Foo src;
    const(Foo) target;
    static if (is(typeof(target = src))) {}
}


Compiling this code causes the compiler to segfault.

0x0000000000429fe0 in OpOverload::visit (this=0x7fffffffcee0, e=0x7ffff7ec85a0)
    at opover.c:692
692                                m.lastf->toChars());

--
Jan 29 2015