| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
- Language imports are preceding other imports
- Deleted empty file: InlineErasure
- Removed some unused private[parallel] methods in
scala/collection/parallel/package.scala
This removes hundreds of warnings when compiling with
"-Xlint -Ywarn-dead-code -Ywarn-unused -Ywarn-unused-import".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Confusing, now-it-happens now-it-doesn't mysteries lurk
in the darkness. When scala packages are declared like this:
package scala.collection.mutable
Then paths relative to scala can easily be broken via the unlucky
presence of an empty (or nonempty) directory. Example:
// a.scala
package scala.foo
class Bar { new util.Random }
% scalac ./a.scala
% mkdir util
% scalac ./a.scala
./a.scala:4: error: type Random is not a member of package util
new util.Random
^
one error found
There are two ways to play defense against this:
- don't use relative paths; okay sometimes, less so others
- don't "opt out" of the scala package
This commit mostly pursues the latter, with occasional doses
of the former.
I created a scratch directory containing these empty directories:
actors annotation ant api asm beans cmd collection compat
concurrent control convert docutil dtd duration event factory
forkjoin generic hashing immutable impl include internal io
logging macros man1 matching math meta model mutable nsc parallel
parsing partest persistent process pull ref reflect reify remote
runtime scalap scheduler script swing sys text threadpool tools
transform unchecked util xml
I stopped when I could compile the main src directories
even with all those empties on my classpath.
|
| |
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* commit 'ac432bcde6':
Fix broken build.
SI-6434 Pretty print function types with by name arg as (=> A) => B
Removed class files.
SI-6994 Avoid spurious promiscuous catch warning
Addressing warnings.
SI-6439 Avoid spurious REPL warnings about companionship
use ArrayBuffer instead of Array to build Formulae
SI-6942 more efficient unreachability analysis
use Constant::isIntRange even if it's NIH
SI-6956 determine switchability by type, not tree
SI-5568 Comment improvements for getClass on primitive intersection.
SI-5568 Fixes verify error from getClass on refinement of value type
SI-6923 Context now buffers warnings as well as errors
Conflicts:
src/compiler/scala/tools/nsc/interpreter/IMain.scala
src/compiler/scala/tools/nsc/transform/Erasure.scala
src/compiler/scala/tools/nsc/typechecker/Contexts.scala
src/compiler/scala/tools/nsc/typechecker/Typers.scala
test/files/neg/t4851.check
Note:
This merge excludes b07228aebe7a as it breaks master.
|
| |
| |
| |
| |
| |
| |
| | |
- SI-6923 uncovered a few valid warnings, these have been
addressed.
- A pair of "catches all throwable" warnings appeared; one
of the is spurious and the subject of SI-6994.
|
|\ \
| | |
| | | |
SI-6448 Collecting the spoils of PartialFun#runWith
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Avoids calling both `isDefinedAt` and `apply`. This pathological
case that would benefit the most looks like:
xs collect {
case x if {expensive(); true} => x
}
The typical change looks like:
- for (x <- this) if (pf.isDefinedAt(x)) b += pf(x)
+ foreach(pf.runWith(b += _))
Incorporates feedback provided by Pavel Pavlov:
https://github.com/retronym/scala/commit/ef5430
A few more opportunities for optimization are noted in the
`Pending` section of the enclosed test. `Iterator.collect`
would be nice, but a solution eludes me.
Calling the guard less frequently does change the behaviour
of these functions in an obervable way, but not contravene
the documented semantics. That said, there is an alternative
opinion on the comment of the ticket:
https://issues.scala-lang.org/browse/SI-6448
|
|\ \ \
| |/ /
|/| /
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* commit 'refs/pull/1574/head': (24 commits)
Fixing issue where OSGi bundles weren't getting used for distribution.
Fixes example in Type.asSeenFrom
Fix for SI-6600, regression with ScalaNumber.
SI-6562 Fix crash with class nested in @inline method
Brings copyrights in Scaladoc footer and manpage up-to-date, from 2011/12 to 2013
Brings all copyrights (in comments) up-to-date, from 2011/12 to 2013
SI-6606 Drops new icons in, replaces abstract types placeholder icons
SI-6132 Revisited, cleaned-up, links fixed, spelling errors fixed, rewordings
Labeling scala.reflect and scala.reflect.macros experimental in the API docs
Typo-fix in scala.concurrent.Future, thanks to @pavelpavlov
Remove implementation details from Position (they are still under reflection.internal). It probably needs more cleanup of the api wrt to ranges etc but let's leave it for later
SI-6399 Adds API docs for Any and AnyVal
Removing actors-migration from main repository so it can live on elsewhere.
Fix for SI-6597, implicit case class crasher.
SI-6578 Harden against synthetics being added more than once.
SI-6556 no assert for surprising ctor result type
Removing actors-migration from main repository so it can live on elsewhere.
Fixes SI-6500 by making erasure more regular.
Modification to SI-6534 patch.
Fixes SI-6559 - StringContext not using passed in escape function.
...
Conflicts:
src/actors-migration/scala/actors/migration/StashingActor.scala
src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala
src/compiler/scala/tools/nsc/settings/AestheticSettings.scala
src/compiler/scala/tools/nsc/transform/Erasure.scala
src/library/scala/Application.scala
src/library/scala/collection/immutable/GenIterable.scala.disabled
src/library/scala/collection/immutable/GenMap.scala.disabled
src/library/scala/collection/immutable/GenSeq.scala.disabled
src/library/scala/collection/immutable/GenSet.scala.disabled
src/library/scala/collection/immutable/GenTraversable.scala.disabled
src/library/scala/collection/mutable/GenIterable.scala.disabled
src/library/scala/collection/mutable/GenMap.scala.disabled
src/library/scala/collection/mutable/GenSeq.scala.disabled
src/library/scala/collection/mutable/GenSet.scala.disabled
src/library/scala/collection/mutable/GenTraversable.scala.disabled
src/library/scala/collection/parallel/immutable/ParNumericRange.scala.disabled
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
According to "git diff" the difference from master to this
commit includes:
Minus: 112 vals, 135 vars
Plus: 165 vals, 2 vars
Assuming all the removed ones were vals, which is true from 10K feet,
it suggests I removed 80 unused vals and turned 133 vars into vals.
There are a few other -Xlint driven improvements bundled with this,
like putting double-parentheses around Some((x, y)) so it doesn't
trigger the "adapting argument list" warning.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
That's a lot of unused code. Most of this is pure cruft; a small
amount is debugging code which somebody might want to keep around,
but we should not be using trunk as a repository of our personal
snippets of undocumented, unused, unintegrated debugging code. So
let's make the easy decision to err in the removing direction.
If it isn't built to last, it shouldn't be checked into master.
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some names I missed in 55b609458fd .
How one might know when one is done:
mkdir scratch && cd scratch
mkdir annotation beans collection compat concurrent io \
math parallel ref reflect runtime scala sys testing \
text tools util xml
scalac $(find ../src/library -name '*.scala')
Until recently that would fail with about a billion errors. When it
compiles, that's when you're done. And that's where this commit
takes us, for src/library at least.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before 2.10 we had a notion of ClassManifest that could be used to retain
erasures of abstract types (type parameters, abstract type members) for
being used at runtime.
With the advent of ClassManifest (and its subtype Manifest)
it became possible to write:
def mkGenericArray[T: Manifest] = Array[T]()
When compiling array instantiation, scalac would use a ClassManifest
implicit parameter from scope (in this case, provided by a context bound)
to remember Ts that have been passed to invoke mkGenericArray and
use that information to instantiate arrays at runtime (via Java reflection).
When redesigning manifests into what is now known as type tags, we decided
to explore a notion of ArrayTags that would stand for abstract and pure array
creators. Sure, ClassManifests were perfectly fine for this job, but they did
too much - technically speaking, one doesn't necessarily need a java.lang.Class
to create an array. Depending on a platform, e.g. within JavaScript runtime,
one would want to use a different mechanism.
As tempting as this idea was, it has also proven to be problematic.
First, it created an extra abstraction inside the compiler. Along with class tags
and type tags, we had a third flavor of tags - array tags. This has threaded the
additional complexity though implicits and typers.
Second, consequently, when redesigning tags multiple times over the course of
Scala 2.10.0 development, we had to carry this extra abstraction with us, which
exacerbated the overall feeling towards array tags.
Finally, array tags didn't fit into the naming scheme we had for tags.
Both class tags and type tags sound logical, because, they are descriptors for
the things they are supposed to tag, according to their names.
However array tags are the odd ones, because they don't actually tag any arrays.
As funny as it might sound, the naming problem was the last straw
that made us do away with the array tags. Hence this commit.
|
|
|
|
|
|
| |
All tags and reflection-related stuff requires a prefix,
be it scala.reflect for simple tags (ArrayTags and ClassTags),
or scala.reflect.basis/scala.reflect.runtime.universe for type tags.
|
|
|
|
|
|
|
|
|
|
| |
- Replaced/simplified usages of "wrt".
- Added backticks to $Coll definitions, so stuff like "immutable.Stack"
hopefully stops being interpreted as the end of a sentence and shown
like that in the summary line of ScalaDoc's method description.
See collection.immutable.Stack's sortBy.
Additionally, it looks nicer this way.
- Fixes the typo mentioned in SI-5666.
|
|
|
|
|
| |
* all usages of ClassManifest and Manifest are replaced with tags
* all manifest tests are replaced with tag tests
|
|
|
|
| |
Now that there's an extensive parallel collections overview on http://docs.scala-lang.org, API comments should link to it ("see also" field). This commit also fixes a couple of broken links on some sequential collection types.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
This required a bit of refactoring in the tasks objects and implementations
of various operations. Combiners now hold a reference to a tasksupport
object and pass it on to their result if `resultWithTaskSupport` is called.
Additionally, several bugs that have to do with CanBuildFrom and combiner
resolution have been fixed.
|
|
|
|
|
| |
This unclutters the namespace and makes defining custom parallel
collections a lot easier.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Refactoring the collections api to support differentiation between
referring to a sequential collection and a parallel collection, and to
support referring to both types of collections.
New set of traits Gen* are now superclasses of both their * and Par* subclasses. For example, GenIterable is a superclass of both Iterable and ParIterable. Iterable and ParIterable are not in a subclassing relation. The new class hierarchy is illustrated below (simplified, not all relations and classes are shown):
TraversableOnce --> GenTraversableOnce
^ ^
| |
Traversable --> GenTraversable
^ ^
| |
Iterable --> GenIterable <-- ParIterable
^ ^ ^
| | |
Seq --> GenSeq <-- ParSeq
(the *Like, *View and *ViewLike traits have a similar hierarchy)
General views extract common view functionality from parallel and
sequential collections.
This design also allows for more flexible extensions to the collections
framework. It also allows slowly factoring out common functionality up
into Gen* traits.
From now on, it is possible to write this:
import collection._
val p = parallel.ParSeq(1, 2, 3)
val g: GenSeq[Int] = p // meaning a General Sequence
val s = g.seq // type of s is Seq[Int]
for (elem <- g) {
// do something without guarantees on sequentiality of foreach
// this foreach may be executed in parallel
}
for (elem <- s) {
// do something with a guarantee that foreach is executed in order, sequentially
}
for (elem <- p) {
// do something concurrently, in parallel
}
This also means that some signatures had to be changed. For example,
method `flatMap` now takes `A => GenTraversableOnce[B]`, and `zip` takes
a `GenIterable[B]`.
Also, there are mutable & immutable Gen* trait variants. They have
generic companion functionality.
|
|
|
|
|
|
| |
Addressing most of the warnings revealed by the patch to warn about
unknown scaladoc variables. Updated and reran genprod. No review.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implementing foreach to work in parallel in ParIterableLike.
Doing a bunch of refactoring around in the collection framework to
ensure a parallel foreach is never called with a side-effecting method.
This still leaves other parts of the standard library and the compiler
unguarded.
No review.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Imported sbt.Process into trunk, in the guise of package
scala.sys.process. It is largely indistinguishable from the version in
sbt, at least from the outside.
Also, I renamed package system to sys. I wanted to do that from the
beginning and the desire has only grown since then. Sometimes a short
identifier is just critical to usability: with a function like error("")
called from hundreds of places, the difference between system.error and
sys.error is too big. sys.error and sys.exit have good vibes (at least
as good as the vibes can be for functions which error and exit.)
Note: this is just the first cut. I need to check this in to finish
fixing partest. I will be going over it with a comb and writing
documentation which will leave you enchanted, as well as removing other
bits which are now redundant or inferior. No review.
|
|
|
|
|
| |
No review.
|
|
|
|
|
|
|
|
|
| |
Array combiners implementation changed from array buffers to doubling
unrolled buffers to avoid excessive copying. Still evaluating the
benefits of this.
No review.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Special cased with thread pool executor scheduling. Fixed an ugly
concurrency bug where futures returned by a thread pool executor didn't
remove the task from the queue when cancel was called. Note to self and
others: don't cancel futures returned by thread pool executors, it might
lead to unexpected behaviour. Modified the executor to add new threads
if all the active threads are syncing, in order to avoid deadlocks.
Fixed a hidden bug in AdaptiveWorkStealingTasks, where correct behaviour
depended on the execution order of the tasks. This didn't fail before
with ForkJoinTasks, since there the execution order is well-defined.
Scalachecked 1.5 & 1.6 support.
No review.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The initial implementation of TraversableOnce could not supply concrete
methods or even signatures for map and flatMap because they have
different signatures in Iterator and TraversableLike. But we can take
another approach which works out as nicely:
1) Create implicits which install those methods and flatten on
TraversableOnce instances. 2) Generalize the signatures of flatten
and flatMap to work with A => TraversableOnce[B] instead of A =>
Traversable[B].
And voila, you can mix and match Iterators and Traversables in a for
comprehension, map, flatMap, and flatten, without the tedious process
of sprinkling .iterator or .toList around to appease the compiler. No
review.
|
|
|
|
|
|
|
|
| |
Refactored parallel collections for pluggable task support
implementations.
No review.
|
|
|
|
|
|
| |
Refactoring certain tasks to accept empty splitters. Adding parallel
mutable hash maps. No review
|
|
|
|
|
|
| |
Reimplementing parallel views to solve several performance glitches. No
review.
|
|
|
|
|
|
| |
Refactorings to make iterators required by task objects less restricted.
No review
|
| |
|
| |
|
| |
|
| |
|
|
|