Summary: unaryFun can't be used to get element out of struct
           Product: D
           Version: 2.030
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos

import std.algorithm;

struct Foo {
    uint num;

void main() {
    Foo[] foos;
    auto bar = map!("a.num")(foos);

C:\dmd\windows\bin\..\..\src\phobos\std\functional.d(89): Error: static assert 
"Bad unary function: a.num for type Foo"

This looks like overzealous error checking, as it worked in the old Phobos and
now fails a static assert.  Probably has to do with the fact that Foo is in a
different module than std.functional.unaryFun.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to