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

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> 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
1 Like