lampepfl/dotty — pull request #320 by smarter (2014-12-28 17:00:30+00:00)
Title: Prevent block types with references to local symbols

Review by @odersky

---

As an aside, the rules for block typing seem non-intuitive to me, the example from `tests/pos/t1569a.scala` works:
```scala
object Bug2 {
class C { type T }
class D extends C { type T = String }
def foo(x: Int)(y: C)(z: y.T): Unit = {}
foo(3)(new D)("hello")
}
```
But replacing `new D` by `new D {}` fails with:
```
tests/pos/t1569a.scala:11: error: type mismatch:
found : String("hello")
required: Bug2.C#T
foo(3)(new D { })("hello")
^
one error found
```