# Difference between Type{T} and T when passing type variable inside generated function?

**URL:** <https://discourse.julialang.org/t/difference-between-type-t-and-t-when-passing-type-variable-inside-generated-function/38121>\
**Category:** General Usage\
**Created:** [April 24, 2020, 2:11am UTC](https://discourse.julialang.org/t/difference-between-type-t-and-t-when-passing-type-variable-inside-generated-function/38121 "2020-04-24T02:11:35Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Elrod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elrod/32/22461_2.png) [@Elrod](https://discourse.julialang.org/u/Elrod)\
**Post date:** [April 24, 2020, 2:46am UTC](https://discourse.julialang.org/t/difference-between-type-t-and-t-when-passing-type-variable-inside-generated-function/38121/4 "2020-04-24T02:46:00Z")

</div>

```julia
julia> @generated function type_print_gen(T)
         return :(println(T))
       end
type_print_gen (generic function with 1 method)

julia> type_print_gen(Int8)
Int8

```

EDIT:  
But this is probably more along the lines of what you want:

```julia
julia> foo(::Type{Type{T}}) where {T} = T
foo (generic function with 1 method)

julia> @generated function type_print_gen(T)
         :(println($(foo(T))))
       end
type_print_gen (generic function with 1 method)

julia> type_print_gen(Int32)
Int32

```

---

_[View the full topic](https://discourse.julialang.org/t/difference-between-type-t-and-t-when-passing-type-variable-inside-generated-function/38121)._
