# Type annotation for one-line parametric methods

**URL:** <https://discourse.julialang.org/t/type-annotation-for-one-line-parametric-methods/21446>\
**Category:** General Usage\
**Created:** [March 4, 2019, 11:18am UTC](https://discourse.julialang.org/t/type-annotation-for-one-line-parametric-methods/21446 "2019-03-04T11:18:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pnalysz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pnalysz/32/7306_2.png) [@pnalysz](https://discourse.julialang.org/u/pnalysz)\
**Post date:** [March 4, 2019, 11:18am UTC](https://discourse.julialang.org/t/type-annotation-for-one-line-parametric-methods/21446/1 "2019-03-04T11:18:16Z")

</div>

Hi,

Why do I get error for `f3` while both `f1` and `f2` are correct? Is there any special syntax for type annotation of one-line parametric methods?

```julia
function f1(v::Base.Vector{T})::Core.Bool where {T}
    return true
end

f2(v::Base.Vector{T}) where {T} = true

f3(v::Base.Vector{T})::Core.Bool where {T} = true

```

Thanks in advance,  
Piotr

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [March 4, 2019, 11:27am UTC](https://discourse.julialang.org/t/type-annotation-for-one-line-parametric-methods/21446/2 "2019-03-04T11:27:46Z")

</div>

This needs parentheses:  
`(f3(v::Base.Vector{T})::Bool) where {T} = true`

---

<div class="post-metadata">

**Author:** ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Post date:** [May 19, 2019, 1:50am UTC](https://discourse.julialang.org/t/type-annotation-for-one-line-parametric-methods/21446/3 "2019-05-19T01:50:00Z")

</div>

Love the solution… but perhaps the parser could be made smarter?
