@@ -365,8 +365,8 @@ impl __RefBind_C_Static as Call(()) with .Result = i32;
365
365
impl __TypeOf_C_Static as Call(()) where .Result = i32;
366
366
```
367
367
368
- ** Note ** : We could reduce the number of implementations required by making
369
- ` __RefBind_* ` an
368
+ ** Future work ** : We could reduce the number of implementations required by
369
+ making ` __RefBind_* ` an
370
370
[ extending adapter] ( /docs/design/generics/details.md#extending-adapter ) of the
371
371
corresponding ` __ValueBind_* ` class.
372
372
@@ -722,6 +722,8 @@ impl C as I {
722
722
Results in this implementation:
723
723
724
724
``` carbon
725
+ fn C_I_F(__self: C
726
+
725
727
impl __ValueBind_I_F(C) as Call(()) where .Result = () {
726
728
fn Op[self: Self]() {
727
729
let __self: C = self as C;
@@ -737,9 +739,11 @@ c.(I.F)() == c.(__I_F)()
737
739
== __I_F.((__TypeOf_I_F as ValueBind(C)).Op)(c)()
738
740
== (c as __ValueBind_I_F(C))()
739
741
== ((c as __ValueBind_I_F(C)) as Call(())).Op()
740
- == Fanfare(c)
741
742
```
742
743
744
+ Which results in invoking the above implementation that will ultimately call
745
+ ` Fanfare(c) ` .
746
+
743
747
### Non-instance interface members
744
748
745
749
Non-instance members use the ` TypeBind ` interface instead. For example, if ` G `
@@ -799,9 +803,10 @@ C.(J.G)() == C.(__J_G)()
799
803
== __J_G.((__TypeOf_J_G as TypeBind(C)).Op)()()
800
804
== ({} as __TypeBind_J_G(C))()
801
805
== (({} as __TypeBind_J_G(C)) as Call(())).Op()
802
- == Fireworks()
803
806
```
804
807
808
+ Which calls the above implementation that calls ` Fireworks() ` .
809
+
805
810
> **Note:** Binding for non-instance members doesn' t work with `ValueBind`, we
806
811
> need `TypeBind`. Otherwise there is no way to get the value `C` into the
807
812
> result type. Furthermore, we want `TypeBind` implementation no matter which
0 commit comments