| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Introduces an extensive ScalaCheck-based test suite for recently
implemented quasiquotes. Provides tools for syntactic tree comparison
and verifying compilation error messages.
|
|
|
|
|
|
|
|
|
|
| |
While migrating scala.tools.nsc.util.TreeSet to
scala.collection.mutable.TreeSet, I messed up initialization order
and realized that TreeSet accepts null as an Ordering and only fails
much later.
This change makes mutable.TreeSet and immutable.TreeSet fail
immediately.
|
| |
|
|
|
|
|
|
|
|
| |
Partest uses test-interface API to invoke ScalaCheck. This obviates
ad hoc output checking for result status.
The context class loader is set to a loader that the scaladoc scalacheck
tests can use.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1) Deprecates much of Predef and scala.Console, especially:
- the read* methods (see below)
- the set{Out,Err,In} methods (see SI-4793)
2) Removed long-deprecated:
- Predef#exit
- Predef#error should have gone, but could not due to sbt
At least the whole source base has now been future-proofed
against the eventual removal of Predef#error.
The low justification for the read* methods should be readily
apparent: they are little used and have no call to be in global
namespace, especially given their weird ad hoc semantics and
unreasonably tempting names such as readBoolean().
3) Segregated the deprecated elements in Predef from the part
which still thrives.
4) Converted all the standard Predef implicits into implicit
classes, value classes where possible:
- ArrowAssoc, Ensuring, StringFormat, StringAdd, RichException (value)
- SeqCharSequence, ArrayCharSequence (non-value)
Non-implicit deprecated stubs prop up the names of the
formerly converting methods.
|
|\
| |
| |
| |
| |
| | |
Conflicts:
build.xml
src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Reverts part of c82ecab. The parser can't assume that
a pattern `(a, b)` will match, as results of
`.isInstanceOf[Tuple2]` can't be statically known until
after the typer.
The reopens SI-1336, SI-5589 and SI-4574, in exchange for fixing
this regression SI-6968. Keeping all of those fixed will require
a better definition of irrefutability, and some acrobatics to
ensure safe passage to the ambiguous trees through typechecking.
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
| |
This change allows to pattern match over type names, term names and
modifiers. Otherwise it can be quite painful to match over complex trees
as each name or modifiers requires a guard.
This pull request also changes the name of default constructor for term
and type names i.e. TypeName(s) instead of newTermName(s). This is
shorter to type, more consistent with the rest of reflection api and
consistent with the way it will be pattern matched later on.
|
|\
| |
| | |
enable integer multiplication/divison on FiniteDuration, see SI-6389
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
so that the full package can be imported naturally:
import scala.concurrent.duration._
will give you all the types (Duration, FiniteDuration, Deadline) and the
DSL for constructing these.
|
| |
| |
| |
| |
| | |
- also rename divisor arguments to “divisor”
- and add a scalacheck for multiplication overflow detection
|
|/
|
|
| |
Addresses review feedback by axel22.
|
|\
| |
| | |
Fix SI-5986.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Here we had an issue that RedBlack does not work the same way
for sets - which are not supposed to replace an element if
it is the same (wrt equals) and maps - which should replace
the corresponding values.
Adding an overwrite parameter which decides whether to overwrite
added keys if they are the same in the ordering.
Fix tests.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To current scalacheck head 7ffda752d8 except for this diff:
diff -rw src/scalacheck/org/scalacheck/Arbitrary.scala /s/scalacheck/src/main/scala/org/scalacheck/Arbitrary.scala
13d12
< import scala.reflect.ClassTag
281c280
< implicit def arbArray[T](implicit a: Arbitrary[T], c: ClassTag[T]
---
> implicit def arbArray[T](implicit a: Arbitrary[T], c: ClassManifest[T]
diff -rw src/scalacheck/org/scalacheck/Prop.scala /s/scalacheck/src/main/scala/org/scalacheck/Prop.scala
63c63
< def mainCallsExit = false
---
> def mainCallsExit = true
Only in /s/scalacheck/src/main/scala/org/scalacheck: ScalaCheckFramework.scala
diff -rw src/scalacheck/org/scalacheck/util/Buildable.scala /s/scalacheck/src/main/scala/org/scalacheck/util/Buildable.scala
13d12
< import scala.reflect.ClassTag
34c33
< implicit def buildableArray[T](implicit cm: ClassTag[T]) =
---
> implicit def buildableArray[T](implicit cm: ClassManifest[T]) =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 usages of ClassManifest and Manifest are replaced with tags
* all manifest tests are replaced with tag tests
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Introduced the collection.concurrent package and introduced the
concurrent.Map trait there. Deprecated the mutable.ConcurrentMap trait.
Pending work - introduce the appropriate changes to JavaConversions
and JavaConverters.
|
|/
|
|
|
|
|
|
|
|
|
| |
This adds findAllMatchIn to Regex to mirror other similar methods.
It also overloads StringLike's "r", adding a version that accepts
group names.
It includes test cases for both methods.
Closes SI-2460.
|
| |
|
|
|
|
|
|
|
|
|
| |
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 mainly helps performance when comparing keys is expensive.
|
| |
| |
| |
| |
| | |
This avoids unnecessary allocation of Option and Function objects,
mostly helping performance of small trees.
|
| |
| |
| |
| | |
Performance of `to` and `until` is now the same.
|
| | |
|
| | |
|
| |
| |
| |
| | |
Also simplified implementation of span to just use splitAt.
|
| |
| |
| |
| |
| |
| | |
This more clearly separates the new implementation from the now
deprecated abstract class RedBlack and avoids naming conflicts
for the member classes.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The class is marked as deprecated and no longer used by the TreeMap/TreeSet
implementation but is restored in case it was used by anyone else (since
it was not marked as private to the Scala collection library).
Renamed RedBlack.{Tree,RedTree,BlackTree} to Node, RedNode, and BlackNode
to work around name clash with RedBlack class.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
Use ArrayStack instead of Stack in TreeIterator for slightly increased
performance.
|
| | |
|
| |
| |
| |
| | |
Changed parameters in some tests to speed them up.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Ctrie is a scalable concurrent map implementation that supports
constant time lock-free lazy snapshots.
Due to the well-known private volatile field problem, atomic
reference updaters cannot be used efficiently in Scala yet.
For this reason, 4 java files had to be included as well.
None of these pollute the namespace, as most of the classes
are private.
Unit tests and a scalacheck check is also included.
|
|\ \
| | |
| | | |
AvlTree performance improvements
|
| | | |
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is part of an effort to make the immutable collections
(more) thread safe. The `::` still has non-final member fields
for head and tail, but there is not much that can be done right
now about that, since these fields are used by list buffers.
Tried writing a test with unsafe initialization, but could not
invent a scenario which actually fails, at least on the JDK6.
|
|\|
| |
| |
| |
| | |
Conflicts:
.gitignore
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The bug was caused by the inconsistency between j.l.Math.min() and
j.l.Double.compareTo() wrt NaN (j.l.Math.min() considers NaN to be
less than any other value while j.l.Double.compareTo() says it's
greater...)
The fix changes Ordering.{FloatOrdering,DoubleOrdering) to base
it's results on primitive comparisons and math.{min,max} instead
of j.l.{Float,Double}.compareTo()
|
|/
|
|
|
|
|
| |
This implementation is based on AVL trees.
The current implementation is contributed by Lucien Pereira.
Fixes #4147.
|
| |
|
|
|
|
|
|
|
| |
Remove some dead code, activate ByOne generator again, add generators
for inclusive ranges, add generators that concentrate on the boundaries,
and add some print statements next to exceptions that might get eaten
by out of memory errors.
|
|
|
|
|
|
|
|
|
|
| |
I haven't been able to find any reason for that reversal, but
this version is an improved version provided with SI-3796, which
never got committed along with the patch.
This version generates trees directly instead of using the methods
under test. It also puts an upper bound on tree size and, therefore,
execution time.
|