I have a use-case where I want to do something like

```
trait Foo {
  def bar[T](x: T)(implicit ev: x.type =:= this.type) = {}
}

```

so, that a call to bar only compiles, when the parameter x has the same type as the class where the method is called upon.

It's clear, that the this.type doesn't help in this case, because each instance has a different this.type, this should only illustrate the goal. 

The complete problem looks like this:

```
trait Foo {
  def bar[B <: Foo](o: B) = {} // with some check added
}

abstract class Abstract extends Foo

class Concrete1 extends Abstract

class Concrete2 extends Abstract 

case class Wrapped(a: Abstract)

val c1a = new Concrete1
val c1b = new Concrete1
val c2 = new Concrete2
val ts1 = new Wrapped(new Concrete1)

c1a.bar(c1b) // should compile
ts1.a.bar(c1b) // should also compile
c2.bar(c1b)  // should not compile

```

Using abstract types I found a solution that compiles c1a.bar(c1b) and doesn't compile c2.bar(c1b) as intended, but also doesn't compile ts1.a.bar(c1b). I checked also other ideas like the approach described in update2 of [this post](https://stackoverflow.com/questions/4313139/how-to-use-scalas-this-typing-abstract-types-etc-to-implement-a-self-type), but here the covariance of Self doesn't allow to define bar. 

Exist there a solution that I didn't see? Without making Abstract a generic type (which I want to avoid).

Thanks