Re: Can't pass private symbols as alias parameter

2014-11-17 Thread Steven Schveighoffer via Digitalmars-d
On 11/16/14 5:41 AM, deadalnix wrote: module a; struct A(alias foo) { auto foo() { return foo(); } } I note here, the above doesn't is incorrect regardless, I assume you didn't actually try to compile this post example :) To fix, I did this: struct A(alias foo) { auto

Re: Can't pass private symbols as alias parameter

2014-11-17 Thread Dmitry Olshansky via Digitalmars-d
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.

Re: Can't pass private symbols as alias parameter

2014-11-17 Thread deadalnix via Digitalmars-d
On Monday, 17 November 2014 at 14:13:21 UTC, Steven Schveighoffer wrote: I note here, the above doesn't is incorrect regardless, I assume you didn't actually try to compile this post example :) To fix, I did this: struct A(alias foo) { auto bar() { return foo(); } } Sorry for

Re: Can't pass private symbols as alias parameter

2014-11-17 Thread deadalnix via Digitalmars-d
On Monday, 17 November 2014 at 20:45:28 UTC, Dmitry Olshansky wrote: 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). Yes me too. I'm filling.

Re: Can't pass private symbols as alias parameter

2014-11-17 Thread deadalnix via Digitalmars-d
On Monday, 17 November 2014 at 22:17:01 UTC, deadalnix wrote: On Monday, 17 November 2014 at 20:45:28 UTC, Dmitry Olshansky wrote: 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). Yes me too. I'm

Re: Can't pass private symbols as alias parameter

2014-11-16 Thread deadalnix via Digitalmars-d
ping pong ping ping ?

Re: Can't pass private symbols as alias parameter

2014-11-16 Thread Freddy via Digitalmars-d
On Sunday, 16 November 2014 at 10:41:20 UTC, deadalnix wrote: 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

Re: Can't pass private symbols as alias parameter

2014-11-16 Thread Meta via Digitalmars-d
On Sunday, 16 November 2014 at 10:41:20 UTC, deadalnix wrote: 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

Re: Can't pass private symbols as alias parameter

2014-11-16 Thread deadalnix via Digitalmars-d
On Monday, 17 November 2014 at 03:22:49 UTC, Meta wrote: It seems like a feature to me. Otherwise, you would have A.foo, which is in module a, calling a private function from module b. I think it is sane that the function should be public if you want to do things such as this. Furthermore, it

Re: Can't pass private symbols as alias parameter

2014-11-16 Thread Meta via Digitalmars-d
Actually, the more I think about it, the more I'm sure that it is a bug. If you import A into module b, you should be able to use it with the symbols in b. This actually seems like quite a bad bug.