We do type-erasure on every path anyway, so it doesn't make much sense to duplicate this function for every type