Suppose we have a parametric type
using Test
struct T{A} end
And a function above this type with an explicit return type.
Here is the long form. Works ok
function f(::T{A})::A where A
one(A)
end
@test f(T{Int}()) == 1
The short form however fails to parse.
f(::T{A})::A where A = 2 * one(A)
This short one parse.
(f(::T{A})::A) where A = 3 * one(A)
@test f(T{Int}()) == 3
But is a bit ugly. Is it the right and expected shortened form or do i miss something ?