summaryrefslogtreecommitdiff
path: root/test/files/neg/anyval-anyref-parent.scala
Commit message (Collapse)AuthorAgeFilesLines
* All steps of value class proposal implemented. Most restrictions are now ↵Martin Odersky2012-02-131-3/+4
| | | | enforced. Super calls and specialized still missing.
* Removing unnecessary AnyVal code.Paul Phillips2012-02-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | ...since it works from source. The parser must be forcibly restrained from adding a bogus constructor, but other than that it's pretty much smooth sailing. To give an idea how smooth, if I change scala.Short like so: trait Bippy extends Any final class Short extends AnyVal with Bippy Then it just works, at least until the fiction is revealed. scala> def f(x: Bippy) = x f: (x: Bippy)Bippy scala> f(5) <console>:9: error: type mismatch; found : Int(5) required: Bippy f(5) ^ scala> f(5: Short) java.lang.ClassCastException: java.lang.Short cannot be cast to scala.Bippy at .<init>(<console>:9) at .<clinit>(<console>) at .<init>(<console>:11)
* Making AnyVal into a class instead of a trait.Paul Phillips2012-02-041-0/+7
-- traits can extend Any, AnyRef, or AnyVal -- classes can extend AnyRef or AnyVal but not Any. This breaks reflection for the moment as it smuggles AnyVal so far downstream that it's reflecting its way into bytecode (or something) but the following test case goes five for six as anticipated. trait Foo1 extends Any trait Foo2 extends AnyVal trait Foo3 extends AnyRef class Bar1 extends Any // fail @inline class Bar2 extends AnyVal class Bar3 extends AnyRef Eliminated various hijinx from definitions.