Bug 9210 – [2.061 beta] Import cycle causes unpredictable compile errors

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-12-26T13:26:00Z
Last change time
2012-12-28T11:11:22Z
Keywords
diagnostic, pull
Assigned to
nobody
Creator
sludwig

Attachments

IDFilenameSummaryContent-TypeSize
1173repro.zipReproduction caseapplication/x-zip-compressed481

Comments

Comment #0 by sludwig — 2012-12-26T13:26:51Z
Created attachment 1173 Reproduction case Compiling the following three files using `dmd -c a.d` causes the compiler to fail compiling code in std.complex: a.d --- import b; interface A {} --- b.d --- import c; import std.datetime; interface B : A {} --- c.d --- import a; interface C : A {} --- output: --- C:\D\dmd2\windows\bin\..\..\src\phobos\std\complex.d(678): Error: struct std.complex.Complex does not match any template declaration C:\D\dmd2\windows\bin\..\..\src\phobos\std\complex.d(678): Error: Complex!(real) is used as a type [...] --- The error occurs for different configurations of imports and triggers errors in completely different locations. Does not occur using DMD 2.060.
Comment #1 by sludwig — 2012-12-26T13:34:05Z
Just noticed that `b.d` is missing an `import a;`. This does not influence the error, though. Note that there is absolutely no connection to the user's code, so this is hard to track down.
Comment #2 by k.hara.pg — 2012-12-26T21:13:07Z
This is a compiler regression. The issue occurs also with the combination 2.061alpha dmd + 2.060release Phobos. A dmd commit which the issue introduced is: https://github.com/D-Programming-Language/dmd/commit/c34c5fb0e67f7c48bb683ef409378fde6db33088
Comment #3 by bugzilla — 2012-12-26T21:15:25Z
If there isn't an obvious fix, I suggest reverting that fix, reopening its corresponding bug report, and add this example to the test suite.
Comment #4 by k.hara.pg — 2012-12-26T23:08:27Z
(In reply to comment #3) > If there isn't an obvious fix, I suggest reverting that fix, reopening its > corresponding bug report, and add this example to the test suite. I made an obvious fix. https://github.com/D-Programming-Language/dmd/pull/1412 This is a diagnostic bug. The fake errors were made by the incompletion of Phobos template instantiating.
Comment #5 by github-bugzilla — 2012-12-27T01:20:52Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/446d11da15197117f6e2acd8853accd7c6d22b54 fix Issue 9210 - [2.061 beta] Import cycle causes unpredictable compile errors https://github.com/D-Programming-Language/dmd/commit/4633b1336ba0aca1c260bcfd87fabb24f0d06692 Merge pull request #1412 from 9rnsr/fix9210 Issue 9210 - [2.061 beta] Import cycle causes unpredictable compile errors
Comment #6 by github-bugzilla — 2012-12-28T11:11:22Z
Commit pushed to staging at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/094f8f7687ea21df4670efd33338e6c69478a019 Merge pull request #1412 from 9rnsr/fix9210 Issue 9210 - [2.061 beta] Import cycle causes unpredictable compile errors