[Issue 21411] New: import in eponymous IFTI does not work correctly
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Sat Nov 21 04:44:16 UTC 2020
    
    
  
https://issues.dlang.org/show_bug.cgi?id=21411
          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 at puremagic.com
          Reporter: destructionator at gmail.com
Seems similar to but distinct from
https://issues.dlang.org/show_bug.cgi?id=6501
--- bugz.d
template bug() {
        import bugz2;
        void bug(S) {}
}
void main() {
        import bugz2;
        bug(S());
}
--- 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.
--
    
    
More information about the Digitalmars-d-bugs
mailing list