In Swift, it’s not possible to know if T is Printable or am I missing something?
“Cannot downcast from T to non- protocol Printable”
Conversation
Correct.
1
1
know limitation? or shouldn’t I be doing what I’m trying to do?
1
Suggest using function overloading to accomplish your goals.
1
1
function overloading with a more specific type will work though! This is what you mean? gist.github.com/JaviSoto/9d112
2
I commented before you posted the gist l, but yeah. Curious to see if that works.
1
1
Replying to
Replying to
oh, I see what you’re saying. At the very least this should emit a warning though.
1
for _this_ exact problem, you *could* use toDebugString (I think it's called) if you really want...
2
1
Show replies



