This regression got introduced in dmd-2.061 (works with dmd-2.060). $ dmd test.d dmd: glue.c:1227: virtual unsigned int Type::totym(): Assertion `0' failed. Aborted (core dumped) $ cat test.d import foo; $ cat foo.d struct CirBuff(T) { import std.traits: isArray; CirBuff!T opAssign(R)(R ) if(isArray!R) { } struct Range(U,S) { Range!(U,S) save() {return U;} } T[] toArray() { T[] ret = new T[this.length]; return ret; } alias toArray this; Range!(T, T) range() {} } class Bar (T=int){ CirBuff!T _bar; } class Once { Bar!Foo _foobar; } class Foo: Frop {}
Another interesting testcase. Class Frop is not defined, but DMD fails to catch that. dmd-2.060 works fine. $ dmd -c test.d # compiles without errors $ ~/local/dmd-2.060/dmd2/linux/bin64/dmd -c test.d foo.d(22): Error: undefined identifier Frop $ cat test.d import foo; $ cat foo.d struct CirBuff(T) { import std.traits: isArray; CirBuff!T opAssign(R)(R ) if(isArray!R) { } T[] toArray() { T[] ret = new T[this.length]; return ret; } alias toArray this; } class Bar (T=int){ CirBuff!T _bar; } class Once { Bar!Foo _foobar; } class Foo: Frop {}
https://github.com/D-Programming-Language/dmd/pull/2420
(In reply to comment #2) > https://github.com/D-Programming-Language/dmd/pull/2420 Another testcase (after pulling in the pull request). DMD does not crib about missing override for function Foo.frop. But starts doing that if "alias toArray this" in CirBuff(T) is commented out. struct CirBuff(T) { import std.traits: isArray; CirBuff!T opAssign(R)(R ) if(isArray!R) { } T[] toArray() { T[] ret; // = new T[this.length]; return ret; } alias toArray this; } class Bar (T=int){ CirBuff!T _bar; } class Once { Bar!Foo _foobar; } class Foo: Frop { // override public int frop() {return 1;} } class Frop { public int frop() {return 0;} }
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/da18e74c9efef79446506845e6cad9da352a61d7 fix Issue 10727 - Regression (dmd-2.061) -- DMD dumps core Implicit identity assignment check introduced from 2.061 (instantiate opAssign under error gagging) had gagged undefined identifier error. https://github.com/D-Programming-Language/dmd/commit/2611985c6a9ad15f7eb76d97738d2f36ab39e767 Merge pull request #2420 from 9rnsr/fix10727 [REG2.061] Issue 10727 - DMD dumps core
(In reply to comment #3) > (In reply to comment #2) > > https://github.com/D-Programming-Language/dmd/pull/2420 > > Another testcase (after pulling in the pull request). DMD does not crib about > missing override for function Foo.frop. But starts doing that if "alias toArray > this" in CirBuff(T) is commented out. Moved to: http://d.puremagic.com/issues/show_bug.cgi?id=10768
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/e388f762ca9b2ac41131a6f3f564af4259285952 Remove dependency on Phobos from issue 10727 test case