Skip to content

Improve decompilation of Decimal type numeric literals ("m"-suffixed) #118

@stephen-swensen

Description

@stephen-swensen

F# > 4.0 quotes literal decimals in an odd way compared to other numeric literals such that it confuses the decompiler:

> <@ 2.3m @>;;
val it : Quotations.Expr<decimal> =
  Call (None, MakeDecimal,
      [Value (23), Value (0), Value (0), Value (false), Value (1uy)])
    {CustomAttributes = [NewTuple (Value ("DebugRange"),
          NewTuple (Value ("stdin"), Value (7), Value (3), Value (7), Value (7)))];
     Raw = ...;
     Type = System.Decimal;}
> unquote <@ 2.3m @>;;
val it : UnquotedExpression = 
23.[0, 0, false, 1uy]
2.3M

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions