rfc:traits-with-interfaces
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
rfc:traits-with-interfaces [2016/02/18 21:10] – v 0.2, splitting into two proposals kevingessner | rfc:traits-with-interfaces [2016/02/22 20:06] – clarify grammar kevingessner | ||
---|---|---|---|
Line 50: | Line 50: | ||
//This proposal depends on Proposal 1, above.// | //This proposal depends on Proposal 1, above.// | ||
- | A trait that implements an interface provides methods that fulfill the interface’s contract. | + | A trait that implements an interface provides methods that fulfill the interface’s contract. |
Concretely, Proposal 2 makes this code be valid and functional: | Concretely, Proposal 2 makes this code be valid and functional: | ||
Line 77: | Line 77: | ||
Classes that insert the trait may override any members (as with existing traits) and continue to implement the interface. | Classes that insert the trait may override any members (as with existing traits) and continue to implement the interface. | ||
- | This change reduces the overhead of implementing an interface via a trait, because a class will only need to implement | + | This change reduces the overhead of implementing an interface via a trait, because a class will only need to insert |
Other languages that implement languages features like PHP’s traits allow for interface specifications like this RFC. See “References” for links. | Other languages that implement languages features like PHP’s traits allow for interface specifications like this RFC. See “References” for links. |
rfc/traits-with-interfaces.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1