From 35316be5a89b2c9622e92594245aaf72a3820c88 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Tue, 21 Aug 2012 07:40:28 +0200 Subject: Better errors for Any/AnyRef issues. When an error occurs because some type does not conform to AnyRef (and an AnyRef-derived type would have sufficed) try to say something useful about the situation. This commit also initializes scope members before printing error messages because the + version seems more useful than the - version (taken from one of the checkfile diffs.) - def : - def methodIntIntInt: + def (): X + def methodIntIntInt(x: scala.Int,y: scala.Int): scala.Int --- test/files/neg/t900.check | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/files/neg/t900.check') diff --git a/test/files/neg/t900.check b/test/files/neg/t900.check index ff5304a135..6fe26a31ac 100644 --- a/test/files/neg/t900.check +++ b/test/files/neg/t900.check @@ -1,6 +1,9 @@ t900.scala:4: error: type mismatch; found : Foo.this.x.type (with underlying type Foo.this.bar) required: AnyRef +Note that bar is unbounded, which means AnyRef is not a known parent. +Such types can participate in value classes, but instances +cannot appear in singleton types or in reference comparisons. def break(): x.type ^ one error found -- cgit v1.2.3