Kentzo
(Ilya Kulakov)
1
With lldb stopped inside the following function:
func doSomething<T>() -> T {
// on breakpoint here
}
is it possible to dump type of T? There are no variables nor arguments of type T, it's used purely for type casting inside the function.
jrose
(Jordan Rose)
2
You should be able to say expr T.self (or print T.self), at least in debug builds. If that's not working I'd say file a bug.
Kentzo
(Ilya Kulakov)
3
Is it a feature of Swift, lldb or both?
jrose
(Jordan Rose)
4
LLDB's expr command, aliased as print by default, runs an expression and displays the output (also storing it in a variable if it's non-Void). T.self is the normal way to refer to a type as an value, like Int.self, but using the generic parameter T. So, a little of both, I guess?
1 Like