# Why doesn't this type substitution work?

**URL:** <https://discourse.julialang.org/t/why-doesnt-this-type-substitution-work/33273>\
**Category:** General Usage\
**Created:** [January 12, 2020, 7:01pm UTC](https://discourse.julialang.org/t/why-doesnt-this-type-substitution-work/33273 "2020-01-12T19:01:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Qiyamah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/qiyamah/32/2660_2.png) [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Post date:** [January 12, 2020, 7:01pm UTC](https://discourse.julialang.org/t/why-doesnt-this-type-substitution-work/33273/1 "2020-01-12T19:01:21Z")

</div>

```julia
abstract type MM{T,U,V} end
function f(args...)
           typename = (vtypedecl{T, U, V} = MM{T, U, CV} where CV <: V)
           typename{args...}
  end
julia> f(Int,Number,Float64)
ERROR: UndefVarError: V not defined
Stacktrace:
 [1] f(::Type, ::Vararg{Type,N} where N) at ./REPL[4]:2
 [2] top-level scope at REPL[5]:1

```

Thanks

---

<div class="post-metadata">

**Author:** ![Jakub\_Wronowski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jakub_wronowski/32/204030_2.png) [@Jakub\_Wronowski](https://discourse.julialang.org/u/Jakub_Wronowski)\
**Post date:** [January 12, 2020, 7:26pm UTC](https://discourse.julialang.org/t/why-doesnt-this-type-substitution-work/33273/2 "2020-01-12T19:26:39Z")

</div>

Try

```julia
function f(args...)
       typename = (vtypedecl{T, U, V} = MM{T, U, CV} where {T,U,V,CV <: V})
       typename{args...}
end

```
