On 08/03/2016 09:40 PM, Andre Pany wrote:
Thanks for the info. Yes, I forgot the () for new Object;
Adding the () for new Object() still returns the same error.
`new Object` without parentheses is perfectly fine.
Function pointers and delegates are not intended to allow
optional parentheses. See also DIP23.
On Wednesday, 3 August 2016 at 18:15:23 UTC, Anonymouse wrote:
On Wednesday, 3 August 2016 at 17:16:10 UTC, Andre Pany wrote:
[...]
[...]
...is an alias for a delegate/function returning an Object. It
is analogous to
[...]
[...]
...is a function accepting an Object parameter. In main
On Wednesday, 3 August 2016 at 17:16:10 UTC, Andre Pany wrote:
Hi,
I just stumbled over this behavior. I am not sure whether
the behavior is correct or not.
[...]
alias foo = () => new Object;
...is an alias for a delegate/function returning an Object. It is
analogous to
alias foo = () {
Hi,
I just stumbled over this behavior. I am not sure whether
the behavior is correct or not.
alias foo = () => new Object;
void bar(Object o){}
void main()
{
auto n1 = foo;
bar(foo);
}
While first line in main is working fine,
second line does not compile due to missing ().