diff options
Diffstat (limited to 'test/files/pos')
-rw-r--r-- | test/files/pos/bug1071.scala | 17 | ||||
-rw-r--r-- | test/files/pos/bug4275.scala | 13 |
2 files changed, 30 insertions, 0 deletions
diff --git a/test/files/pos/bug1071.scala b/test/files/pos/bug1071.scala new file mode 100644 index 0000000000..59149a021b --- /dev/null +++ b/test/files/pos/bug1071.scala @@ -0,0 +1,17 @@ +class C { + private val a = 0 + def getA = a +} + +class D(c: C) { + def a = c.getA +} + +object Test { + implicit def c2d(c: C): D = new D(c) + + val c = new C + (c: D).a // works + c.a // error +} + diff --git a/test/files/pos/bug4275.scala b/test/files/pos/bug4275.scala new file mode 100644 index 0000000000..1938aceadc --- /dev/null +++ b/test/files/pos/bug4275.scala @@ -0,0 +1,13 @@ +object Test { + def f = "abc".count(_ > 'a') + + class A { + private val count: Int = 0 + } + class B extends A { } + object B { + implicit def b2seq(x: B): Seq[Int] = Nil + + def f = (new B) count (_ > 0) + } +} |