Skip to content

Fix implicit cast operator for JsonNumber #30523

Closed

Description

@kasiabulat

Implicit cast operator for JsonNumber can throw an exception, which is against the FDG:
https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/operator-overloads#conversion-operators. We need to consider if we want implicit cast operators for JsonNumber, JsonBoolean and JsonString at all.

JsonNumber number = float.PositiveInfinity; // throws

_Originally posted by @ahsonkhan in dotnet/corefx#39917 (comment)

Activity

  1. transferred this issue fromdotnet/corefxon Feb 1, 2020
  2. added this to the 5.0 milestone on Feb 1, 2020
  3. modified the milestones: 5.0, Future on Apr 6, 2020
  4. ghost closed this as completedon Nov 5, 2021
  5. ghost locked as resolved and limited conversation to collaborators on Dec 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions