[Issue 23118] New: UFCS not working for function level templates

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue May 17 10:54:17 UTC 2022


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

          Issue ID: 23118
           Summary: UFCS not working for function level templates
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: razvan.nitu1305 at gmail.com

This code fails:

```
void main()
{
    static void func(T)(T a, T b) { }

    2.func!int(2);   // Error: no property `func` for type `int`
}
```

whereas this code compiles fine:

```
static void func(T)(T a, T b) { }

void main()
{    
    2.func!int(2);
}
```

I haven't found anything in the spec about this case, but I don't see why ufcs
would not be considered in the former case.

--


More information about the Digitalmars-d-bugs mailing list