# Use a type alias as a function name

**URL:** <https://discourse.julialang.org/t/use-a-type-alias-as-a-function-name/6458>\
**Category:** General Usage\
**Tags:** type\
**Created:** [October 16, 2017, 3:04am UTC](https://discourse.julialang.org/t/use-a-type-alias-as-a-function-name/6458 "2017-10-16T03:04:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![colintbowers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/colintbowers/32/8033_2.png) [@colintbowers](https://discourse.julialang.org/u/colintbowers)\
**Post date:** [October 16, 2017, 3:04am UTC](https://discourse.julialang.org/t/use-a-type-alias-as-a-function-name/6458/1 "2017-10-16T03:04:26Z")

</div>

Hi all,

I’m sure this must have been covered somewhere, but a quick google didn’t help me.

I’m updating some code to v0.6 and so replaced all instances of, e.g.

```
typealias MyFloatVec Vector{Float64}

```

with

```
MyFloatVec = Vector{Float64}

```

But now if I try to defined a function `MyFloatVec() = ...`, I get the error message:

```
ERROR: cannot define function MyFloatVec; it already has a value

```

which makes perfect sense in hindsight. So, my question:

From v0.6 onwards, are we no longer able to use “type alises” as function names, or is there some way around this?

Cheers,

Colin

---

<div class="post-metadata">

**Author:** ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Post date:** [October 16, 2017, 3:50am UTC](https://discourse.julialang.org/t/use-a-type-alias-as-a-function-name/6458/2 "2017-10-16T03:50:08Z")

</div>

> [@colintbowers](#):
>
> MyFloatVec = Vector{Float64}

No this is not the equivalence. `const MyFloatVec = Vector{Float64}` is. The error message should be improved though.

---

<div class="post-metadata">

**Author:** ![colintbowers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/colintbowers/32/8033_2.png) [@colintbowers](https://discourse.julialang.org/u/colintbowers)\
**Post date:** [October 16, 2017, 4:04am UTC](https://discourse.julialang.org/t/use-a-type-alias-as-a-function-name/6458/3 "2017-10-16T04:04:10Z")

</div>

Ah! Thanks. I misunderstood the version notes, but just had a quick scan through the the github issues page and it all makes perfect sense now. Totally my fault for not reading carefully enough.

Cheers,

Colin
