diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/neg/typers.scala | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/neg/typers.scala b/tests/neg/typers.scala new file mode 100644 index 000000000..a8e008373 --- /dev/null +++ b/tests/neg/typers.scala @@ -0,0 +1,41 @@ +object typers { + + class C { + val x: Int + val x: String + val y: Int + def y: String + val z: Int + def z(): String + + def f(x: Any) = () + def f(x: AnyRef): AnyRef + + def g(x: Object): Unit + def g[T](x: T): T = x + } + + + object returns { + + def foo(x: Int) = { + return 3 + } + + return 4 + } + + object tries { + + val x = try { + "abc" + } catch { + case ex: String => // does not work yet. We should detect that the test is non-sensical, but don't. + 123 + } + } + + class Refinements { + val y: C { val x: T; type T } + } +}
\ No newline at end of file |