diff options
Diffstat (limited to 'test/pending/run/t2318.scala')
-rw-r--r-- | test/pending/run/t2318.scala | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/test/pending/run/t2318.scala b/test/pending/run/t2318.scala deleted file mode 100644 index e42cbb9680..0000000000 --- a/test/pending/run/t2318.scala +++ /dev/null @@ -1,38 +0,0 @@ -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 t1() = { - val p = Runtime.getRuntime().exec("ls"); - type Destroyable = { def destroy() : Unit } - def doDestroy( obj : Destroyable ) : Unit = obj.destroy(); - doDestroy( p ); - } - def t2() = { - 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 t1() - catch { case _: java.io.IOException => () } - - t2() - } -} |