# Parametric Types

**URL:** <https://discourse.julialang.org/t/parametric-types/27580>\
**Category:** General Usage\
**Created:** [August 15, 2019, 10:47am UTC](https://discourse.julialang.org/t/parametric-types/27580 "2019-08-15T10:47:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mischmi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mischmi/32/9787_2.png) [@mischmi](https://discourse.julialang.org/u/mischmi)\
**Post date:** [August 15, 2019, 10:47am UTC](https://discourse.julialang.org/t/parametric-types/27580/1 "2019-08-15T10:47:47Z")

</div>

Hi there,

I have a quick question regarding types. This is my code:

```julia
struct SomeStruct{L}
	v::Vector{Int64}
	
	function SomeStruct{L}() where L::Integer
		new( zeros( Int64, L ) ) 
	end
end

```

If I want to compile it, I get “invalid variable expression in “where””. I want L to be an Integer and nothing else, e.g.,

```julia
S = SomeStruct{5}()

```

What am I doing wrong? (It works if I don’t specify the type of L)

---

<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:** [August 15, 2019, 11:08am UTC](https://discourse.julialang.org/t/parametric-types/27580/2 "2019-08-15T11:08:44Z")

</div>

You can’t check _values_ with parametric signatures, but you can check in the constructor:

```julia
using ArgCheck
struct SomeStruct{L}
    v::Vector{Int64}
    function SomeStruct{L}() where L
        @argcheck L isa Integer
	new{L}(zeros(Int64, L))
    end
end

```

---

<div class="post-metadata">

**Author:** ![mischmi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mischmi/32/9787_2.png) [@mischmi](https://discourse.julialang.org/u/mischmi)\
**Post date:** [August 15, 2019, 11:53am UTC](https://discourse.julialang.org/t/parametric-types/27580/4 "2019-08-15T11:53:09Z")

</div>

Works! Thank you!
