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

          Issue ID: 17941
           Summary: arity (and probably others) only consider the first
                    lexically present function
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nob...@puremagic.com
          Reporter: and...@erdani.com

Consider:

import std.traits;

void fun(int);
void fun(int, int);

void gun(int, int);
void gun(int);

static assert(arity!fun == 1);
static assert(arity!gun == 2);

This code passes, indicating that only the first name in lexical order of an
overload set is considered by arity. This is definitely surprising. Worst case
the behavior should be documented, but a real solution would allow people to
indicate which overload they're interested in.

--

Reply via email to