[Issue 15870] New: UFCS not recognized on array when passing as alias parameter
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Mon Apr 4 04:33:20 PDT 2016
https://issues.dlang.org/show_bug.cgi?id=15870
Issue ID: 15870
Summary: UFCS not recognized on array when passing as alias
parameter
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: ryan at rcorre.net
Ordinarily, I don't have to slice an array to treat it as a range. However,
when passing it as template alias parameter, it seems like I do:
---
enum test(alias fun) = "it works";
immutable a = [1,2,3];
pragma(msg, test!(a[].map!(x => x))); // OK
pragma(msg, test!(a.map!(x => x))); // map is not a member of a
pragma(msg, test!(map!(x => x)(a))); // OK (no UFCS)
// but a.map does work at runtime ...
unittest {
auto r = a.map!(x => x);
}
---
--
More information about the Digitalmars-d-bugs
mailing list