public void set(IFoo foo, IBar bar, B b) { this.foo = foo; this.bar = bar; Debug.Log($"foo={foo.GetHashCode()}, bar={bar.GetHashCode()}, b={b.GetHashCode()}"); Debug.Log($"foo={(foo as B).GetHashCode()}, bar={(bar as B).GetHashCode()}"); }