Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Use fable compliant tryparse #11

Closed
Freymaurer opened this issue Jun 18, 2024 · 0 comments
Closed

[BUG] Use fable compliant tryparse #11

Freymaurer opened this issue Jun 18, 2024 · 0 comments
Assignees

Comments

@Freymaurer
Copy link
Member

Freymaurer commented Jun 18, 2024

Replace custom helper functions with baked in fable utils. To be honest, i am confused as i was sure this returned an error, but the following code runs for me with fable, maybe we must update fable dependency dotnet tool update fable and then it will run correctly?

module TestInt =
  let actual = System.Int32.TryParse("42")
  let parsable, v = actual


  printfn "%b" (parsable = true)

  printfn "%b" (v = 42)


module TestFloat =
  /// use System.Double.TryParse with CultureInvariant
  let Culture = System.Globalization.CultureInfo.InvariantCulture
  let actual = System.Double.TryParse("42.69", System.Globalization.NumberStyles.Float, Culture)
  let parsable, v = actual

  printfn "%b" (parsable = true)

  printfn "%b" (v = 42.69)
  printfn "%A" v

module TestBool =
  let actual = System.Boolean.TryParse("true") // fails for python
  let parsable, v = actual


  printfn "%b" (parsable = true)

  printfn "%b" (v = true)
@Freymaurer Freymaurer changed the title [BUG] [BUG] Use fable compliant tryparse Jun 18, 2024
@github-actions github-actions bot added the Status: Needs Triage This item is up for investigation. label Jun 18, 2024
@Freymaurer Freymaurer self-assigned this Jun 19, 2024
@Freymaurer Freymaurer removed the Status: Needs Triage This item is up for investigation. label Jun 19, 2024
@Freymaurer Freymaurer closed this as completed by moving to Done in ARCStack Jun 19, 2024
Freymaurer added a commit that referenced this issue Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant