Bug 11225 – Module dependency cycle causes import statements inside typeof() expressions inside templates to fail

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-10-11T08:39:00Z
Last change time
2013-11-20T02:45:17Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
sludwig
Blocks
11563

Comments

Comment #0 by sludwig — 2013-10-11T08:39:51Z
Compiling the following with "dmd -c a.d" results in a failure of the last static assertion. Removing the actual dependency of b on a by commenting out the declaration of J lets the assertion pass. This bug is the supposed cause for loads of bogus error messages referring to "startsWith" or "Appender". I was sure that the issue was already reported, but didn't find anything useful, except for some possibly related bugs that have no reduced test case. This is a regression introduced in DMD 2.061. a.d --- import b; interface I {} --- b.d --- import a; interface J : I {} // remove this line to make it work static assert(is(typeof({ import c; }))); // OK pragma(msg, B!().result); // just instantiates the template template B() { static assert(is(typeof({ import c; }))); // FAILS enum result = "WORKS"; } ---
Comment #1 by sludwig — 2013-10-11T08:42:20Z
Comment #2 by sludwig — 2013-10-11T08:44:13Z
Oh and of course a "c" module is also needed: c.d --- // empty ---
Comment #3 by k.hara.pg — 2013-10-15T19:40:24Z
https://github.com/D-Programming-Language/dmd/pull/2671 The regression was introduced by fixing bug 9210 - a regression in 2.061-beta.
Comment #4 by github-bugzilla — 2013-10-16T00:48:13Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/a4ceb3355283dcef1bd8390b41d54a8d7e945ad9 fix Issue 11225 - Module dependency cycle causes import statements inside typeof() expressions inside templates to fail https://github.com/D-Programming-Language/dmd/commit/416fe49e58957cc9310e0d8f0009b76e3156fbf7 Merge pull request #2671 from 9rnsr/fix11225 [REG2.061] Issue 11225 - Module dependency cycle causes import statements inside typeof() expressions inside templates to fail
Comment #5 by github-bugzilla — 2013-10-16T00:49:12Z
Commit pushed to 2.064 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/699f0f8aaea6da475a1cb2956bb1d9087b48bf39 Merge pull request #2671 from 9rnsr/fix11225 [REG2.061] Issue 11225 - Module dependency cycle causes import statements inside typeof() expressions inside templates to fail