// but I want to discriminate based off the return type
function z(yy: Fortunate | Unlucky) {
// this what I want to achieve
if (yy.getIs()) return;
// but _tag is still unknown
yy._tag;
}
It doesn't seem to be a supported feature but I don't know all the advanced features of ts so I wondered if there's a way of doing this with a more advanced utility type.
tyvm
0 Replies
No replies yetBe the first to reply to this messageJoin