April 08, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7815



--- Comment #10 from David Simcha <dsimcha@yahoo.com> 2012-04-08 11:55:35 PDT ---
Created an attachment (id=1085)
A not-very-reduced test case.

I'll try harder to reduce this later if necessary, but I don't have time right now and every time someone reduces this bug it seems like something important gets left out.  Here's a zip file of my mostly unreduced.  Just go into the main directory (bug7815/) and do a dmd test.d.  This will instantiate all the necessary templates to reproduce the bug even on 2.059 Beta 3.  Hopefully this will be easier to reduce for someone who has a better understanding of what changed between releases.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 08, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7815



--- Comment #11 from klickverbot <code@klickverbot.at> 2012-04-08 15:13:41 PDT ---
Issue 7862 might be related to what I'm seeing.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 09, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7815



--- Comment #12 from David Simcha <dsimcha@yahoo.com> 2012-04-09 07:31:57 PDT ---
Created an attachment (id=1086)
DMD 2.059 Beta 4 testcase

Here's a new test case that works around a change in Phobos that apparently occurred between betas.  This reproduces the failure on DMD 2.059 Beta 4. Usage is the same as the old test case.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 10, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7815


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #1085|0                           |1
        is obsolete|                            |


--- Comment #13 from Walter Bright <bugzilla@digitalmars.com> 2012-04-10 10:19:52 PDT ---
Created an attachment (id=1088)
reduced test.d and scid/matrix.d

this replaces the files scid/matrix.d and test.d in the test case. They are somewhat reduced.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 11, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7815



--- Comment #14 from klickverbot <code@klickverbot.at> 2012-04-10 22:38:19 PDT ---
Drastically reduced test case:

———
struct Expression(string op_, Lhs) {
  enum lhsClosure = closureOf!Lhs;
}

template closureOf(T) {
  static if (is(typeof({
    T x;
    x + x;
  }))) {}
  enum closureOf = 1;
}

struct BasicVector {
  void t() {
    auto r = Expression!("t", typeof(this))();
  }

  auto opBinary( string op, NewRhs )( NewRhs ) {
    return Expression!("+", typeof(this))();
  }
}
———

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 11, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7815



--- Comment #15 from Walter Bright <bugzilla@digitalmars.com> 2012-04-11 10:40:51 PDT ---
I reduced the test case a little more:

struct Expression(int op) {
  enum lhsClosure = closureOf!();
}

template closureOf() {
  static if (is(typeof({
    BasicVector x;
    x.bar(x);
  }))) {}
  enum closureOf = 1;
}

struct BasicVector {
  void t() {
    auto r = Expression!(1)();
  }

  void bar(T)(T) {
    auto x = Expression!(2)();
  }
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 11, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7815



--- Comment #16 from Walter Bright <bugzilla@digitalmars.com> 2012-04-11 10:49:07 PDT ---
Ok, here's the problem.

Attempt to compile BasicVector.
Expand Expression!(1)().
Expand closureOf!() which is needed to initialize lhsClosure.
  1. closureOf has two members 1. the static if 2. the enum closureOf
  2. in order to initialize lhsClosure, closureOf must be eponymous
therefore, we must evaluate the static if.
Evaluating the static if evaluates bar(T)(T)
bar(T)(T) evaluates Expression!(2)()
Expression!(2)() needs to eponymously expand closureOf!()

And so we wind up in a circle, hence the confusing error message.

It "worked" prior because the circular reference error was ignored.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 11, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7815



--- Comment #17 from github-bugzilla@puremagic.com 2012-04-11 14:43:23 PDT ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/f793ed4e3dd7b85c9a0cc703252146f0e7611dbc
better error message for Issue 7815 - Mixin template forward reference (?)
regression

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 11, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7815


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |WONTFIX


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
1 2
Next ›   Last »