summaryrefslogtreecommitdiff
path: root/test/files/neg/valueclasses.check
Commit message (Collapse)AuthorAgeFilesLines
* SI-7859 Value classes may wrap a non-public memberJason Zaugg2013-09-291-20/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We allow value class constructors to be non-public, so to be regular, we should also allow the same for the param accessor. This commit uses the 'makeNotPrivate' machinery to ensure that the backend can generate the requisite unboxing calls. This commit: - refactors the code that enforced the restrictions, improving a few error messages and positions. The remaining restrictions needed some rewording in light of this change. - allows value classes to have non-public, val parameters. private[this] / protected[this] are still disallowed as value classes don't have a concept of `this`, and because trying to accomdate then would complicate the implementation. This means that `class C(x: Int) extends AnyVal` is not allowed, the user still must write `private val x: Int` or `val x: Int`. - Outlaw `class C()()(val x: Int) extends AnyVal` to curtail any bugs that might lurk in such a formulation. The tests: - Show that the privacy is respected in the typer phase, under joint and separate compilation. We don't want a repeat performance of SI-6601. - Show that code that needs compiler-generated unboxes works under both compilation scenarios - Checks that the remaining restrictions are enforced and well communicated.
* Revised restrictions for value classes and unversal traitsMartin Odersky2012-10-031-2/+2
| | | | | | | | | and brought compiler in line with them. One thing we can accept IMO are nested classes (nested objects are still a problem). In fact, it makes no sense to exclude nested classes from value classes but not from universal traits. A class nested in universal trait will becomes a class nested in a value class by inheritance. Note that the reflection library already contains a universal trait with a nested class (IndexedSeqLike), so we should accept them if we can.
* Fixed test cases.Martin Odersky2012-03-211-4/+1
|
* Fixes to value classes: Flags now double definitions, private constructors ↵Martin Odersky2012-03-061-14/+17
| | | | as errors. Fixed erasure scheme.
* Compiler now ready to accept value classes in standard library. Time for a ↵Martin Odersky2012-02-221-4/+1
| | | | new STARR!
* Implemented super access in value classes, restrictions for value classes.Martin Odersky2012-02-191-0/+46