diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-01-27 18:48:57 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-01-27 18:48:57 +0100 |
commit | 5a2828c149d3c82c215a34e8586639ffea12a903 (patch) | |
tree | 5b2275b8fb89e99fd6832c8ec7170435e857bc47 /test/files | |
parent | 172f3f68200a0bdc6c7f30547f269899cbbdcf98 (diff) | |
download | scala-5a2828c149d3c82c215a34e8586639ffea12a903.tar.gz scala-5a2828c149d3c82c215a34e8586639ffea12a903.tar.bz2 scala-5a2828c149d3c82c215a34e8586639ffea12a903.zip |
A test case to guide the eventual fix for SI-6601.
This demonstrates the need for the reversion in the
previous commit.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/pos/t6601/PrivateValueClass_1.scala | 1 | ||||
-rw-r--r-- | test/files/pos/t6601/UsePrivateValueClass_2.scala | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/test/files/pos/t6601/PrivateValueClass_1.scala b/test/files/pos/t6601/PrivateValueClass_1.scala new file mode 100644 index 0000000000..85c3687137 --- /dev/null +++ b/test/files/pos/t6601/PrivateValueClass_1.scala @@ -0,0 +1 @@ +class V private (val a: Any) extends AnyVal
\ No newline at end of file diff --git a/test/files/pos/t6601/UsePrivateValueClass_2.scala b/test/files/pos/t6601/UsePrivateValueClass_2.scala new file mode 100644 index 0000000000..461b8397b2 --- /dev/null +++ b/test/files/pos/t6601/UsePrivateValueClass_2.scala @@ -0,0 +1,10 @@ +object Test { + // After the first attempt to make seprately compiled value + // classes respect the privacy of constructors, we got: + // + // exception when typing v.a().==(v.a())/class scala.reflect.internal.Trees$Apply + // constructor V in class V cannot be accessed in object Test in file test/files/pos/t6601/UsePrivateValueClass_2.scala + // scala.reflect.internal.Types$TypeError: constructor V in class V cannot be accessed in object Test + def foo(v: V) = v.a == v.a + def bar(v: V) = v == v +} |