alexandrnikitin / bloom-filter-scala

Bloom filter for Scala, the fastest for JVM
https://alexandrnikitin.github.io/blog/bloom-filter-for-scala/
MIT License
376 stars 57 forks source link

Can't find implicit value for canGenerateHash #30

Closed cbyn closed 7 years ago

cbyn commented 7 years ago

I'm trying to use a BloomFilter inside of a class that uses a TypeTag:

class MyClass[T: TypeTag](numberOfItems: Long, falsePositiveRate: Double) {
  val bloomFilter = BloomFilter[T](numberOfItems, falsePositiveRate)
}

However at compile time I get could not find implicit value for parameter canGenerateHash: bloomfilter.CanGenerateHashFrom[T]. Is there a way around this?

Thank you, Chris

cbyn commented 7 years ago

Whoops, MyClass just needs its own implicit CanGenerateHashFrom[T] parameter and it compiles.