summaryrefslogtreecommitdiff
path: root/test/pending
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-12-01 10:26:52 +0000
committerPaul Phillips <paulp@improving.org>2010-12-01 10:26:52 +0000
commit4ff54d04484a391b6f9602c06f21b820ecfaf37d (patch)
treec46b452aa5e09fbc32a8ddca7b63f8136bfc2962 /test/pending
parent46fba575f7f5bfbcbf4860deb297ec83cf99d9d0 (diff)
downloadscala-4ff54d04484a391b6f9602c06f21b820ecfaf37d.tar.gz
scala-4ff54d04484a391b6f9602c06f21b820ecfaf37d.tar.bz2
scala-4ff54d04484a391b6f9602c06f21b820ecfaf37d.zip
Disabled test after failing to read linux's mind.
Diffstat (limited to 'test/pending')
-rw-r--r--test/pending/run/bug2318.check2
-rw-r--r--test/pending/run/bug2318.scala38
2 files changed, 40 insertions, 0 deletions
diff --git a/test/pending/run/bug2318.check b/test/pending/run/bug2318.check
new file mode 100644
index 0000000000..a486f1ac47
--- /dev/null
+++ b/test/pending/run/bug2318.check
@@ -0,0 +1,2 @@
+bar
+bar
diff --git a/test/pending/run/bug2318.scala b/test/pending/run/bug2318.scala
new file mode 100644
index 0000000000..cb524471d6
--- /dev/null
+++ b/test/pending/run/bug2318.scala
@@ -0,0 +1,38 @@
+import java.security._
+
+object Test {
+ trait Bar { def bar: Unit }
+
+ object Mgr extends SecurityManager {
+ override def checkPermission(perm: Permission) = perm match {
+ case _: java.lang.RuntimePermission => ()
+ case _: java.io.FilePermission => ()
+ case x: java.security.AccessControlException if x.getName contains ".networkaddress." => () // generality ftw
+ case _ => super.checkPermission(perm)
+ }
+ }
+
+ def bug1() = {
+ val p = Runtime.getRuntime().exec("ls");
+ type Destroyable = { def destroy() : Unit }
+ def doDestroy( obj : Destroyable ) : Unit = obj.destroy();
+ doDestroy( p );
+ }
+ def bug2() = {
+ System.setSecurityManager(Mgr)
+
+ val b = new Bar { def bar = println("bar") }
+ b.bar
+
+ val structural = b.asInstanceOf[{ def bar: Unit }]
+ structural.bar
+ }
+
+ def main(args: Array[String]) {
+ // figuring this will otherwise break on windows
+ try bug1()
+ catch { case _: java.io.IOException => () }
+
+ bug2()
+ }
+}