aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/pos_valueclasses/t6601
diff options
context:
space:
mode:
authorMartijn Hoekstra <Martijn Hoekstra>2016-09-03 12:10:53 +0200
committerMartijn Hoekstra <Martijn Hoekstra>2016-09-07 22:32:51 +0200
commit32819e2edc88dd06095704c04ed9c2dd0603386f (patch)
tree5ac33b7a4fc11fe5b13aeae26e963e5553e97fad /tests/pos/pos_valueclasses/t6601
parent6bce106fea7ce10eefc864a6e7c1351675065880 (diff)
downloaddotty-32819e2edc88dd06095704c04ed9c2dd0603386f.tar.gz
dotty-32819e2edc88dd06095704c04ed9c2dd0603386f.tar.bz2
dotty-32819e2edc88dd06095704c04ed9c2dd0603386f.zip
honor -encoding compiler flag and defaults
rename test/pos/valueclasses to pos_valueclasses tests/pos/valueclasses generates a valueclasses.flags file in /tests/partest-generated/pos that conflicts with the valueClasses.flags file that tests/neg/valueClasses.scala tries to create
Diffstat (limited to 'tests/pos/pos_valueclasses/t6601')
-rw-r--r--tests/pos/pos_valueclasses/t6601/PrivateValueClass_1.scala3
-rw-r--r--tests/pos/pos_valueclasses/t6601/UsePrivateValueClass_2.scala12
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/pos/pos_valueclasses/t6601/PrivateValueClass_1.scala b/tests/pos/pos_valueclasses/t6601/PrivateValueClass_1.scala
new file mode 100644
index 000000000..fc6f3e422
--- /dev/null
+++ b/tests/pos/pos_valueclasses/t6601/PrivateValueClass_1.scala
@@ -0,0 +1,3 @@
+package t6601
+
+class V private (val a: Any) extends AnyVal
diff --git a/tests/pos/pos_valueclasses/t6601/UsePrivateValueClass_2.scala b/tests/pos/pos_valueclasses/t6601/UsePrivateValueClass_2.scala
new file mode 100644
index 000000000..acd0dbef9
--- /dev/null
+++ b/tests/pos/pos_valueclasses/t6601/UsePrivateValueClass_2.scala
@@ -0,0 +1,12 @@
+package t6601
+
+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
+}