diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/t1033.check | 4 | ||||
-rw-r--r-- | test/files/neg/t1033.scala | 13 | ||||
-rwxr-xr-x | test/pending/pos/sig/sigs.java | 5 | ||||
-rwxr-xr-x | test/pending/pos/sig/sigs.scala | 6 |
4 files changed, 25 insertions, 3 deletions
diff --git a/test/files/neg/t1033.check b/test/files/neg/t1033.check new file mode 100644 index 0000000000..16e799264b --- /dev/null +++ b/test/files/neg/t1033.check @@ -0,0 +1,4 @@ +t1033.scala:5: error: return outside method definition + return 10 + ^ +one error found diff --git a/test/files/neg/t1033.scala b/test/files/neg/t1033.scala new file mode 100644 index 0000000000..3aed8bb11a --- /dev/null +++ b/test/files/neg/t1033.scala @@ -0,0 +1,13 @@ +object A { + def f :Int = { + class B { + println("B") + return 10 + } + new B + 20 + } + def main(args: Array[String]) { + f + } +} diff --git a/test/pending/pos/sig/sigs.java b/test/pending/pos/sig/sigs.java index 0fc0c7008f..ddf8ec45b0 100755 --- a/test/pending/pos/sig/sigs.java +++ b/test/pending/pos/sig/sigs.java @@ -1,5 +1,6 @@ package test; class Test extends T { - Object y = bar("abc"); + Inner i = new Inner(); String x = foo("abc"); -}
\ No newline at end of file + String y = i.bar("abc"); +} diff --git a/test/pending/pos/sig/sigs.scala b/test/pending/pos/sig/sigs.scala index 4579f225d9..72a293d0e6 100755 --- a/test/pending/pos/sig/sigs.scala +++ b/test/pending/pos/sig/sigs.scala @@ -1,6 +1,10 @@ package test class T { - def foo[T](x: T): T = x + def foo[T <: String](x: T): T = x def bar[T](x: T): T = x + class Inner { + def foo[T](x: T): T = x + def bar[T](x: T): T = x + } } |