Using java.lang.Integer as Field Type
See original GitHub issueHello,
Once I convert this
case class SomeClass (
someField: Int
)
to
case class SomeClass (
someField: java.lang.Integer
)
I start getting an error on
for {
ad <- Gen.oneOf(random[SomeClass](testsNum))
} yield {
ad
.toJson
}
which is below.
Error:(17, 49) not enough arguments for method random: (implicit evidence$3: reflect.runtime.universe.WeakTypeTag[SomeClass], implicit evidence$4: org.scalacheck.Arbitrary[SomeClass])Seq[SomeClass].
Unspecified value parameter evidence$4.
ad <- Gen.oneOf(random[SomeClass](testsNum))
Error:(17, 49) could not find implicit value for evidence parameter of type org.scalacheck.Arbitrary[SomeClass]
ad <- Gen.oneOf(random[SomeClass](testsNum))
Could you help understanding how to tackle that? Sorry for the noise.
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Integer (Java Platform SE 7 ) - Oracle Help Center
The Integer class wraps a value of the primitive type int in an object. An object of type Integer contains a single field...
Read more >Java.lang.Integer class in Java - GeeksforGeeks
Integer class is a wrapper class for the primitive type int which contains several methods to effectively deal with an int value like ......
Read more >Java.lang.Integer Class - Tutorialspoint
The java.lang.Integer class wraps a value of the primitive type int in an object. An object of type Integer contains a single field...
Read more >Class java.lang.Integer - Washington
The Integer class wraps a value of the primitive type int in an object. An object of type Integer contains a single field...
Read more >Can not set java.lang.Integer field to java.lang.Integer
What happens if you change your HQL query to from UserPattern where user.id = :user_id and pattern.id = :pattern_id ?
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I found a way to stick with Ints and it made the life way easier. The workaround is below
then install it
so, I guess, we can resolve the ticket, which I will do with your permission, @DanielaSfregola
Weird, if you are using case classes the type class derivation should have no problem in automatically generating an Arbitrary for each case class, even if nested.
I’d do some investigation and try to replicate the issue! 😃