Skip to content

Commit caef6d4

Browse files
committed
Changes based on feedback
1 parent 04f896d commit caef6d4

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

proposals/p3720.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,8 @@ impl __RefBind_C_Static as Call(()) with .Result = i32;
365365
impl __TypeOf_C_Static as Call(()) where .Result = i32;
366366
```
367367

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
370370
[extending adapter](/docs/design/generics/details.md#extending-adapter) of the
371371
corresponding `__ValueBind_*` class.
372372

@@ -722,6 +722,8 @@ impl C as I {
722722
Results in this implementation:
723723

724724
```carbon
725+
fn C_I_F(__self: C
726+
725727
impl __ValueBind_I_F(C) as Call(()) where .Result = () {
726728
fn Op[self: Self]() {
727729
let __self: C = self as C;
@@ -737,9 +739,11 @@ c.(I.F)() == c.(__I_F)()
737739
== __I_F.((__TypeOf_I_F as ValueBind(C)).Op)(c)()
738740
== (c as __ValueBind_I_F(C))()
739741
== ((c as __ValueBind_I_F(C)) as Call(())).Op()
740-
== Fanfare(c)
741742
```
742743

744+
Which results in invoking the above implementation that will ultimately call
745+
`Fanfare(c)`.
746+
743747
### Non-instance interface members
744748

745749
Non-instance members use the `TypeBind` interface instead. For example, if `G`
@@ -799,9 +803,10 @@ C.(J.G)() == C.(__J_G)()
799803
== __J_G.((__TypeOf_J_G as TypeBind(C)).Op)()()
800804
== ({} as __TypeBind_J_G(C))()
801805
== (({} as __TypeBind_J_G(C)) as Call(())).Op()
802-
== Fireworks()
803806
```
804807

808+
Which calls the above implementation that calls `Fireworks()`.
809+
805810
> **Note:** Binding for non-instance members doesn't work with `ValueBind`, we
806811
> need `TypeBind`. Otherwise there is no way to get the value `C` into the
807812
> result type. Furthermore, we want `TypeBind` implementation no matter which

0 commit comments

Comments
 (0)