digitalmars.D.bugs - [Issue 23118] New: UFCS not working for function level templates
- d-bugmail puremagic.com (32/32) May 17 2022 https://issues.dlang.org/show_bug.cgi?id=23118
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 puremagic.com Reporter: razvan.nitu1305 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. --
May 17 2022