diff options
author | Paul Phillips <paulp@improving.org> | 2011-10-03 01:28:04 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-10-03 01:28:04 +0000 |
commit | beadafa2d83a539dae8f969b9789f896346484ec (patch) | |
tree | 90c69a49397cdb59120d59307b843c54c8f68908 /test/files/neg/checksensible.check | |
parent | 55109d0d253c7e89660f1b61d17408648c0c53a4 (diff) | |
download | scala-beadafa2d83a539dae8f969b9789f896346484ec.tar.gz scala-beadafa2d83a539dae8f969b9789f896346484ec.tar.bz2 scala-beadafa2d83a539dae8f969b9789f896346484ec.zip |
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
<console>: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.
Diffstat (limited to 'test/files/neg/checksensible.check')
-rw-r--r-- | test/files/neg/checksensible.check | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/files/neg/checksensible.check b/test/files/neg/checksensible.check index 085e00af2e..c085aa2719 100644 --- a/test/files/neg/checksensible.check +++ b/test/files/neg/checksensible.check @@ -25,10 +25,10 @@ checksensible.scala:26: error: comparing values of types Unit and Int using `==' checksensible.scala:27: error: comparing values of types Int and Unit using `==' will always yield false 0 == (c = 1) ^ -checksensible.scala:29: error: comparing values of types Int and java.lang.String using `==' will always yield false +checksensible.scala:29: error: comparing values of types Int and String using `==' will always yield false 1 == "abc" ^ -checksensible.scala:32: error: java.lang.String and Int are unrelated: they will most likely never compare equal +checksensible.scala:32: error: String and Int are unrelated: they will most likely never compare equal "abc" == 1 // warns because the lub of String and Int is Any ^ checksensible.scala:33: error: Some[Int] and Int are unrelated: they will most likely never compare equal @@ -37,7 +37,7 @@ checksensible.scala:33: error: Some[Int] and Int are unrelated: they will most l checksensible.scala:35: error: comparing a fresh object using `==' will always yield false new AnyRef == 1 ^ -checksensible.scala:38: error: comparing values of types Int and java.lang.Boolean using `==' will always yield false +checksensible.scala:38: error: comparing values of types Int and Boolean using `==' will always yield false 1 == (new java.lang.Boolean(true)) ^ checksensible.scala:40: error: comparing values of types Int and Boolean using `!=' will always yield true @@ -88,7 +88,7 @@ checksensible.scala:76: error: comparing values of types EqEqRefTest.this.Z1 and checksensible.scala:77: error: comparing values of types EqEqRefTest.this.Z1 and EqEqRefTest.this.C3 using `!=' will always yield true z1 != c3 ^ -checksensible.scala:78: error: comparing values of types EqEqRefTest.this.C3 and java.lang.String using `!=' will always yield true +checksensible.scala:78: error: comparing values of types EqEqRefTest.this.C3 and String using `!=' will always yield true c3 != "abc" ^ checksensible.scala:89: error: comparing values of types Unit and Int using `!=' will always yield true |