| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
The source file itself will be removed later,
because the compiler seems to need it for boot-strapping.
|
|\
| |
| | |
Fixes and features for javap (fixing SI-6894)
|
| |
| |
| |
| | |
Knock on wood.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Output filtering is refactored for javap6.
That means javap6 also supports -raw.
Handling of # is: Foo#foo filter on foo,
Foo# filter on apply, -fun Foo#foo for anonfuns of foo,
-fun Foo# anonfuns filtering on apply.
One is loath to add command options, so it's not possible
to ask for "only apply methods in anonfuns pertaining to
a method." Hypothetical syntax to say "show me the
apply only": -fun Foo#foo(), for future reference.
|
|\ \
| | |
| | | |
SI-6955 switch emission no longer foiled by type alias
|
| |/
| |
| |
| |
| |
| |
| | |
dealiasWiden the type of the scrutinee before checking it's switchable
now with tests! (using IcodeTest since javap is not available everywhere)
rebase of #1879
|
| |
| |
| |
| | |
For not passing on java6.
|
| |\
| | |
| | | |
Repl javap decodes various synthetic names for us (fixing SI-6894)
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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 member m,
javap -fun Test#m shows Test$$anonfun$$m*.
This also works for classes and values defined in the repl.
javap -fun -raw m shows $line3.$read$$iw$$iw$$anonfun$m$1.
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.
A JavapTest is supplied that is a ReplTest that asserts something about
its output instead of printing it.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Previously delayed macro expansions (the sole purpose of macroExpandAll)
were triggered by `typedArgs`. Probably I wanted to save CPU cycles on
not checking whether we have pending macro expansions on every iteration
of typecheck.
However this optimization is uncalled for, because the check just entails
reading a var, therefore benefits of the current approach are negliible,
whereas the robustness hit is tangible.
After delayed macro expansion mechanism became more robust, it exposed
a bug, well-hidden before. If one first delays a macro and then finds out
that the expandee is erroneous, subsequent `macroExpandAll` will crash,
because it expects a macro runtime attachment to be present. Previously
the erroneous code path never got triggered, because the macro expansion
never commenced. Luckily the fix was easy.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Macros now have a dedicated member handler, so that the logic of their
processing doesn't get mixed up with vanilla DefHandler.
I've also factored out an abstract MacroHandler to provides a basis
to build the upcoming type macro handler upon.
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| | |
Apparently it is already possible to use macros to customize pattern
matching as described in the comments to the aforementioned JIRA issue.
What's even better - with the incoming addition of c.introduceTopLevel
it becomes possible to generate arbitrarily complex unappliers, even
with heterogeneous types of arguments varying from expansion to expansion
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Patches applied:
- rename of `dropRepeatedParamType` to `dropIllegalStarTypes` -- required since 8886d22cd6
- fixed test/files/neg/t6406-regextract.flags -- how could this have worked before?
Conflicts:
src/compiler/scala/tools/nsc/interpreter/TypeStrings.scala
src/library/scala/collection/LinearSeqOptimized.scala
src/library/scala/util/Properties.scala
test/files/run/streams.check
test/files/run/streams.scala
|
| |\ \
| | | |
| | | | |
SI-6911, regression in generated case class equality.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Caught out by the different semantics of isInstanceOf and
pattern matching.
trait K { case class CC(name: String) }
object Foo extends K
object Bar extends K
Foo.CC("a") == Bar.CC("a")
That expression is supposed to be false, and with this
commit it is once again.
|
| |\ \ \
| | | | |
| | | | | |
Fix Iterator#copyToArray (fixes SI-6827).
|
| | |/ /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
As pointed out in #scala, when using a non-zero start it's possible
to get an ArrayIndexOutOfBoundsException due to an incorrect bounds
check. This patch fixes this, as well as another potential bounds
error, and adds test cases.
Incorporates some other suggestions by Som-Snytt to ensure that
callers will get useful error messages in cases where the start
parameter is wrong (negative or out-of-array-bounds).
Review by @som-snytt.
|
| |\ \ \
| | |/ /
| |/| | |
SI-5017 Poor performance of :+ operator on Arrays
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Control performance of :+ and +: operator on my machine were 700-800 ms
After adding size hint on the implementation in SeqLike, it went down to 500-600 ms
But with specialixed implementation in ArrayOps, brings it down to 300-400 ms
Unfortunatly, this method will only be called when the Array object is being referenced directly as it's type, but that should be the case enough times to justify the extra method.
I ended up removing the sizeHint in SeqLike because it made the execution of the "benchmark" slower when the Array was being manipulated as a Seq.
Side note: Interestingly enough, the benchmark performed better on my virtualized Fedora 17 with JDK 7 than natively on Mac OS X with JDK 6
|
| |\ \ \
| | | | |
| | | | | |
SI-6194, repl crash.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Always a bad idea to use replaceAll on unknown strings,
as we saw here when windows classpaths arrived containing
escape-requiring backslashes.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Had to fix up an iffy test: not only was it testing undefined
behavior, it demanded just the right numbers be printed in a
context where all negative or positive numbers are equivalent.
It's the ol' "get them coming and going" trick.
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The lengthCompare method in LinearSeqOptimized was looking one
step further than it needed to in order to give the correct
result, which was creating some unwanted side effects related to
Streams.
|
|\ \ \ \
| | | | |
| | | | | |
adds c.introduceTopLevel
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The first in the family of mutators for the global symbol table,
`introduceTopLevel` is capable of creating synthetic top-level
classes and modules.
The addition of nme.EMPTY_PACKAGE_NAME is necessary to let
programmers insert definitions into the empty package. That's explicitly
discouraged in the docs, but at times might come in handy.
This patch introduce workarounds to avoid incompatibilities with SBT.
First of all SBT doesn't like VirtualFiles having JFile set to null.
Secondly SBT gets confused when someone depends on synthetic files
added by c.introduceTopLevel.
Strictly speaking these problems require changes to SBT, and that will be
done later. However the main target of the patch is paradise/macros,
which needs to be useful immediately, therefore we apply workarounds.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-6916 makes FlatHashTable#remove a Boolean not Option[A]
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Makes FlatHashTable#remove return a boolean instead of Option[A].
Updates HashSet accordingly. Adds a test to make sure remove
works as advertised.
|
|/ / / / / |
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
SI-6908 Makes FlatHashTable as well as derived classes support nulls
|
| | |_|/
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | | |
This change adds a null sentinel object which is used to indicate that a null
value has been inserted in FlatHashTable. It also makes a strong distinction
between logical elements of the Set vs entries in the hash table. Changes
are made to mutable.HashSet and ParHashSet accordingly.
|
|\ \ \ \
| |/ / /
|/| | | |
Fix Iterator#copyToArray (fixes SI-6827).
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
As pointed out in #scala, when using a non-zero start it's possible
to get an ArrayIndexOutOfBoundsException due to an incorrect bounds
check. This patch fixes this, as well as another potential bounds
error, and adds test cases.
Incorporates some other suggestions by Som-Snytt to ensure that
callers will get useful error messages in cases where the start
parameter is wrong (negative or out-of-array-bounds).
Review by @som-snytt.
|
|\ \ \ \
| | | | |
| | | | | |
enclosures are now strongly typed and are no longer vals
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
macro expansions are now auto-duplicated
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The fix still requires macro developers to be careful about sharing trees
by references, because attributed DefTrees will still bring trouble.
However this is an improvement, because it doesn't make matters worse
and automatically fixes situations similar to one in the test.
A much more thorough discussion with a number of open questions left:
http://groups.google.com/group/scala-internals/browse_thread/thread/492560d941b315cc
|
|\ \ \ \ \
| | | | | |
| | | | | | |
adds extractors for TypeName, TermName and Modifiers
|
| | | | | | |
|
| |/ / / / |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
I determined that many if not most of the calls to .normalize
have no intent beyond dealiasing the type. In light of this I
went call site to call site knocking on doors and asking why
exactly they were calling any of
.normalize
.widen.normalize
.normalize.widen
and if I didn't like their answers they found themselves
introduced to 'dropAliasesAndSingleTypes', the recursive widener
and dealiaser which I concluded is necessary after all.
Discovered that the object called 'deAlias' actually depends
upon calling 'normalize', not 'dealias'. Decided this was
sufficient cause to rename it to 'normalizeAliases'.
Created dealiasWiden and dealiasWidenChain.
Dropped dropAliasesAndSingleTypes in favor of methods
on Type alongside dealias and widen (Type#dealiasWiden).
These should reduce the number of "hey, the type alias doesn't work" bugs.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Investigating the useful output of devWarning (-Xdev people,
it's good for you) led back to this comment:
"normalize to get rid of type aliases"
You may know that this is not all the normalizing does.
Normalizing also turns TypeRefs with unapplied arguments
(type constructors) into PolyTypes. That means that when
typedParentType would call typedTypeConstructor it would
find its parent had morphed into a PolyType. Not that it
noticed; it would blithely continue and unwittingly discard
the type arguments by way of appliedType (which smoothly
logged the incident, thank you appliedType.)
The simplification of typedTypeConstructor:
There was a whole complicated special treatment of AnyRef
here which appears to have become unnecessary. Removed special
treatment and lit a candle for regularity.
Updated lots of tests regarding newly not-so-special AnyRef.
|
|/ / / / |
|
|\ \ \ \
| | | | |
| | | | | |
PluginComponent contributes description to -Xshow-phases. (Fixes SI-6446)
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
In Global, SubComponent is called a phase descriptor, but it doesn't
actually have a description. (Phase itself does.) This fix adds
a description to PluginComponent so that plugins can describe what
they do in -Xshow-phases.
Elliptical descriptions
Exploded archives
Plugged-in partest
Roundup at the Little h!
|
|\ \ \ \
| | | | |
| | | | | |
SI-6809 Forbids deprecated case class definitions without parameter list
|
| | | | |
| | | | |
| | | | |
| | | | | |
This has been deprecated since at least 2.7.7, so it should be good to go.
|
|\ \ \ \ \
| | |_|/ /
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
* origin/2.10.x: (31 commits)
Implicit vars should have non-implicit setters.
Deprecate `scala.tools.nsc.Phases` because it's dead-code.
scaladoc Template: remove duplicate code and several usages of Option.get.
adds scala-reflect.jar to MIMA in ant
Test showing the absence of a forward reference
update mailmap
Remove dead code from `Global`.
Cleanup MemberLookup. Better explain ambiguous link targets.
typedIdent no longer destroys attachments
fixes incorrect handling of Annotated in lazy copier
simplifies checkBounds
Recurse into instantiations when stripping type vars.
Extract base scaladoc functionality for the IDE.
Expand pattern match position tests.
SI-6288 Remedy ill-positioned extractor binding.
SI-6288 Fix positioning of label jumps
SI-6288 Position argument of unapply
Fixes SI-6758: force LazyAnnnotationInfo for DefDef and TypeDef
SI-6795 Simplify errors related to "abstract override" on type members
SI-6795 Adds negative check for "abstract override" on types in traits
...
Conflicts:
.mailmap
src/compiler/scala/tools/nsc/Global.scala
src/compiler/scala/tools/nsc/ast/DocComments.scala
src/compiler/scala/tools/nsc/doc/base/CommentFactoryBase.scala
src/compiler/scala/tools/nsc/doc/html/page/Source.scala
src/compiler/scala/tools/nsc/doc/html/page/Template.scala
src/compiler/scala/tools/nsc/doc/model/LinkTo.scala
src/compiler/scala/tools/nsc/doc/model/MemberLookup.scala
src/compiler/scala/tools/nsc/doc/model/diagram/DiagramFactory.scala
src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
src/compiler/scala/tools/nsc/typechecker/Typers.scala
src/reflect/scala/reflect/runtime/JavaMirrors.scala
test/scaladoc/run/links.scala
|
| |\ \ \ \
| | |_|_|/
| |/| | | |
SI-6548 reflection now correctly enters jinners
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
When completing Java classes, runtime reflection enumerates their
fields, methods, constructors and inner classes, loads them and
enters them into either the instance part (ClassSymbol) or the
static part (ModuleSymbol).
However unlike fields, methods and constructors, inner classes don't
need to be entered explicitly - they are entered implicitly when
being loaded.
This patch fixes the double-enter problem, make sure that enter-on-load
uses the correct owner, and also hardens jclassAsScala against double
enters that can occur in a different scenario.
Since the fix is about Java-compiled classes, the test needs *.class
artifacts produced by javac. Therefore I updated javac-artifacts.jar to
include the new artifacts along with their source code.
|