Bug 21419 – Spurious "forward reference to inferred return type of function call" with recursive template functions

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-11-24T05:39:53Z
Last change time
2024-12-13T19:12:58Z
Keywords
rejects-valid
Assigned to
No Owner
Creator
Vladimir Panteleev
Moved to GitHub: dmd#18001 →

Comments

Comment #0 by dlang-bugzilla — 2020-11-24T05:39:53Z
/////////////////////////// test.d ////////////////////////// auto fun(int x)() { gun(); } void gun()() { fun!2(); } unittest { // fun!1(); // Uncomment to fix below instantiation fun!2(); // forward reference to inferred return type ... } ///////////////////////////////////////////////////////////// Similar to issue 10810. However, there is evidence that this is just a dirty compiler bug instead of some intrinsic design limitation: explicitly instantiating the template with a parameter different from the one used in the recursive call causes the recursive instantiation to succeed (causing "spooky action at a distance").
Comment #1 by robert.schadek — 2024-12-13T19:12:58Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18001 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB