From 7f9c2636cf560b066783e0745a08393ce17531cd Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Mon, 6 Feb 2012 13:11:30 -0800 Subject: Removing unnecessary AnyVal code. ...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) :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 .(:9) at .() at .(:11) --- test/files/neg/anyval-anyref-parent.check | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'test/files/neg/anyval-anyref-parent.check') diff --git a/test/files/neg/anyval-anyref-parent.check b/test/files/neg/anyval-anyref-parent.check index b40a0f2710..be895867ff 100644 --- a/test/files/neg/anyval-anyref-parent.check +++ b/test/files/neg/anyval-anyref-parent.check @@ -1,4 +1,14 @@ anyval-anyref-parent.scala:5: error: Any does not have a constructor class Bar1 extends Any // fail ^ -one error found +anyval-anyref-parent.scala:9: error: illegal inheritance; superclass Any + is not a subclass of the superclass Object + of the mixin trait Immutable +trait Foo4 extends Any with Immutable // fail + ^ +anyval-anyref-parent.scala:10: error: illegal inheritance; superclass AnyVal + is not a subclass of the superclass Object + of the mixin trait Immutable +trait Foo5 extends AnyVal with Immutable // fail + ^ +three errors found -- cgit v1.2.3