Skip to content

Instantly share code, notes, and snippets.

@vallettea
Created February 21, 2014 16:17
Show Gist options
  • Select an option

  • Save vallettea/9137253 to your computer and use it in GitHub Desktop.

Select an option

Save vallettea/9137253 to your computer and use it in GitHub Desktop.
class GeomJsonSerializer extends JsonSerializer[T <: Geometry] {
def serialize[T <: Geometry](geom: T, json: JsonGenerator, provider: SerializerProvider) {
json.writeString(jtsToGeoJson(geom))
}
}
[error] /Users/vallette/projects/safesignal/util-core/src/main/scala/net/snips/util/StringUtils.scala:63: ']' expected but '<:' found.
[error] class GeomJsonSerializer extends JsonSerializer[T <: Geometry] {
[error] ^
@randhindi
Copy link

Tu peux pas faire ca car tu dois declarer le type T dans la classe GeomJsonSerializer

class GeomJsonSerializer[T <: Geometry] extends JsonSerializer[T]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment