We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When calling curried functions from other projects the functions get un-curried. This leads to the following exception:
TypeError: Cannot read properties of undefined (reading '0')
Create a fsharp library that includes the following code:
namespace Repro #if FABLE_COMPILER open Thoth.Json #else open Thoth.Json.Net #endif type Person = { First: string Last: string } [<AutoOpen>] module PersonExtensions = [<RequireQualifiedAccess>] module Person = let decode = Decode.object(fun get -> let epoch = get.Required.Field "first" Decode.string let timezoneId = get.Required.Field "last" Decode.string { Person.First = epoch; Person.Last = timezoneId } ) type Person with static member Decode (path: string) (value: JsonValue) = Person.decode path value
Add a reference to Thoth.Json (Version="5.1.0")
Call the decode function in a project referencing the library.
decode
module Test = #else open Thoth.Json.Net open Expecto #endif open Repro let test () = let json = """ { "first": "John", "last": "Doe" } """ let person: Person = Decode.unsafeFromString Person.decode json ()
Calling test fails as the decode function is un-curried by the compiler.
The text was updated successfully, but these errors were encountered:
Thanks for reporting! I can reproduce: https://github.com/alfonsogarciacaro/repro-3397
I will fix it for the next release 👍
Sorry, something went wrong.
Fix #3397: Curry only user imports
5a7c286
Fix #3397: Curry only user imports (#3399)
e21c324
* Fix #3397: Curry only user imports * Add regression test
Successfully merging a pull request may close this issue.
Description
When calling curried functions from other projects the functions get un-curried. This leads to the following exception:
Repro
Create a fsharp library that includes the following code:
Add a reference to Thoth.Json (Version="5.1.0")
Call the
decode
function in a project referencing the library.Calling test fails as the decode function is un-curried by the compiler.
Related information
The text was updated successfully, but these errors were encountered: