diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2015-04-04 01:15:30 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-05-01 13:27:42 +0200 |
commit | 06e1905aed315d5199936797c9e9493326b74595 (patch) | |
tree | db50094702d250935ecbafd465542d4c11adc5d5 /tests/pos/valueclasses/t6601 | |
parent | 411d5be477cc862b14d8938c591524d8bf37d4cd (diff) | |
download | dotty-06e1905aed315d5199936797c9e9493326b74595.tar.gz dotty-06e1905aed315d5199936797c9e9493326b74595.tar.bz2 dotty-06e1905aed315d5199936797c9e9493326b74595.zip |
Enable untried pos tests related to value classes
Each test needs to have its own package because pos_all will try to
compile the whole valueclasses directory at once.
Diffstat (limited to 'tests/pos/valueclasses/t6601')
-rw-r--r-- | tests/pos/valueclasses/t6601/PrivateValueClass_1.scala | 3 | ||||
-rw-r--r-- | tests/pos/valueclasses/t6601/UsePrivateValueClass_2.scala | 12 |
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/pos/valueclasses/t6601/PrivateValueClass_1.scala b/tests/pos/valueclasses/t6601/PrivateValueClass_1.scala new file mode 100644 index 000000000..fc6f3e422 --- /dev/null +++ b/tests/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/valueclasses/t6601/UsePrivateValueClass_2.scala b/tests/pos/valueclasses/t6601/UsePrivateValueClass_2.scala new file mode 100644 index 000000000..acd0dbef9 --- /dev/null +++ b/tests/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 +} |