[Issue 24817] New: UDA on nested template does not work

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Oct 15 12:13:11 UTC 2024


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

          Issue ID: 24817
           Summary: UDA on nested template does not work
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: default_357-line at yahoo.de

Consider this code:

@(3)
int foo() => 0;
static assert(__traits(getAttributes, foo)[0] == 3);

@(3)
int bar(T)() => 0;
static assert(__traits(getAttributes, bar)[0] == 3);

void main() {
    @(3)
    int ffoo() => 0;
    static assert(__traits(getAttributes, ffoo)[0] == 3);

    @(3)
    int bbar(T)() => 0;
    static assert(__traits(getAttributes, bbar)[0] == 3);
}

Leads to: "Error: sequence index `[0]` is outside bounds `[0 .. 0]`"
on the last assert only.

--


More information about the Digitalmars-d-bugs mailing list