aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/typers.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pos/typers.scala')
-rw-r--r--tests/pos/typers.scala33
1 files changed, 32 insertions, 1 deletions
diff --git a/tests/pos/typers.scala b/tests/pos/typers.scala
index 3fcd1ff29..51692e026 100644
--- a/tests/pos/typers.scala
+++ b/tests/pos/typers.scala
@@ -1,5 +1,5 @@
object typers {
-
+
class List[+T] {
def :: (x: T) = new :: (x, this)
@@ -17,5 +17,36 @@ object typers {
case x :: xs1 => 1 + len(xs1)
case Nil => 0
}
+
+ object returns {
+
+ def foo(x: Int): Int = {
+ return 3
+ }
+ }
+
+ object tries {
+
+ val x = try {
+ "abc"
+ } catch {
+ case ex: java.io.IOException =>
+ 123
+ } finally {
+ println("done")
+ }
+
+ val y = try 2 catch Predef.identity
+
+ val z = try 3 finally "abc"
+
+ }
+
+ class C {
+
+ }
+ class Refinements {
+ val y: C { type T; val key: T; def process(x: T): Int }
+ }
} \ No newline at end of file