www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21411] New: import in eponymous IFTI does not work correctly


          Issue ID: 21411
           Summary: import in eponymous IFTI does not work correctly
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: destructionator gmail.com

Seems similar to but distinct from

--- bugz.d

template bug() {
        import bugz2;
        void bug(S) {}

void main() {
        import bugz2;

--- bugz2.d

struct S {}


bugz.d(4): Error: undefined identifier S
bugz.d(9): Error: template bugz.bug cannot deduce function from argument types
()(S), candidates are:
bugz.d(2):        bug()(S)

DMD64 D Compiler v2.094.0-beta.1

Note that if it isn't IFTI - use `bug!()(S());` or any other form of explicit
instantiation - then it is fine.

Nov 20 2020