Bug 9675 – cyclic import causes forward reference to template error

Status
RESOLVED
Resolution
DUPLICATE
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-03-09T08:16:00Z
Last change time
2013-03-10T07:58:48Z
Keywords
rejects-valid
Assigned to
nobody
Creator
r.sagitario

Comments

Comment #0 by r.sagitario — 2013-03-09T08:16:44Z
This code works in dmd2.062, but not in current git-head: ////////////////////////////////////// module semantic; import interpret; string semanticErrorValue(T)(T arg) { return null; } ////////////////////////////////////// module interpret; import semantic; class ValueT(T) { void binOp() { semanticErrorValue(""); } } class WCharValue : ValueT!wchar { string toStr() { return null; } } ////////////////////////////////////// "dmd -c interpret.d" works, but "dmd -c semantic.d" causes semantic.d(5): Error: template semantic.semanticErrorValue(T)(T arg) forward reference to template semanticErrorValue(T)(T arg) interpret.d(9): Error: template semantic.semanticErrorValue(T)(T arg) cannot deduce template function from argument types !()(string) maybe related to issue 9672
Comment #1 by r.sagitario — 2013-03-09T08:46:02Z
according to git bisect it is introduced by commit 67fbf5753e9d4a276c354e952ed2f888efcb714c fix Issue 7511 - attribute inference does not work for methods of templated aggregates
Comment #2 by k.hara.pg — 2013-03-10T07:58:48Z
*** This issue has been marked as a duplicate of issue 9672 ***