Thread overview
[Issue 5015] New: Cyclic import breaks is() in a static if
Oct 08, 2010
William Moore
Oct 08, 2010
William Moore
[Issue 5015] Regression(1.061): Cyclic import breaks is() in a static if
Dec 21, 2010
William Moore
Dec 22, 2010
Iain Buclaw
Dec 22, 2010
Iain Buclaw
Jan 14, 2011
Walter Bright
October 08, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=5015

           Summary: Cyclic import breaks is() in a static if
           Product: D
           Version: D1
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: nyphbl8d@gmail.com


--- Comment #0 from William Moore <nyphbl8d@gmail.com> 2010-10-07 17:15:11 PDT ---
This issue is nearly identical to Issue 4692 with a minor amount of added depth.  The test case below breaks 1.064 (but not 2.049):

module breaker;
import breaker;

void main() {}

static if (is(ElemType!(int))){}

template ElemType(T) {
  alias _ElemType!(T).type ElemType;
}

template _ElemType(T) {
    alias r type;
}

As before, this was distilled from the same multi-module cyclic import.  Also as before, commenting out the cyclic import causes the code to compile as expected.  This code works properly in 1.060.

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



--- Comment #1 from William Moore <nyphbl8d@gmail.com> 2010-10-08 12:24:22 PDT ---
This regression is directly related to changeset 632 and 477 just as Issue 4302 was, but I'm not sure what conditions should be applied to ensure the code takes effect only in the correct circumstances (forcing the if expression to evaluate to false resovles the bug).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 21, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=5015



--- Comment #2 from William Moore <nyphbl8d@gmail.com> 2010-12-21 07:13:13 PST ---
This is still broken in the latest 1.066 DMD.  It also still compiles correctly in 2.051 DMD.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 22, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=5015



--- Comment #3 from Iain Buclaw <ibuclaw@ubuntu.com> 2010-12-22 13:25:29 PST ---
Created an attachment (id=853)
Patch for 5015

Spotted the difference between D1 and D2 related to this bug report. This can be seen in changeset 447, and a quick comparison using Meld confirms this:

Attaching patch (merged from D2) which fixes this issue.

Regards

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 22, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=5015



--- Comment #4 from Iain Buclaw <ibuclaw@ubuntu.com> 2010-12-22 13:28:39 PST ---
(In reply to comment #3)
> Created an attachment (id=853) [details]
> Patch for 5015
> 
> Spotted the difference between D1 and D2 related to this bug report. This can be seen in changeset 447, and a quick comparison using Meld confirms this:

Derp, I meant changeset **477**

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 14, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5015


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


--- Comment #5 from Walter Bright <bugzilla@digitalmars.com> 2011-01-13 22:36:37 PST ---
http://www.dsource.org/projects/dmd/changeset/874

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------