dmd icon indicating copy to clipboard operation
dmd copied to clipboard

Improved integer truncation warnings

Open AbhayPratap05 opened this issue 6 months ago • 1 comments

This PR enhances the compiler's error messages for implicit integer conversions that may truncate values. When a potentially lossy conversion is detected (e.g., longint), the compiler now shows a clear, actionable warning.

Changes

  1. Added explicit truncation checks for integral type conversions
  2. Implemented detailed error messages showing: Source and target types Size difference in bytes Suggested fix using explicit casts

AbhayPratap05 avatar Apr 21 '25 20:04 AbhayPratap05