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

Broken Unary Operator Overload #1317

Closed
JaceEgMotivity opened this issue Jan 18, 2023 · 4 comments
Closed

Broken Unary Operator Overload #1317

JaceEgMotivity opened this issue Jan 18, 2023 · 4 comments
Assignees

Comments

@JaceEgMotivity
Copy link

I'm seeing an issue with unary operator overloads. Here's a snippet showing an unexpected undefined value: https://try.websharper.com/snippet/0000ZV

@granicz
Copy link
Member

granicz commented Jan 18, 2023

Confirmed to exist in the latest 6.1.2 bits, indeed.

@Jand42
Copy link
Member

Jand42 commented Jan 18, 2023

@JaceEgMotivity @granicz Thanks for the report. Indeed. All F# operators should be translated via macro or trait call, otherwise they do not translate to custom operators as C# ones do...

I have reviewed https://github.com/dotnet-websharper/core/blob/master/src/stdlib/WebSharper.Main.Proxies/Operators.fs to make a full list here that will be updated, which only have Inline at the moment instead of a macro/trait call:

  • binary &&& (op_BitwiseAnd)
  • binary >>> (op_RightShift)
  • binary <<< (op_LeftShift)
  • binary ^^^ (op_ExclusiveOr)
  • binary ||| (op_BitwiseOr)
  • unary + (op_UnaryPlus)
  • unary - (op_UnaryNegation)
  • unary ~~~ (op_LogicalNot)

Also possibly, but at a lower priority: all the trigonometric and other math functions (e.g. ceil translating to Ceiling method call).

@Jand42
Copy link
Member

Jand42 commented Jan 19, 2023

@JaceEgMotivity @granicz Hello, there is a new build that has fixes for all F# operators for which WebSharper proxy did not support overloading properly. https://github.com/dotnet-websharper/core/pkgs/nuget/WebSharper Currently on GH feed, but we will push to nuget if nothing else new comes up tomorrow

@Jand42
Copy link
Member

Jand42 commented Jan 20, 2023

@Jand42 Jand42 closed this as completed Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants