diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-01-16 23:05:12 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-01-16 23:09:35 +0100 |
commit | b07228aebe7aa620af45a681ef60d945ffc65665 (patch) | |
tree | 69553ab71c9c7b348ebe5c0ca342a99eb9d6f7b6 /test | |
parent | 766bb97114b5932b75340a9169558de61899997e (diff) | |
download | scala-b07228aebe7aa620af45a681ef60d945ffc65665.tar.gz scala-b07228aebe7aa620af45a681ef60d945ffc65665.tar.bz2 scala-b07228aebe7aa620af45a681ef60d945ffc65665.zip |
SI-6601 Publicise derived value contstructor after pickler
Otherwise the access restrictions are not enforced under
separate compilation.
See also SI-6608.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/t6601.check | 4 | ||||
-rw-r--r-- | test/files/neg/t6601/AccessPrivateConstructor_2.scala | 3 | ||||
-rw-r--r-- | test/files/neg/t6601/PrivateConstructor_1.scala | 1 |
3 files changed, 8 insertions, 0 deletions
diff --git a/test/files/neg/t6601.check b/test/files/neg/t6601.check new file mode 100644 index 0000000000..1410e1b11a --- /dev/null +++ b/test/files/neg/t6601.check @@ -0,0 +1,4 @@ +AccessPrivateConstructor_2.scala:2: error: constructor PrivateConstructor in class PrivateConstructor cannot be accessed in class AccessPrivateConstructor + new PrivateConstructor("") // Scalac should forbid accessing to the private constructor! + ^ +one error found diff --git a/test/files/neg/t6601/AccessPrivateConstructor_2.scala b/test/files/neg/t6601/AccessPrivateConstructor_2.scala new file mode 100644 index 0000000000..816bc10d79 --- /dev/null +++ b/test/files/neg/t6601/AccessPrivateConstructor_2.scala @@ -0,0 +1,3 @@ +class AccessPrivateConstructor { + new PrivateConstructor("") // Scalac should forbid accessing to the private constructor! +} diff --git a/test/files/neg/t6601/PrivateConstructor_1.scala b/test/files/neg/t6601/PrivateConstructor_1.scala new file mode 100644 index 0000000000..f09d7ad068 --- /dev/null +++ b/test/files/neg/t6601/PrivateConstructor_1.scala @@ -0,0 +1 @@ +class PrivateConstructor private(val s: String) extends AnyVal |