lloydmeta / enumeratum

A type-safe, reflection-free, powerful enumeration implementation for Scala with exhaustive pattern match warnings and helpful integrations.
MIT License
1.19k stars 149 forks source link

Name clash with Play for 'Json' #15

Closed howyp closed 9 years ago

howyp commented 9 years ago

Thanks for the library, really useful.

Something that I've noticed is that the suggested way of importing enumeratum introduces a name clash with Play:

scala> def test() = {
     |   import enumeratum._
     |   import play.api.libs.json._
     |   Json.toJson("test")
     | }
<console>:19: error: reference to Json is ambiguous;
it is imported twice in the same scope by
import play.api.libs.json._
and import enumeratum._
         Json.toJson("test")

This can be worked around, but given that enumeratum is specifically designed to work well with Play's json support, this seemed a bit of a shame to me. Could we rename the enumeratum.Json object?

lloydmeta commented 9 years ago

Oh, nice find. This is a pity. I'm thinking of enumeratum.JsonHelper as a name but am open to suggestions :)

howyp commented 9 years ago

enumeratum.EnumFormats would seem most descriptive to me?

lloydmeta commented 9 years ago

@howyp done via #16 with release 1.3.0