Skip to content

compile time string value of NaN should be float.nan instead of nanF #23270

Description

@dkorpel

Came up in #23268

dmd's floatToBuffer formats nan values as follows:

pragma(msg, float.nan.stringof); // nanF
pragma(msg, double.nan.stringof); // nan
pragma(msg, real.nan.stringof); // nanL

This leads to confusing error messages and invalid header generation:

float n = nanF;

It should instead use something that's valid D syntax.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions