ModularM
Modular2y ago
1 reply
sora

How to disambiguates the call to `f`?

Consider the following code:
trait A: ...
trait B: ...

@value
struct S(A, B):
  ...

fn f[ty: A](s: ty): ...
fn f[ty: B](s: ty): ...

fn test():
  let s = S()
  f(s)

What do I pass to f as the parameter? Named trait instance can be helpful here.
Was this page helpful?