Issue 15244 - Misleading compiler warning: "Error: use .min_normal property instead of .min"
Summary: Misleading compiler warning: "Error: use .min_normal property instead of .min"
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P1 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-24 22:16 UTC by Ali Cehreli
Modified: 2020-03-21 03:56 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Ali Cehreli 2015-10-24 22:16:50 UTC
void main() {
    double.min;
}

Error: use .min_normal property instead of .min

I like the warning but it is misleading. When a person (especially a beginner) writes double.min, they mean "the minimum value" but the warning tells them to use something else: double.min_normal.

I recommend that the message be changed to something like

Error: .min is deprecated for floating point types. Do you mean -double.max or double.min_normal?

Ali
Comment 1 Walter Bright 2018-12-02 02:56:06 UTC
This currently produces the message:

  test.d(3): Error: no property `min` for type `double`

Not sure when or why it was changed.
Comment 2 basile-z 2019-02-14 06:44:09 UTC
https://github.com/dlang/dmd/pull/5555/files