www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10727] New: Regression (dmd-2.061) -- DMD dumps core

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10727

           Summary: Regression (dmd-2.061) -- DMD dumps core
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: puneet coverify.org


--- Comment #0 from Puneet Goel <puneet coverify.org> 2013-07-29 06:29:40 PDT
---
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 {}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 29 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10727



--- Comment #1 from Puneet Goel <puneet coverify.org> 2013-07-29 06:34:02 PDT
---
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 {}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 29 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10727


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice, pull


--- Comment #2 from Kenji Hara <k.hara.pg gmail.com> 2013-07-29 20:55:24 PDT ---
https://github.com/D-Programming-Language/dmd/pull/2420

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 29 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10727



--- Comment #3 from Puneet Goel <puneet coverify.org> 2013-07-29 21:42:54 PDT
---
(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;} } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 29 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10727



--- Comment #4 from github-bugzilla puremagic.com 2013-07-30 21:49:19 PDT ---
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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 30 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10727


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

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


--- Comment #5 from Kenji Hara <k.hara.pg gmail.com> 2013-08-06 21:34:10 PDT ---
(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 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Aug 06 2013