# Constant "type parameter" and inner constructor error message

**URL:** https://discourse.julialang.org/t/constant-type-parameter-and-inner-constructor-error-message/7332
**Category:** General Usage
**Tags:** question
**Created:** [November 27, 2017, 1:33pm UTC](https://discourse.julialang.org/t/constant-type-parameter-and-inner-constructor-error-message/7332 "2017-11-27T13:33:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [November 27, 2017, 1:33pm UTC](https://discourse.julialang.org/t/constant-type-parameter-and-inner-constructor-error-message/7332/1 "2017-11-27T13:33:32Z")

</div>

The following is an MWE from a typo that I made during refactoring some code:

```julia
struct Foo{Float64}
    x::Int
    Foo() = new(1)
end

```

that gave the curious error message

```julia
WARNING: deprecated syntax "inner constructor Foo(...) around /tmp/e.jl:3".
Use "Foo{Float64}(...) where Float64" instead.

```

Am I right in thinking that in

```julia
struct Foo{Float64}
    x::Int
    Foo{Float64}() where Float64 = new(1)
end

```

the `Float64` is a type parameter, eg fully replaceable with `T` or something without changing the semantics?

---

<div class="post-metadata">

### Author: ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)
#### Post date: [November 27, 2017, 1:54pm UTC](https://discourse.julialang.org/t/constant-type-parameter-and-inner-constructor-error-message/7332/2 "2017-11-27T13:54:50Z")

</div>

Yes, this is equivalent to:

```julia
struct Foo{T}
    x::Int
    Foo{T}() where T = new(1)
end

```

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [November 27, 2017, 2:21pm UTC](https://discourse.julialang.org/t/constant-type-parameter-and-inner-constructor-error-message/7332/3 "2017-11-27T14:21:19Z")

</div>

I wonder if this (_type parameter name_ coinciding with _type name_) would deserve at least a warning, or I was just staring at it for 5 minutes because this has been a long day 😄
