Skip to content

Delete dead shims: Lazy.cs and Dictionary.GetOrDefault (netstandard2.0) #357

Open

Description

@ChrisonSimtian

Tier 2 — Cleanup. Two helpers carry no weight:

  • src/Fallout.Utilities/Lazy.cs (~18 LOC) — Lazy.Create<T>(func) is just new Lazy<T>(func). Inline at call sites and delete.
  • src/Fallout.Utilities/Collections/Dictionary.GetOrDefault.cs (~23 LOC) — a netstandard2.0-only GetValueOrDefault shim. Built into the BCL since .NET 5; the project no longer needs the polyfill.

⚠️ Breaking change

Lazy.Create is public surface → if removed outright, breaking-change + experimental + CHANGELOG migration note. Prefer an [Obsolete] forwarder for one cycle. The Dictionary shim is conditionally compiled and effectively dead.

Acceptance

  • Lazy.Create call sites inlined; type obsoleted/removed
  • Dictionary.GetOrDefault netstandard2.0 conditional removed
  • CHANGELOG entry if any public removal

From dependency-consolidation audit, 2026-06-02.

Activity

  1. added
    enhancementNew feature or request
    breaking-changeChange is breaking — requires major version bump per CLAUDE.md semver policy.
    on Jun 2, 2026
  2. ChrisonSimtian commented on Jun 3, 2026

    @ChrisonSimtian
    CollaboratorAuthor

    Insights from a discarded prototype (old paths; map to onion structure after #359).

    • Lazy.Create: inline the ~8 call sites to target-typed new(...); keep an [Obsolete] forwarder (it's public).
    • WARNING — the issue premise is wrong: Dictionary.GetOrDefault is NOT dead. The project still multi-targets netstandard2.0, and the polyfill is reached cross-assembly via InternalsVisibleTo. Deleting it broke netstandard2.0 builds in LookupTable, ReflectionUtility, CompletionUtility, TeamCity, TeamCityAttribute (~6 sites).
    • Fix before deleting: rewrite those sites to TryGetValue, then remove the file. Both TFMs then compile.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking-changeChange is breaking — requires major version bump per CLAUDE.md semver policy.enhancementNew feature or requesttarget/vCurrentTargets the current version

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions