You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a property is generated by Pattern.OptionalFields, accessing the "...Opt" variant should translate to accessing the base-name property in JavaScript. Due to a bug, the resulting JS code accesses the non-existent "...Opt" property.
Sample WIG F# code:
letC1=
Class "C1"|+> Pattern.OptionalFields ["field", T<int>]
@dvdkon Thanks for the report! First and foremost is to figure out why the repo wouldn't build for you. Could you post the error you are seeing on a separate ticket? Thanks!
@dvdkon Thanks for the report, fix will be in next release soon.
Workaround:
Define OptionalFields helper for yourself, it's just a convenience tool built upon other public WIG API operators and functions.
letOptionalFields(optional:seq<string*Type.Type>)=
Instance [for(n, t)in optional doyield n =! t :>_letsn=letname= n.Replace('.','_')
name.Substring(0,1).ToUpper()+ name.Substring 1+"Opt"yield n =@!?t |> WithSourceName sn :>_]
When a property is generated by
Pattern.OptionalFields
, accessing the "...Opt" variant should translate to accessing the base-name property in JavaScript. Due to a bug, the resulting JS code accesses the non-existent "...Opt" property.Sample WIG F# code:
Resultant .DLL decompiled to C#:
Note how the
Inline
annotation containsfieldOpt
, when it should contain justfield
.I tried to fix this myself, but I couldn't get WebSharper to build. All it should take as far as I know is
WithSourceName
in the function.The text was updated successfully, but these errors were encountered: