Skip to content

Remove Dummies implicit generator conversions (ADR-0020) - #194

Merged
Reefact merged 3 commits into
mainfrom
claude/issue-190-implicit-cast-la0san
Jul 19, 2026
Merged

Remove Dummies implicit generator conversions (ADR-0020)#194
Reefact merged 3 commits into
mainfrom
claude/issue-190-implicit-cast-la0san

Conversation

@Reefact

@Reefact Reefact commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Summary

Remove the implicit conversions on the concrete Dummies generators and make Generate() the single way to materialize a value. The conversion drew randomness, could throw, and returned a fresh value on every run — an effectful, non-idempotent call disguised behind an assignment — and it fired only in explicitly-typed contexts while silently passing the generator under var, object, params object[], generic inference and overload resolution. Generate() already covers every context uniformly, so nothing is lost. Decided and recorded in ADR-0020 while the package is still pre-1.0.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Analyzer / diagnostic change
  • Tests
  • Documentation
  • Build / CI / tooling

Changes

  • Removed the 28 implicit operator definitions across the concrete generators — the simple types and the List<T> / T[] / HashSet<T> / Dictionary<TKey,TValue> collection generators.
  • Reworded the doc comments that referenced the conversion: IAny<T> now states Generate() is the single materialization; AnySequence's "unlike the other collection generators" note and AnyCollection.ContainingAny's ambiguity rationale (both premised on the now-removed conversion) are corrected.
  • Updated the XML-doc examples and Dummies/README.nuget.md to materialize with .Generate().
  • Migrated Dummies.UnitTests to .Generate(); replaced ImplicitConversionTests with MaterializationTests (materialization, call-site, fresh value per call, generic inference through IAny<T>).
  • Recorded the decision in ADR-0020 (English + French) and indexed it.

Testing

  • dotnet build FirstClassErrors.sln
  • dotnet test FirstClassErrors.sln
  • Analyzer tests pass (FirstClassErrors.Analyzers.UnitTests)

Documentation

  • Public API / error documentation updated
  • README / doc/ updated
  • French translation (doc/handwritten/for-users/README.fr.md) updated if user-facing behavior changed
  • No documentation change required

Architecture decisions

  • No architectural decision in this pull request
  • New decision recorded — ADR drafted as Proposed: ADR-0020
  • Supersedes an existing ADR — successor proposed, status not flipped: ADR-____
  • ⚠️ Conflicts with an existing ADR — flagged for the maintainer: ADR-____

Related issues

Closes #190


Generated by Claude Code

claude added 3 commits July 19, 2026 09:17
Record the decision to drop the implicit generator conversions and make
Generate() the single materialization, taken before the standalone Dummies
package reaches a stable 1.0. Drafted as Proposed for the maintainer to
accept; the implementation lands separately.

Refs: #190
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011NjuZBGDpqfLRvqzVPt34T
The concrete generators defined an implicit conversion to their generated
type. That conversion draws randomness, can throw, and yields a fresh value
on every run — an effectful, non-idempotent call disguised behind an
assignment, which contradicts the recipe-versus-value model the library
teaches, and which fires only in explicitly-typed contexts while silently
passing the generator under var, object, params object[], generic inference
and overload resolution.

Generate() already materializes uniformly in every context and is the path
the As/Combine seams use, so removing the operators loses no capability. The
package is pre-1.0, standalone and referenced only by its own tests, so this
is the cheapest moment to settle the contract. Documentation and tests are
updated to present Generate() as the sole materialization.

See ADR-0020.

Refs: #190
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011NjuZBGDpqfLRvqzVPt34T
The maintainer accepts the decision to drop the implicit generator
conversions and materialize dummies only through Generate(). Flip the
status from Proposed to Accepted in both language versions and the index.

Refs: #190
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011NjuZBGDpqfLRvqzVPt34T
@Reefact
Reefact merged commit 3db55ef into main Jul 19, 2026
13 checks passed
@Reefact
Reefact deleted the claude/issue-190-implicit-cast-la0san branch July 19, 2026 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dummies: Define and document the contract of implicit generator conversions

2 participants