Can't pass private symbols as alias parameter

Dmitry Olshansky via Digitalmars-d digitalmars-d at puremagic.com
Mon Nov 17 12:45:18 PST 2014


16-Nov-2014 13:41, deadalnix пишет:
> module a;
>
> struct A(alias foo) {
>      auto foo() {
>          return foo();
>      }
> }
>
> module b;
>
> import a;
>
> void main() {
>      auto a = A!bar();
> }
>
> private int bar() { return 42; }
>
> This do not work. I think it is a bug but I see how could see it as a
> feature. Which one is it ?

I think that it's a bug or a very annoying feature.
I've seen it a few times before but never filed (I too wasn't sure if 
it's by design).

-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list