| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
*** 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some more work on options related to showing compiler structures during
compilation. The pickler knew more than was healthy about things like
compiler settings, so I let the pickler worry about pickling and moved
that logic somewhere closer to the surface. Some convenience oriented
tweaks to command line phase parsing. The end result is as follows (some
output trimmed for brevity.)
// dippy.scala
class Dippy {
def f[T <: Dippy](x: T) = (x, x)
object DingusDippy extends util.Random { }
}
// className@phaseString should be reliably unambiguous
% scalac -Xshow-class Dippy@typer,erasure,jvm dippy.scala
<<-- class Dippy after phase 'typer' -->>
Members (excluding Any/AnyRef unless overridden):
final object DingusDippy extends object Dippy.this.DingusDippy
def f[T <: Dippy](x: T): (T, T)
<<-- class Dippy after phase 'erasure' -->>
Members (excluding Any/AnyRef unless overridden):
private lazy var DingusDippy$module: object Dippy#DingusDippy
lazy val DingusDippy(): object Dippy#DingusDippy
def f(x: Dippy): Tuple2
<<-- class Dippy after phase 'jvm' -->>
Members (excluding Any/AnyRef unless overridden):
protected var bitmap$0: Int
private lazy var DingusDippy$module: object Dippy$DingusDippy
lazy val DingusDippy(): object Dippy$DingusDippy
def f(x: Dippy): Tuple2
No review.
|
|
A bit of -Xshow-class / -Xshow-object which didn't quite make the Global
patch. Now type selections should do the right thing, e.g.
scalac -Xshow-class Global#Run
src/compiler/scala/tools/nsc/Global.scala
will show you interesting things about Run. Or see the test case for
even more thrills. No review.
|