From beadafa2d83a539dae8f969b9789f896346484ec Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Mon, 3 Oct 2011 01:28:04 +0000 Subject: Selective dealiasing when printing errors. *** Important note for busy commit log skimmers *** Symbol method "fullName" has been trying to serve the dual role of "how to print a symbol" and "how to find a class file." It cannot serve both these roles simultaneously, primarily because of package objects but other little things as well. Since in the majority of situations we want the one which corresponds to the idealized scala world, not the grubby bytecode, I went with that for fullName. When you require the path to a class (e.g. you are calling Class.forName) you should use javaClassName. package foo { package object bar { class Bippy } } If sym is Bippy's symbol, then sym.fullName == foo.bar.Bippy sym.javaClassName == foo.bar.package.Bippy *** End important note *** There are many situations where we (until now) forewent revealing everything we knew about a type mismatch. For instance, this isn't very helpful of scalac (at least in those more common cases where you didn't define type X on the previous repl line.) scala> type X = Int defined type alias X scala> def f(x: X): Byte = x :8: error: type mismatch; found : X required: Byte def f(x: X): Byte = x ^ Now it says: found : X (which expands to) Int required: Byte def f(x: X): Byte = x ^ In addition I rearchitected a number of methods involving: - finding a symbol's owner - calculating a symbol's name - determining whether to print a prefix No review. --- test/files/neg/t2386.check | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/files/neg/t2386.check') diff --git a/test/files/neg/t2386.check b/test/files/neg/t2386.check index 2caa46c731..1a01696a9a 100644 --- a/test/files/neg/t2386.check +++ b/test/files/neg/t2386.check @@ -1,4 +1,4 @@ -t2386.scala:2: error: could not find implicit value for evidence parameter of type scala.reflect.ClassManifest[Array[_ >: java.lang.String with Int]] +t2386.scala:2: error: could not find implicit value for evidence parameter of type scala.reflect.ClassManifest[Array[_ >: String with Int]] val a = Array(Array(1, 2), Array("a","b")) ^ one error found -- cgit v1.2.3