scala/scala — pull request #1849 by som-snytt (2013-01-05 22:34:18+00:00)
Title: Repl javap decodes various synthetic names for us (fixing SI-6894)

Preface: this needs tests, probably of the form, count the classes in output to ensure correct selection.

Also, Foo#m filtering is easy to do; since -fun Foo#m is handled by this commit, maybe the less specific feature can get squashed in here, too.

Feedback on feature and impl will be gratefully incorporated.

I need this commit to work on implicits in for exprs, what a hassle to javap the anonfuns.
----
For instance, javap -app Test is equivalent to javap Test$delayedInit$App
with the correct line and iw prepended. This works by taking Test as a
name in scope, translating that, and then supplying the suffix.

Then javap -fun Test shows Test$$anonfun*, and for def m,
javap -fun m shows Test$$anonfun$$m*.

E.g., javap -fun scala.Enumeration obviates knowing or guessing
scala/Enumeration$$anonfun$scala$Enumeration$$populateNameMap$1.class.

Also, scala> :javap -fun scala.Array#concat
but still to do is using imported syms.

Both files and replout are supported for searching for artifacts.

The trigger is detecting the synthetic name (has an interior dollar).

Still to do, filter the output on Test#m to show only m.

Need a way to explore the list of artifacts; ideally, related symbols
would be available reflectively.

Prefer companion class to object, otherwise it's not showable;
for object, require dollar when both exist.

Review and invaluable feedback by @paulp