summaryrefslogtreecommitdiff
path: root/test/files/jvm/interpreter.check
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-10-03 01:28:04 +0000
committerPaul Phillips <paulp@improving.org>2011-10-03 01:28:04 +0000
commitbeadafa2d83a539dae8f969b9789f896346484ec (patch)
tree90c69a49397cdb59120d59307b843c54c8f68908 /test/files/jvm/interpreter.check
parent55109d0d253c7e89660f1b61d17408648c0c53a4 (diff)
downloadscala-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/jvm/interpreter.check')
-rw-r--r--test/files/jvm/interpreter.check11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/files/jvm/interpreter.check b/test/files/jvm/interpreter.check
index 42a8ae8855..607e2bcaff 100644
--- a/test/files/jvm/interpreter.check
+++ b/test/files/jvm/interpreter.check
@@ -35,8 +35,9 @@ four: anotherint = 4
scala> val bogus: anotherint = "hello"
<console>:8: error: type mismatch;
- found : java.lang.String("hello")
+ found : String("hello")
required: anotherint
+ (which expands to) Int
val bogus: anotherint = "hello"
^
@@ -73,7 +74,7 @@ fish: S = fish
scala> // Test that arrays pretty print nicely.
scala> val arr = Array("What's", "up", "doc?")
-arr: Array[java.lang.String] = Array(What's, up, doc?)
+arr: Array[String] = Array(What's, up, doc?)
scala> // Test that arrays pretty print nicely, even when we give them type Any
@@ -263,7 +264,7 @@ scala> xs filter (_ == 2)
res4: Array[_] = Array(2)
scala> xs map (_ => "abc")
-res5: Array[java.lang.String] = Array(abc, abc)
+res5: Array[String] = Array(abc, abc)
scala> xs map (x => x)
res6: scala.collection.mutable.ArraySeq[_] = ArraySeq(1, 2)
@@ -322,7 +323,7 @@ scala> """
hello
there
"""
-res9: java.lang.String =
+res9: String =
"
hello
there
@@ -368,7 +369,7 @@ scala>
scala>
plusOne: (x: Int)Int
res0: Int = 6
-res1: java.lang.String = after reset
+res1: String = after reset
<console>:8: error: not found: value plusOne
plusOne(5) // should be undefined now
^