rfc:tagged_unions

Differences

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

Link to this comparison view

Last revisionBoth sides next revision
rfc:tagged_unions [2020/12/04 23:04] – created crellrfc:tagged_unions [2020/12/05 20:21] crell
Line 22: Line 22:
 A case with an associated value is called a Tagged Case.  An Enum Case that does not have associated values is called a Unit Case. A case with an associated value is called a Tagged Case.  An Enum Case that does not have associated values is called a Unit Case.
  
-Tagged cases are mutually exclusive with Primitive-Equivalent Cases.  If an Enum has at least one Tagged Case, it may not have any primitive equivalents and vice versa.  However, the same Enum may consist of any number of Tagged and Unit Cases.+Tagged cases are mutually exclusive with Scalar Cases.  If an Enum has at least one Tagged Case, it may not have any Scalar Cases and vice versa.  However, the same Enum may consist of any number of Tagged and Unit Cases.
  
 Associated values are defined using constructor property promotion. Associated values are defined using constructor property promotion.
rfc/tagged_unions.txt · Last modified: 2023/01/18 18:40 by crell