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 a type contains a list of values, the generated encoder for Elm is wrong. The reason is that the type of Encode.list is
Encode.list
Encode.list: (a -> Value) -> List a -> Value
but it is used with an encoder myEncoder: a -> Value in the following construct
myEncoder: a -> Value
Encode.list (List.map myEncoder listOfA)
which is a type error.
import bridges.core.syntax._ import bridges.elm.Elm object Issue { case class Child( number: Int ) case class Parent( children: List[Child] ) def main(args: Array[String]): Unit = { val (_, content) = Elm.buildFile( module = "TestModule", decls = List( decl[Child], decl[Parent] ), customTypeReplacements = Map.empty ) println(content) } }
The List.map needs to be removed entirely, which fixes the issue.
List.map
The text was updated successfully, but these errors were encountered:
davegurnell#193: Fix Elm encoder for list fields
72295cd
davegurnell#193: Adjust test expectations
3de1c3f
No branches or pull requests
When a type contains a list of values, the generated encoder for Elm is wrong.
The reason is that the type of
Encode.list
isbut it is used with an encoder
myEncoder: a -> Value
in the following constructwhich is a type error.
Reconstruction
The
List.map
needs to be removed entirely, which fixes the issue.The text was updated successfully, but these errors were encountered: