Skip to content

Instantly share code, notes, and snippets.

@ogatatsu
Created December 7, 2011 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ogatatsu/1441983 to your computer and use it in GitHub Desktop.
Save ogatatsu/1441983 to your computer and use it in GitHub Desktop.
ProxyT
abstract class ProxyT[T <: ProxyT[T]](implicit cm: ClassManifest[T]) {
val underlying: Any
override def hashCode: Int = underlying.hashCode
override def equals(other: Any): Boolean = other match {
case that: T if(cm.erasure.isInstance(that)) => underlying.equals(that.underlying)
case _ => false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment