# Can i declare struct with one type or enother using ||

**URL:** <https://discourse.julialang.org/t/can-i-declare-struct-with-one-type-or-enother-using/26120>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [July 7, 2019, 6:59pm UTC](https://discourse.julialang.org/t/can-i-declare-struct-with-one-type-or-enother-using/26120 "2019-07-07T18:59:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PharmCat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pharmcat/32/6953_2.png) [@PharmCat](https://discourse.julialang.org/u/PharmCat)\
**Post date:** [July 7, 2019, 6:59pm UTC](https://discourse.julialang.org/t/can-i-declare-struct-with-one-type-or-enother-using/26120/1 "2019-07-07T18:59:27Z")

</div>

can i make something like this

```julia
struct mystruct{T} where T <: Int || tuple{Int,Int}
    a::T
end

```

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [July 7, 2019, 7:20pm UTC](https://discourse.julialang.org/t/can-i-declare-struct-with-one-type-or-enother-using/26120/2 "2019-07-07T19:20:53Z")

</div>

`T <: Union{Int, Tuple{Int, Int}}` perhaps.

---

<div class="post-metadata">

**Author:** ![PharmCat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pharmcat/32/6953_2.png) [@PharmCat](https://discourse.julialang.org/u/PharmCat)\
**Post date:** [July 8, 2019, 2:07pm UTC](https://discourse.julialang.org/t/can-i-declare-struct-with-one-type-or-enother-using/26120/3 "2019-07-08T14:07:50Z")

</div>

Thank you so much!

Full code looks like:

```julia
struct MyType{T <: Union{Int, Tuple{Int, Int}}} <: AbstractMyType
    param::T
end

```
