Closed Geod24 closed 4 years ago
It turns out that this template doesn't actually have a replacement.
deprecated("Use ocean.meta.types.Function.ReturnTypeOf")
template ReturnTypeOf( alias fn )
{
alias ReturnTypeOf!(typeof(fn)) ReturnTypeOf;
}
The code in ocean.core.Traits works for member functions. The one in meta does not, because it ignores the 'this' pointer.
This is used in dhtproto.
Do you have a link ? Github doesn't match anything.
It is in dhtproto.client.internal.NodeHashRanges
The relevant code is:
private class NodeHashRangesBase
{
import ocean.meta.types.Function : ReturnTypeOf;
import swarm.neo.AddrPort;
/// Convenience alias for the comparison type of AddrPort.
private alias ReturnTypeOf!(AddrPort.cmp_id) Addr;
And swarm.neo.AddrPort is:
public struct AddrPort
{
public long cmp_id ( ) { .. }
}
I get: ./submodules/ocean/src/ocean/meta/types/Function.d(112): Error: need this for cmp_id of type long()
Can you try:
private alias ReturnTypeOf!(&AddrPort.cmp_id) Addr;
From your error message, it looks like the method is implicitly called...
That doesn't work either.
./src/dhtproto/client/internal/NodeHashRanges.d(278): Error: expression & cmp_id is not a valid template value argument
Submitted a PR to fix the code, so merging this.
Codecov Report