5015 – Regression(1.061): Cyclic import breaks is() in a static if

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 5015 - Regression(1.061): Cyclic import breaks is() in a static if
Summary: Regression(1.061): Cyclic import breaks is() in a static if
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: All Linux
: P2 regression
Assignee: No Owner
URL:
Keywords: patch, rejects-valid
Depends on:
Blocks:
Reported: 2010年10月07日 17:15 UTC by William Moore
Modified: 2011年01月13日 22:36 UTC (History)
3 users (show)

See Also:


Attachments
Patch for 5015 (646 bytes, patch)
2010年12月22日 13:25 UTC, Iain Buclaw
Details | Diff
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description William Moore 2010年10月07日 17:15:11 UTC
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.
Comment 1 William Moore 2010年10月08日 12:24:22 UTC
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).
Comment 2 William Moore 2010年12月21日 07:13:13 UTC
This is still broken in the latest 1.066 DMD. It also still compiles correctly in 2.051 DMD.
Comment 3 Iain Buclaw 2010年12月22日 13:25:29 UTC
Created attachment 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:
Attaching patch (merged from D2) which fixes this issue.
Regards
Comment 4 Iain Buclaw 2010年12月22日 13:28:39 UTC
(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**
Comment 5 Walter Bright 2011年01月13日 22:36:37 UTC
http://www.dsource.org/projects/dmd/changeset/874 


AltStyle によって変換されたページ (->オリジナル) /