Are functions that operate only on types computed at compile time

Generally yes. The compiler is allowed to give up and compute things at run time, but in your example, yes it should generally be done at compile time. You can check what code it is optimizing to by running test cases like

code_typed(get_first_type, Tuple{Type{Tuple{Float64, Int, String}}})

and making sure it’s optimizing everything away

3 Likes