[Issue 17242] Specialized templates defined inside functions fail lookup, moving them outside makes them work

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Mar 3 11:56:51 PST 2017


https://issues.dlang.org/show_bug.cgi?id=17242

Walter Bright <bugzilla at digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla at digitalmars.com

--- Comment #1 from Walter Bright <bugzilla at digitalmars.com> ---
It also is the case with nested functions:

  int foo(int i)
  {
    int bar(int a) { return a; }
    int bar(uint b) { return b; }
    return bar(i);
  }

Name lookup is different inside functions. Overloading function definitions is
not allowed, neither are forward references:

  int foo(int i)
  {
    return bar(i);
    int bar(int a) { return a; }
  }

--


More information about the Digitalmars-d-bugs mailing list