On Thu, Oct 29, 2020 at 09:06:21AM +, Jan Hönig via Digitalmars-d-learn
wrote:
> On Thursday, 29 October 2020 at 09:01:12 UTC, Jan Hönig wrote:
> > This would mean, that this one should work as well.
>
> It does not work as I intended, as `() => {}` has not the return type
> of `void`.
>
>
On Thursday, 29 October 2020 at 09:06:21 UTC, Jan Hönig wrote:
On Thursday, 29 October 2020 at 09:01:12 UTC, Jan Hönig wrote:
This would mean, that this one should work as well.
It does not work as I intended, as `() => {}` has not the
return type of `void`.
(I don't know how to print:
On 29/10/2020 10:06 PM, Jan Hönig wrote:
On Thursday, 29 October 2020 at 09:01:12 UTC, Jan Hönig wrote:
This would mean, that this one should work as well.
It does not work as I intended, as `() => {}` has not the return type of
`void`.
(I don't know how to print: `ReturnType!(() => {})`)
On Thursday, 29 October 2020 at 09:01:12 UTC, Jan Hönig wrote:
This would mean, that this one should work as well.
It does not work as I intended, as `() => {}` has not the return
type of `void`.
(I don't know how to print: `ReturnType!(() => {})`)
On Thursday, 29 October 2020 at 08:48:59 UTC, rikki cattermole
wrote:
() => {}
Is actually:
() => Expression
Rule: ref|opt ParameterWithMemberAttributes => AssignExpression
https://dlang.org/spec/expression.html#lambdas
This would mean, that this one should work as well.
And you can![1]
I
(Params){ FunctionBody; }
Rule: ref|opt ParameterWithMemberAttributes FunctionLiteralBody
https://dlang.org/spec/expression.html#function_literals
void function()
Is a type https://dlang.org/spec/type.html#delegates
() => {}
Is actually:
() => Expression
Rule: ref|opt