diff options
author | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2013-01-17 09:45:50 -0800 |
---|---|---|
committer | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2013-01-17 09:45:50 -0800 |
commit | 1a63cf8b9b48c98fa754a1eb6dcfe35220016c74 (patch) | |
tree | 30d0d73fc920a2e8b966068c347559497d7edeb9 /test | |
parent | c3b4a39e68857ad6c8e20385121d0982f0400357 (diff) | |
parent | b07228aebe7aa620af45a681ef60d945ffc65665 (diff) | |
download | scala-1a63cf8b9b48c98fa754a1eb6dcfe35220016c74.tar.gz scala-1a63cf8b9b48c98fa754a1eb6dcfe35220016c74.tar.bz2 scala-1a63cf8b9b48c98fa754a1eb6dcfe35220016c74.zip |
Merge pull request #1914 from retronym/ticket/6601
SI-6601 Publicise derived value contstructor after pickler
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 |