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

.withNumber(_ + 10) broken in master #161

Open
aryairani opened this issue Jan 11, 2015 · 2 comments
Open

.withNumber(_ + 10) broken in master #161

aryairani opened this issue Jan 11, 2015 · 2 comments
Labels

Comments

@aryairani
Copy link

This expression comes from the docs at http://argonaut.io/doc/json/

// v6.0.4
scala> jNumber(100).withNumber(_ + 10)
res0: argonaut.Json = 110

vs (depending on the exact revision)

scala> jNumber(100).withNumber(_ + 10)
<console>:20: error: type mismatch;
 found   : Int(10)
 required: String
              jNumber(100).get.withNumber(_ + 10)

or in versions where jNumber(100) returns Option[Json]:

scala> jNumber(100).get.withNumber(_ + 10)
<console>:20: error: type mismatch;
 found   : Int(10)
 required: String
              jNumber(100).get.withNumber(_ + 10)

git bisect says b405f23 is the first bad commit:
"Added JsonLong and JsonDouble cases for JsonNumber #116"

@aryairani aryairani changed the title jNumber(100).withNumber(_ + 10) broken in master .withNumber(_ + 10) broken in master Jan 11, 2015
@seanparsons
Copy link
Member

I'm thinking we might bin this example as it doesn't really apply to the current code.

@julien-truffaut
Copy link
Member

you can achieve the same result using with Prism, e.g.

jIntPrism.modify(_ + 10)(jNumber(10)) == jNumber(20)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants