Similarly:

```
object Test {

  val a: Option[Int] = None

  (a: a.type) match {
     case s: Some[Int] => println(s)
     case None    =>
  }
}
```

```
% qbin/scalac test/files/pos/t6771.scala
test/files/pos/t6771.scala:6: error: type mismatch;
 found   : Some[Int]
 required: Test.a.type
     case s: Some[Int] => println(s)
           ^
one error found
```