rfc:never_for_parameter_types

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
rfc:never_for_parameter_types [2021/08/14 17:33] – Removed explicit widening jordanrlrfc:never_for_parameter_types [2021/08/15 09:36] – s/edit/blob/ derick
Line 91: Line 91:
 Allow the use of ''never'' as a type for arguments in interfaces and classes. This would have the following semantics: Allow the use of ''never'' as a type for arguments in interfaces and classes. This would have the following semantics:
  
-  * ''never'' cannot be used in an intersection type or union type. Any intersection would reduce to ''never'', and any union would reduce `neverout of the union, as ''never'' is the identity type of unions.+  * ''never'' cannot be used in an intersection type or union type. Any intersection would reduce to ''never'', and any union would reduce ''never'' out of the union, as ''never'' is the identity type of unions.
   * Attempting to call code directly that uses the ''never'' type for an argument would result in a ''TypeError'', as no zval will match this type.   * Attempting to call code directly that uses the ''never'' type for an argument would result in a ''TypeError'', as no zval will match this type.
  
Line 100: Line 100:
  
 ===== Proposed PHP Version(s) ===== ===== Proposed PHP Version(s) =====
-This change is proposed for next PHP 8.x+This change is proposed for PHP 8.2
  
 ===== RFC Impact ===== ===== RFC Impact =====
Line 138: Line 138:
  
 ===== References ===== ===== References =====
-  * https://github.com/JordanRL/never-argument-type/edit/master/README.md+  * https://github.com/JordanRL/never-argument-type/blob/master/README.md
   * https://en.wikipedia.org/wiki/Covariance_and_contravariance_(computer_science)   * https://en.wikipedia.org/wiki/Covariance_and_contravariance_(computer_science)
   * https://en.wikipedia.org/wiki/Bottom_type   * https://en.wikipedia.org/wiki/Bottom_type
   * https://blog.logrocket.com/when-to-use-never-and-unknown-in-typescript-5e4d6c5799ad/   * https://blog.logrocket.com/when-to-use-never-and-unknown-in-typescript-5e4d6c5799ad/
 +  * https://externals.io/message/115712
  
 ===== Changelog ===== ===== Changelog =====
rfc/never_for_parameter_types.txt · Last modified: 2021/08/24 11:53 by jordanrl