On 07/01/2022 13:47, Robert Korulczyk wrote:
I'm not really sure why would you not want this - what is the point of marking method as interface implementation, if it is not reflected by type system in actual execution?


It's really quite simple: I don't want traits to tell me how I "must" use them, but am quite happy for them to document how I "can" use them.

Unless we allow a trait to *automatically* implement the interface (or similar features, such as an interface with default implementation) there is no direct impact on the actual type system. There are, as far as I can see, three things the feature would provide:

- Documentation: the trait can tell me as a programmer that it contains everything I need to implement a particular interface - Code generation: the trait can import the list of methods from an interface as abstract methods which it requires - Policing: the trait can force me as a programmer to use it in a certain way; this is the part I don't see the need for

Regards,

--
Rowan Tommins
[IMSoP]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to