Enum values and failures through a package
How your app writes a package's enum values and failures: through the package's name, as its types are.
-
One path for every name through a package. An enum's value is written through its package as its type is,
AcmeCouriers.Window.morning, and through the package and its version while two are held,Postcodes.v3.Round.morning; the version is missing or needless exactly as for a type (package.version_needed,package.version_unneeded), and the type must be one the package makes public. The same holds wherever a value is written: in a body, a constant, a test'sfakes:, a variant built with its fields (Postcodes.v3.Round.shared { ... }) and amatcharm's pattern, whose names resolution checks as a value's; a pattern resolution refuses leaves its arm's case unknown, so thematchisn't also reported as not covering it. The enum written alone,Postcodes.Round, istype.not_a_valuenaming the enum, not the package. -
A package's failure in an outcome
match. An app'smatchon a provider call, a package action or a library package's function names the package's failure in its arm asfailsandattemptwrite it, through the package,AcmeCouriers.SlotTaken ->, and through the package and its version while two are held,Postcodes.v3.InvalidPostcode ->; an arm it misses is named the same way. The version is missing or needless exactly as for a type, and an arm resolution refuses leaves its failure unknown, so thematchisn't also told it misses one. Inside its own code a package still names its failures bare.
Markdown for agents: /docs/enum-values-and-failures-through-a-package.md.Built from Jadpo main at a707efb.