refactor: reserve plain factory names for Outcome-returning variants#156
Merged
Conversation
Apply ADR-0005 across the Usage samples and the documentation: the Outcome-returning factory carries the plain name and the throwing variant takes the OrThrow suffix, so no method returning an Outcome wears the Try prefix whose bool+out shape it never honours. - Temperature: TryFromKelvin/TryFromCelsius become FromKelvin/FromCelsius (Outcome), the throwing FromKelvin/FromCelsius become FromKelvinOrThrow/FromCelsiusOrThrow, and the AbsoluteZero call site and the "Attempts to create" XML-doc summaries are updated to match. - Amount: the throwing Add/Subtract become AddOrThrow/SubtractOrThrow. - Docs (EN + FR): reword the GettingStarted, UsagePatterns and OutcomeGuide examples (TryAdd/TryParseAmount/TryCreateAmount, and the non-factory TryAlternativeProviderAsync), and align the Amount.Add prose references in WritingErrorMessages and WritingErrorsGuide. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013eNZiEbSu9gdvUSLBoPNd4
Reefact
enabled auto-merge
July 16, 2026 01:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Apply ADR-0005 across the
FirstClassErrors.Usagesamples and the documentation: the Outcome-returning factory carries the plain name and the throwing variant takes theOrThrowsuffix, so no method returning anOutcomewears theTryprefix whosebool+outshape it never honours.Type of change
Changes
Temperature:TryFromKelvin/TryFromCelsius→FromKelvin/FromCelsius(Outcome-returning); the throwingFromKelvin/FromCelsius→FromKelvinOrThrow/FromCelsiusOrThrow; theAbsoluteZerocall site and the "Attempts to create…" XML-doc summaries are updated to match.Amount: the throwingAdd/Subtract→AddOrThrow/SubtractOrThrow. The boolean predicatesIsGreaterThan/IsLessThanare left unchanged (theOrThrowmarker is not idiomatic on abool-returning predicate).GettingStarted,UsagePatternsandOutcomeGuideexamples (TryAdd/TryParseAmount/TryCreateAmount, and the non-factoryTryAlternativeProviderAsync→AlternativeProviderAsync), and align theAmount.Addprose references inWritingErrorMessagesandWritingErrorsGuide.Usagesamples project; the published packages (FirstClassErrors,FirstClassErrors.Testing) are untouched, so no published-package API changes.Testing
dotnet build FirstClassErrors.slndotnet test FirstClassErrors.sln— 728 passed, 0 failed (incl.GenDoc.UnitTests, confirming the error-catalog snapshots are unaffected)FirstClassErrors.Analyzers.UnitTests) — 85 passedDocumentation
doc/updateddoc/*.fr.md) updated in lockstep with the English docsArchitecture decisions
Implements the already-accepted ADR-0005 (Reserve the plain factory name for the Outcome-returning variant). No new decision is recorded, nothing is superseded, and nothing conflicts with the ADR base. The ADR file itself is intentionally left untouched — it documents the decision using the pre-rename names.
Related issues
None.
🤖 Generated with Claude Code
https://claude.ai/code/session_013eNZiEbSu9gdvUSLBoPNd4
Generated by Claude Code