summaryrefslogtreecommitdiff
path: root/src/library
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #741 from axel22/issue/4954Josh Suereth2012-06-182-13/+36
|\ | | | | Fix SI-4954.
| * Fix SI-4954.Aleksandar Prokopec2012-06-182-13/+36
| | | | | | | | | | | | Override inner classes in `LinkedHashMap` that correspond to `filterKeys`, `mapValues` and `keys` to retain a proper ordering of elements when they are transformed.
* | Merge pull request #742 from axel22/feature/pc-ctrieJosh Suereth2012-06-181-1/+5
|\ \ | | | | | | Use `ThreadLocalRandom` in `TrieMap.size`.
| * | Use `ThreadLocalRandom` in `TrieMap.size`.Aleksandar Prokopec2012-06-181-1/+5
| |/
* | Merge pull request #725 from paulp/issue/arrayopsJosh Suereth2012-06-181-1/+1
|\ \ | | | | | | Remove unused type parameter.
| * | Remove unused type parameter.Paul Phillips2012-06-151-1/+1
| | | | | | | | | | | | | | | There should probably be a warning about non-overriding methods which have unreferenced type parameters.
* | | Merge pull request #736 from damienobrist/feature/diagrams-dev-revertJosh Suereth2012-06-181-13/+7
|\ \ \ | |_|/ |/| | Reverting the diagrams
| * | Revert "Documented SyncVar"Vlad Ureche2012-06-181-13/+7
| | | | | | | | | | | | This reverts commit 556065151c10685240dd907691dab5e094c87efc.
* | | Merge pull request #718 from damienobrist/feature/diagrams-dev-finalJosh Suereth2012-06-171-7/+13
|\| | | | | | | | Diagrams in Scaladoc
| * | Documented SyncVarVlad Ureche2012-06-141-7/+13
| | | | | | | | | | | | | | | | | | | | | Since we used it in the DocRunner and noticed it could have better documentation. Review by @heathermiller.
* | | Merge pull request #721 from viktorklang/wip-sensible-deprecation-msgs-√Josh Suereth2012-06-151-26/+26
|\ \ \ | |_|/ |/| | Wip sensible deprecation msgs √
| * | Removing erronous quoting of implicitNotFoundViktor Klang2012-06-141-2/+2
| | |
| * | Adding backticks to code in deprecation messages in PredefViktor Klang2012-06-141-28/+28
| | |
| * | Clarifying deprecation for implicit and explicit usage of the x2y's in PredefViktor Klang2012-06-131-24/+24
| | |
| * | Clarifying deprecation messages for numeric conversions in PredefViktor Klang2012-06-131-24/+24
| |/
* / rework Future.dispatchFuture a bit to fix bugs / optimizeHavoc Pennington2012-06-132-49/+82
|/ | | | | | | | | | | | | | | | This fixes a bug where _taskStack could batch a task into the wrong executor, as previously commented in the code. It now uses the _taskStack machinery for the Future.apply dispatch in addition to callback dispatch, so we can batch Future(body) as well. Less significantly, it micro-optimizes by combining some different closures and Runnable into a Task object, so there aren't as many objects created when storing and dispatching a callback. So it saves a bit of memory and runtime perhaps.
* Breaks.break should return Nothing, not UnitDan Brown2012-06-121-1/+1
|
* Forkjoin and fjbg are now always compiled in the build.Josh Suereth2012-06-111-35/+0
| | | | | * forkjoin.done/forkjoine.clean can test forkjoin source * fjbg.done/fjbg.clean can test fjbg source.
* turn unchecked type patterns into checked onesAdriaan Moors2012-06-081-0/+10
| | | | | | | | | | | | | | | | the pattern `(_: T)` is made checkable using (ct: ClassTag[T]).unapply by rewriting it to `ct(_: T)` (if there's a ClassTag[T] available) similarly for extractors: if the formal type of the unapply method is an uncheckable type, wrap in the corresponding classtag extractor (if available) don't trigger rewrite on non-toplevel unchecked types (i.e., only look at type constructor part of T when looking for unchecked types) TODO: find outer match to figure out if we're supposed to be unchecked would like to give users a chance to opt-out from the wrapping, but finding the match to which this pattern belongs turned out to be tricky...
* TypeTag => AbsTypeTag, ConcreteTypeTag => TypeTagEugene Burmako2012-06-086-120/+123
| | | | | This protects everyone from the confusion caused by stuff like this: https://issues.scala-lang.org/browse/SI-5884
* removes array tagsEugene Burmako2012-06-0829-174/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Introduces scala-reflect.jarEugene Burmako2012-06-0835-3262/+0
|
* miscellaneous cleanup, mostly fighting with feature warningsEugene Burmako2012-06-0824-36/+59
|
* brings reification up to speedEugene Burmako2012-06-083-11/+31
| | | | | | | | | | Along with recovering from reflection refactoring, I implemented some new features (e.g. rollback of macro expansions), and did some stabilizing refactorings (e.g. moved mutable state into a ghetto). Also used the refactoring as a chance to fix free and aux symbols. Encapsulated this notion in a symbol table class, which allowed me to address outstanding issues with symbol table inheritance and inlining.
* brings macros up to speedEugene Burmako2012-06-089-23/+86
| | | | | | | | | | | | | | | | | | | | Before reflection refactoring, macro contexts only exposed a mirror. Now it's time to expose both a universe (the compiler instance) and a mirror (a macro-specific symbol resolver). By the way, speaking of mirrors. Macro contexts have their own mirror, which is different from compiler's rootMirror. This is done because macros need to be able to resolve stuff from empty package. Reflection refactoring brought major changes to runtime evaluation, which got dropped from universes and now requires scala-compiler.jar. However there are macro users, who would like to do eval inside macros. To help them we expose `libraryClassLoader` to manually build toolboxes, and also a simple-to-use `c.eval` method. I've also sneakily introduced `c.parse`, because it's something that has also been frequently requested. Moreover, it might help Scaladoc. So I decided that it might be worth it to add this new functionality.
* removes tags and their incantations from PredefEugene Burmako2012-06-0824-24/+28
| | | | | | 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.
* ClassTag.erasure => ClassTag.runtimeClassEugene Burmako2012-06-0814-53/+54
| | | | | This change is made to be consistent with JavaMirrors. And, in my opinion, a technology-neutral term is better here.
* The new reflectionEugene Burmako2012-06-0867-3851/+4943
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A must read: "SIP: Scala Reflection": https://docs.google.com/document/d/1Z1VhhNPplbUpaZPIYdc0_EUv5RiGQ2X4oqp0i-vz1qw/edit Highlights: * Architecture has undergone a dramatic rehash. * Universes and mirrors are now separate entities: universes host reflection artifacts (trees, symbols, types, etc), mirrors abstract loading of those artifacts (e.g. JavaMirror loads stuff using a classloader and annotation unpickler, while GlobalMirror uses internal compiler classreader to achieve the same goal). * No static reflection mirror is imposed on the user. One is free to choose between lightweight mirrors and full-blown classloader-based mirror (read below). * Public reflection API is split into scala.reflect.base and scala.reflect.api. The former represents a minimalistic snapshot that is exactly enough to build reified trees and types. To build, but not to analyze - everything smart (for example, getting a type signature) is implemented in scala.reflect.api. * Both reflection domains have their own universe: scala.reflect.basis and scala.reflect.runtime.universe. The former is super lightweight and doesn't involve any classloaders, while the latter represents a stripped down compiler. * Classloader problems from 2.10.0-M3 are solved. * Exprs and type tags are now bound to a mirror upon creation. * However there is an easy way to migrate exprs and type tags between mirrors and even between universes. * This means that no classloader is imposed on the user of type tags and exprs. If one doesn't like a classloader that's there (associated with tag's mirror), one can create a custom mirror and migrate the tag or the expr to it. * There is a shortcut that works in most cases. Requesting a type tag from a full-blown universe will create that tag in a mirror that corresponds to the callsite classloader aka `getClass.getClassLoader`. This imposes no obligations on the programmer, since Type construction is lazy, so one can always migrate a tag into a different mirror. Migration notes for 2.10.0-M3 users: * Incantations in Predef are gone, some of them have moved to scala.reflect. * Everything path-dependent requires implicit prefix (for example, to refer to a type tag, you need to explicitly specify the universe it belongs to, e.g. reflect.basis.TypeTag or reflect.runtime.universe.TypeTag). * ArrayTags have been removed, ConcreteTypeTag have been renamed to TypeTags, TypeTags have been renamed to AbsTypeTags. Look for the reasoning in the nearby children of this commit. Why not in this commit? Scroll this message to the very bottom to find out the reason. * Some of the functions have been renamed or moved around. The rule of thumb is to look for anything non-trivial in scala.reflect.api. Some of tree build utils have been moved to Universe.build. * staticModule and staticClass have been moved from universes to mirrors * ClassTag.erasure => ClassTag.runtimeClass * For the sake of purity, type tags no longer have erasures. Use multiple context bounds (e.g. def foo[T: ru.TypeTag : ClassTag](...) = ...) if you're interested in having both erasures and types for type parameters. * reify now rolls back macro applications. * Runtime evaluation is now explicit, requires import scala.tools.reflect.Eval and scala-compiler.jar on the classpath. * Macro context now has separate universe and mirror fields. * Most of the useful stuff is declared in c.universe, so be sure to change your "import c.universe._" to "import c.mirror._". * Due to the changes in expressions and type tags, their regular factories are now really difficult to use. We acknowledge that macro users need to frequently create exprs and tags, so we added old-style factories to context. Bottom line: almost always prepend Expr(...)/TypeTag(...) with "c.". * Expr.eval has been renamed to Expr.splice. * Expr.value no longer splices (it can still be used to express cross-stage path-dependent types as specified in SIP-16). * c.reifyTree now has a mirror parameter that lets one customize the initial mirror the resulting Expr will be bound to. If you provide EmptyTree, then the reifier will automatically pick a reasonable mirror (callsite classloader mirror for a full-blown universe and rootMirror for a basis universe). Bottom line: this parameter should be EmptyTree in 99% of cases. * c.reifyErasure => c.reifyRuntimeClass. Known issues: * API is really raw, need your feedback. * All reflection artifacts are now represented by abstract types. This means that pattern matching against them will emit unchecked warnings. Adriaan is working on a patch that will fix that. WARNING, FELLOW CODE EXPLORER! You have entered a turbulence zone. For this commit and its nearby parents and children tests are not guaranteed to work. Things get back to normal only after the "repairs the tests after the refactoring spree" commit. Why so weird? These twentish changesets were once parts of a humongous blob, which spanned 1200 files and 15 kLOC. I did my best to split up the blob, so that the individual parts of the code compile and make sense in isolation. However doing the same for tests would be too much work.
* preparations: removes DynamicProxyEugene Burmako2012-06-081-74/+0
| | | | | This is necessary because toolboxes will no longer be available from the library. Christopher Vogt will take care of the second reincarnation of DynamicRef.
* macros: refactoring of fast track infrastructureEugene Burmako2012-06-085-173/+38
| | | | | | | | | As a result, hardwired macros don't need implementation stubs. This is very important, because in a few commits scala.reflect.makro.Context will move out from scala-library.jar. Also adding fast track entries doesn't require jumping through hoops with PDTs. It's as simple as defining PartialFunction[Tree, Any].
* improves traces and error messagesEugene Burmako2012-06-082-11/+19
|
* Merge pull request #672 from axel22/issue/5857Adriaan Moors2012-06-082-2/+42
|\ | | | | Fixes SI-5857. More efficient min and max in Range and NumericRange
| * Fixes SI-5857.Aleksandar Prokopec2012-06-062-2/+42
| | | | | | | | | | | | | | | | Override `min` and `max` in `Range` and `NumericRange` to check if a default `Ordering` for the numeric type in question is used. If so, bypass traversal and compute the minimum or maximum element.
* | Merge pull request #677 from axel22/feature/util-hashing2Josh Suereth2012-06-0715-55/+133
|\ \ | | | | | | Add the first iteration of the `util.hashing` package.
| * | Add the first iteration of the `util.hashing` package.Aleksandar Prokopec2012-06-0715-55/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move `MurmurHash3` to `util.hashing`. Make the `class` private and retain a public companion `object`, and put the `MurmurHash3.Hashing` implementations for various types in the companion. Add a method which composes `ByteswapHashing` with some other hashing. Rename `hashOf` to `hash`. Fix chi-square test in a test-case. Review by @jsuereth. Moved a failing test that seems to use some other library version to pending.
* | | Generate abstract methods in scala.Byte and friends.Paul Phillips2012-06-0610-759/+794
|/ / | | | | | | | | Rather than stub implementations. This saves over 50K of bytecode. I also added the necessary imports to silence the feature warnings.
* | Merge pull request #669 from dgruntz/masterJosh Suereth2012-06-061-5/+6
|\ \ | | | | | | Fixes typos in scaladoc of Orderes.scala
| * | fixes typos in scaladoc of Orderes.calaDominik Gruntz2012-06-051-5/+6
| |/
* | Merge pull request #673 from axel22/issue/5880Josh Suereth2012-06-061-2/+8
|\ \ | | | | | | Fix SI-5880.
| * | Fix SI-5880.Aleksandar Prokopec2012-06-061-2/+8
| |/ | | | | | | Add a ChiSquare test for the new hash code.
* | Merge pull request #671 from axel22/issue/5867Josh Suereth2012-06-061-0/+2
|\ \ | | | | | | Fix SI-5867.
| * | Fix SI-5867.Aleksandar Prokopec2012-06-061-0/+2
| |/ | | | | | | Override clone for unrolled buffer.
* | Merge pull request #670 from axel22/issue/5879Josh Suereth2012-06-061-15/+52
|\ \ | | | | | | Fix SI-5879.
| * | Fix SI-5879.Aleksandar Prokopec2012-06-061-15/+52
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug where a key in an immutable hash map have the corresponding value different in the iteration than when doing lookup. This use to happen after calling `merge`. Fix the order in which a key-value pair appears in the collision resolution function - the first argument always comes from the `this` hash map. Deprecate `merge` in favour of `merged`, as this is a pure method. As an added benefit, the syntax for invoking `merge` is now nicer.
* / Add configuration for ExecutionContextphaller2012-06-051-7/+21
|/
* Fix `Hashing`.Aleksandar Prokopec2012-06-013-12/+24
| | | | | | Move `Hashing` to `scala.util.hashing`. Adde `Hashing.Default` to `Hashing` companion object. Change `TrieMap` to autoswitch from `Hashing.Default` to `TrieMap.MangledHashing`.
* Remove Equality in favour of Equiv.Aleksandar Prokopec2012-06-014-46/+9
| | | | Make Equiv serializable.
* Add Hashing and Equality typeclasses.Aleksandar Prokopec2012-06-013-27/+122
| | | | | | Modify TrieMap to use hashing and equality. Modify serialization in TrieMap appropriately.
* fix t5843Lukas Rytz2012-05-281-2/+2
|
* Handled some of our new exhaustiveness warnings.Paul Phillips2012-05-261-0/+2
| | | | Who could have suspected it would actually be right most of the time?