Skip to content

Remove blanket #pragma warning disable from Datetime.cs #538

@antonsynd

Description

@antonsynd

Problem

src/Sharpy.Core/Datetime/Datetime.cs has three file-wide pragma suppressions at lines 1-3:

  • CS8625 — "Cannot convert null literal to non-nullable reference type"
  • CS8603 — "Possible null reference return"
  • CS1591 — "Missing XML comment"

These defeat the solution-wide TreatWarningsAsErrors protection across the entire ~800-line file. The root cause is that Timezone parameters are typed as Timezone (non-nullable reference) but accept null defaults, and null comparisons are inconsistent (== null vs is null).

Proposed Fix

  1. Annotate Timezone? nullable properly on all parameters that accept null
  2. Fix inconsistent null handling patterns
  3. Remove blanket CS8625/CS8603 suppressions
  4. Add XML docs to public members missing them, then remove CS1591 suppression

Context

Found during implementation verification of plan-ee0da3 (Stdlib & Tooling Completion Post-Str Migration).

Acceptance Criteria

  • No #pragma warning disable in Datetime.cs
  • All datetime unit tests still pass
  • No new compiler warnings

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech-debtCode quality, cleanup, and maintainability improvements

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions