diff options
Diffstat (limited to 'test/files/neg/sensitive.scala')
-rw-r--r-- | test/files/neg/sensitive.scala | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/files/neg/sensitive.scala b/test/files/neg/sensitive.scala new file mode 100644 index 0000000000..f435a385e1 --- /dev/null +++ b/test/files/neg/sensitive.scala @@ -0,0 +1,19 @@ +class Certificate{} + +object Admin extends Certificate; + +class SecurityViolationException extends Exception + +object Sensitive { + def makeSensitive(credentials: Certificate): Sensitive = + if (credentials == Admin) new Sensitive() + else throw new SecurityViolationException +} +class Sensitive private () { +} + +object Attacker { + val x = Sensitive.makeSensitive(null) + val y = new Sensitive() +} + |