diff options
Diffstat (limited to 'test/files/pos')
-rw-r--r-- | test/files/pos/t3240.scala | 8 | ||||
-rw-r--r-- | test/files/pos/t845.scala | 16 |
2 files changed, 24 insertions, 0 deletions
diff --git a/test/files/pos/t3240.scala b/test/files/pos/t3240.scala new file mode 100644 index 0000000000..cf197a406d --- /dev/null +++ b/test/files/pos/t3240.scala @@ -0,0 +1,8 @@ +class A { + val foo = new { + type t + def apply(a: Option[t], defVal: Any) = { + a.getOrElse(defVal).asInstanceOf[t] + } + } +}
\ No newline at end of file diff --git a/test/files/pos/t845.scala b/test/files/pos/t845.scala new file mode 100644 index 0000000000..ddf6a16f32 --- /dev/null +++ b/test/files/pos/t845.scala @@ -0,0 +1,16 @@ +package test; + +object Test extends App { + type Bar; + trait FooImpl; + + trait Bob { + def bar : Bar with FooImpl; + } + def ifn[A,B](a : A)(f : A => B) = + if (a != null) f(a) else null; + + val bob : Bob = null; + val bar = ifn(bob)(_.bar); + assert(bar == null); +} |