summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* SI-6642 Refactor mutable.TreeSet to use RedBlackTree instead of AVLJames Iry2013-02-134-79/+223
| | | | | | | | | | | | | There was no reason to have mutable.TreeSet use AVLTree while immutable.TreeSet and immutable.HashSet used RedBlackTree. In particular that would have meant duplicating the iteratorFrom logic unnecessarily. So this commit refactors mutable.TreeSet to use RedBlackTree for everything, including iteratorFrom. It also adds a test to make sure TreeSet works as expected. AVLTree should be dead code since it's private[scala.collection.mutable] and only used by mutable.TreeSet, but to be safe it's only deprecated in this commit.
* SI-6642 Adds iteratorFrom, keysIteratorFrom, and valuesIteratorFromJames Iry2013-02-1311-10/+177
| | | | | | | | | | | | Adds the ability to efficiently create an iterator that starts at a given key or element of a sorted set or map. Similar work is done for key and value only iterators on maps. The bulk of the work is in RedBlackTree. Most of the rest is pushing the new api methods throughout the appropriate spots in the collection API. This commit leaves undone some similar work possible on mutable TreeSets
* SI-6642 Code cleanup on RedBlackTree#TreeIteratorJames Iry2013-02-131-21/+24
| | | | | | In anticipation of some work needed to implement iteratorFrom, this commit does some variable renaming and general code clean up on RedBlackTree's TreeIterator.
* Merge pull request #2124 from adriaanm/76f167388a42e9bb8b72645d87bcb408b6981576Grzegorz Kossakowski2013-02-1213-16/+102
|\ | | | | merge 2.10.x
| * Merge remote-tracking branch 'scala/2.10.x' into patmat-refactor-masterAdriaan Moors2013-02-1213-16/+102
| |\ | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/typechecker/Implicits.scala
| | * Merge pull request #2113 from scalamacros/topic/silencePaul Phillips2013-02-112-1/+7
| | |\ | | | | | | | | silences t6323a
| | | * silences t6323aEugene Burmako2013-02-112-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | Tag materialization notices enabled with -Xlog-implicits are now echoes not printlns. Therefore, they go into stderr, not stdout, getting logged by partest and not spamming stdout of partest.
| | * | Merge pull request #2111 from retronym/2.10.xJames Iry2013-02-113-8/+26
| | |\ \ | | | | | | | | | | SI-6514 Avoid spurious dead code warnings
| | | * | SI-6514 Avoid spurious dead code warningsJason Zaugg2013-02-103-8/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `deadCode.expr` stores the method symbol most recently encountered in `handleMonomorphicCall`, and uses this to avoid warnings for arguments to label jumps and `Object#synchronized` (which sneakily acts by-name without advertising the fact in its type.) But this scheme was insufficient if the argument itself contains another method call, such as `matchEnd(throw e(""))`. This commit changes the single slot to a stack, and also grants exemption to `LabelDef` trees. They were incorrectly flagged in the enclosed test case after I made the the first change.
| | * | | Merge pull request #2102 from retronym/topic/tree-checker-leniancyJames Iry2013-02-111-0/+3
| | |\ \ \ | | | | | | | | | | | | Tolerate symbol sharing between accessor/field.
| | | * | | Tolerate symbol sharing between accessor/field.Jason Zaugg2013-02-091-0/+3
| | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recently, TreeCheckers (-Ycheck) was extended to report on references to symbols that were not in scope, which is often a sign that some substitution or ownership changes have been omitted. But, accessor methods directly use the type of the underlying field, without cloning symbols defined in that type, such as quantified types in existentials, at the new owner. My attempt to change this broke pos/existentials.scala. Instead, I'll just look the other way in TreeCheckers.
| | * | | Merge pull request #2098 from retronym/ticket/6225James Iry2013-02-112-1/+28
| | |\ \ \ | | | | | | | | | | | | SI-6225 Fix import of inherited package object implicits
| | | * | | SI-6225 Fix import of inherited package object implicitsJason Zaugg2013-02-092-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The prefix in the ImplicitInfo must be com.acme.`package`.type, rather than com.acme.
| | * | | | Merge pull request #2097 from ViniciusMiana/SI-6935James Iry2013-02-112-0/+16
| | |\ \ \ \ | | | | | | | | | | | | | | SI-6935 Added readResolve in BoxedUnit
| | | * | | | SI-6935 Added readResolve in BoxedUnitVinicius Miana2013-02-082-0/+16
| | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | When deserializing Unit, it would return an instance of Object, but not a Scala Unit. By adding readResolve, the deserialization of Unit will work.
| | * | | | Merge pull request #2096 from ViniciusMiana/SI-6370James Iry2013-02-112-2/+18
| | |\ \ \ \ | | | | | | | | | | | | | | SI-6370 changed ListMap apply0 method to produce correct error message
| | | * | | | SI-6370 changed ListMap apply0 method to produce correct error message when ↵Vinicius Miana2013-02-082-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a key is not found Current implementation of apply0 relies on tail method to iterate over all keys. When the list gets to its end, tail produces an 'empty map' message in its exception, which is thrown by ListMap. This change checks if the collection is empty before calling tail and provides a more appropriate key not found message. Signed-off-by: Vinicius Miana <vinicius@miana.com.br>
| | * | | | | Merge pull request #2099 from retronym/ticket/6158Paul Phillips2013-02-111-1/+1
| | |\ \ \ \ \ | | | |_|_|_|/ | | |/| | | | SI-6158 Restore compile error output under partest --show-log
| | | * | | | SI-6158 Restore compile error output under partest --show-logJason Zaugg2013-02-091-1/+1
| | | | |/ / | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Seems like the ifs and elses didn't quite survive e830a7ce9. Before: ./test/partest --show-log test/files/run/foo.scala Testing individual files testing: [...]/files/run/foo.scala [FAILED] Now: ./test/partest --show-log test/files/run/foo.scala Testing individual files testing: [...]/files/run/foo.scala [FAILED] foo.scala:1: error: expected class or object definition askdfjskl ^ one error found 1 of 1 tests failed (elapsed time: 00:00:01)
* | | | | | Merge pull request #2077 from vy/patch-3James Iry2013-02-121-1/+1
|\ \ \ \ \ \ | |/ / / / / |/| | | | | Update src/library/scala/sys/process/package.scala
| * | | | | Update src/library/scala/sys/process/package.scalaVolkan Yazıcı2013-02-061-1/+1
| | | | | | | | | | | | | | | | | | Fix broken wildcard expansion in the `sys.process` docs.
* | | | | | Merge pull request #2057 from paulp/pr/revert-6355Paul Phillips2013-02-124-8/+32
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-6355, weakend implementation restriction on applyDynamic.
| * | | | | | SI-6355, weakend implementation restriction on applyDynamic.Paul Phillips2013-02-124-8/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I realized one can successfully call an overloaded applyDynamic, under conditions such as these: def applyDynamic[T1](m: String)(x1: T1): Any = 1 def applyDynamic[T1, T2](m: String)(x: T1, y: T2): Any = 2 def applyDynamic[T1, T2, T3](m: String)(x: T1, y: T2, z: T3): Any = 3 So I weakened the overloading restriction to allow overloading if each method has a distinct number of type parameters. This very likely still allows the creation of uncallable overloads, but an overly restrictive rule is worse. If the overload cannot be called, it will still be discovered at the call site.
* | | | | | | Merge pull request #1999 from paulp/pr/predef-maintenancePaul Phillips2013-02-1287-665/+752
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | Predef maintenance
| * | | | | | Maintenance of Predef.Paul Phillips2013-02-1287-665/+752
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | Merge pull request #2107 from rnix/patch-1James Iry2013-02-111-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | Application is deprecated. Replaced with App
| * | | | | | Application is deprecated. Replaced with AppRobert Nix2013-02-101-1/+1
| | | | | | |
* | | | | | | Merge pull request #2076 from vy/patch-2James Iry2013-02-111-20/+20
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Update src/library/scala/sys/process/ProcessBuilder.scala
| * | | | | | | Update src/library/scala/sys/process/ProcessBuilder.scalaVolkan Yazıcı2013-02-061-20/+20
| | |/ / / / / | |/| | | | | | | | | | | | Fix typesetting of unordered list items in the docs.
* | | | | | | Merge pull request #2112 from paulp/pr/merge-210xJames Iry2013-02-11216-912/+3187
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | merge 2.10.x into master
| * | | | | | Merge remote-tracking branch 'origin/2.10.x' into merge-210Paul Phillips2013-02-10108-350/+1166
| |\ \ \ \ \ \ | | | |/ / / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/2.10.x: Fix for paramaccessor alias regression. Expanded bytecode testing code. SI-5675 Discard duplicate feature warnings at a position accommodates pull request feedback term and type reftrees are now reified uniformly SI-6591 Reify and path-dependent types SI-7096 SubstSymMap copies trees before modifying their symbols SI-6961 no structural sharing in list serialization SI-6187 Make partial functions re-typable [backport] SI-6478 Fixing JavaTokenParser ident SI-7100 Fixed infinite recursion in duplicators SI-6146 More accurate prefixes for sealed subtypes. SI-5082 Cycle avoidance between case companions SI-6113 typeOf now works for type lambdas SI-5824 Fix crashes in reify with _* SI-7026: parseTree should never return a typed one SI-7070 Turn restriction on companions in pkg objs into warning Conflicts: src/compiler/scala/reflect/reify/codegen/GenSymbols.scala src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala src/compiler/scala/tools/reflect/ToolBoxFactory.scala src/library/scala/collection/immutable/List.scala src/reflect/scala/reflect/internal/TreeInfo.scala src/reflect/scala/reflect/internal/Types.scala src/reflect/scala/reflect/internal/settings/MutableSettings.scala src/reflect/scala/reflect/runtime/Settings.scala test/files/buildmanager/t2650_1/t2650_1.check test/files/buildmanager/t2657/t2657.check test/files/neg/t3234.check test/files/run/idempotency-this.check test/files/run/macro-typecheck-macrosdisabled2.check test/files/run/showraw_tree.check test/files/run/showraw_tree_ids.check test/files/run/showraw_tree_kinds.check test/files/run/showraw_tree_types_ids.check test/files/run/showraw_tree_types_typed.check test/files/run/showraw_tree_types_untyped.check test/files/run/showraw_tree_ultimate.check test/files/run/t2886.check test/files/run/t5225_2.check test/files/run/t5374.check test/files/run/t5374.scala test/files/run/t6329_repl.check test/files/run/toolbox_typecheck_macrosdisabled2.check
| | * | | | | Merge pull request #2100 from paulp/pr/fix-super-varargs-savedJames Iry2013-02-096-4/+121
| | |\ \ \ \ \ | | | |_|_|_|/ | | |/| | | | Fixing binary compat for $super regression
| | | * | | | Fix for paramaccessor alias regression.Paul Phillips2013-02-084-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A binary incompatibility with 2.10.0 revealed a bug I had introduced in c58647f5f2.
| | | * | | | Expanded bytecode testing code.Paul Phillips2013-02-082-3/+90
| | | | |/ / | | | |/| | | | | | | | | | | | | | | | | | | | def sameMethodAndFieldSignatures compares two classes to verify they have all the same methods and fields, and no others.
| | * | | | Merge pull request #2094 from scalamacros/ticket/6591James Iry2013-02-0844-105/+309
| | |\ \ \ \ | | | |/ / / | | |/| | | SI-6591 Reify and path-dependent types
| | | * | | accommodates pull request feedbackEugene Burmako2013-02-085-17/+68
| | | | | | | | | | | | | | | | | | | | | | | | https://github.com/scala/scala/pull/2072
| | | * | | term and type reftrees are now reified uniformlyEugene Burmako2013-02-0824-82/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Top-level (i.e. owned by a package) => Ident(symbol) Nested (i.e. owned by an object or a package object) => Select(owner, symbol) Inner (i.e. owned by a static class) => selectTerm/selectType(owner, name) Non-locatable (i.e. everything else) => see GenTrees.scala for more details Changes w.r.t the previous approaches: * Top-level refs are no longer reified as Select(This(package), symbol). Proposed reification scheme is as resistant to resetAttrs as previous one, but is at the same time much shorter. * Refs to definitions from package objects are no longer Ident(symbol). Otherwise reflective compilation of things like `_ :: _` fails. * Contents of Predef._ and scala._ are no longer treated specially. This increases the size of reificode, but is more hygienic.
| | | * | | SI-6591 Reify and path-dependent typesDmitry Bushev2013-02-0821-20/+165
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reification scheme changed. Now Select an SelectFromTypeTree trees reified appropriately, as Select and SelectFromTypeTree accordingly. Packages and Predef object was excluded in order not to break the existing reification scheme and not to break tests which rely on it. Reified free terms can contain flag <stable> to make reified values become stable identifiers. For example in the case of reify_newimpl_15.scala class C { type T reify { val v: List[T] = List(2) } } class C reified as free term C$value, and List[C.T] becomes List[C$value().T], so C$value.apply() need to pass stability test isExprSafeToInline at scala.reflect.internal.TreeInfo. For this purpose special case for reified free terms was added to isExprSafeToInline function. test run/reify_newipl_30 disabled due to SI-7082 test t6591_4 moved to pending due to SI-7083
| | * | | | Merge pull request #2095 from hubertp/ticket/5675James Iry2013-02-0814-17/+27
| | |\ \ \ \ | | | | | | | | | | | | | | SI-5675 Discard duplicate feature warnings at a position
| | | * | | | SI-5675 Discard duplicate feature warnings at a positionJason Zaugg2013-02-0814-17/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When -feature has not been enabled, we were double counting identical feature warnings that were emitted at the same position. Normal error reporting only reports the first time a warning appears at a position; feature warning counter incrementing should behave the same way. @hubertp: Fixed .check files that were broken in the original commit.
| | * | | | | Merge pull request #2092 from lrytz/t7096James Iry2013-02-083-13/+67
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | SI-7096 SubstSymMap copies trees before modifying their symbols
| | | * | | | | SI-7096 SubstSymMap copies trees before modifying their symbolsLukas Rytz2013-02-083-13/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I removed some strange code in a06d31f6a2 and replaced it by something incorrect: SubstSymMap should never have side-effects: otherwise, calling 'tpe1 <: tpe2' for instance would modify the symbols in annotations of tpe2. SubstSymMap now always creates new trees before changing them.
| | * | | | | | Merge pull request #2017 from retronym/ticket/6666James Iry2013-02-0820-73/+265
| | |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Booking more progress on SI-6666
| | * \ \ \ \ \ \ Merge pull request #2091 from JamesIry/2.10.x_SI-6478James Iry2013-02-083-3/+56
| | |\ \ \ \ \ \ \ | | | |_|_|_|/ / / | | |/| | | | | | [backport] SI-6478 Fixing JavaTokenParser ident
| | | * | | | | | [backport] SI-6478 Fixing JavaTokenParser identJames Roper2013-02-073-3/+56
| | | | |/ / / / | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport of 256934160007079f473131469af2df4d023c2cfc from PR https://github.com/scala/scala/pull/1466
| | * | | | | | Merge pull request #2035 from scalamacros/ticket/6989Eugene Burmako2013-02-087-17/+332
| | |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-6989 privateWithin is now populated in reflect
| | * \ \ \ \ \ \ Merge pull request #2085 from scalamacros/ticket/5824Eugene Burmako2013-02-085-5/+25
| | |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-5824 Fix crashes in reify with _*
| | | * | | | | | | SI-5824 Fix crashes in reify with _*Evgeny Kotelnikov2013-02-075-5/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reification crashes if "foo: _*" construct is used. This happens besause type tree is represented either with TypeTree, or with Ident (present case), and `toPreTyperTypedOrAnnotated' only matches of the former. The fix is to cover the latter too. A test is included.
| | * | | | | | | | Merge pull request #2093 from adriaanm/ticket-6961James Iry2013-02-073-106/+9
| | |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | SI-6961 no structural sharing in list serialization
| | | * | | | | | | | SI-6961 no structural sharing in list serializationAleksandar Prokopec2013-02-073-106/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert list serialization back to what it was in 2.9.x and before. Partial revert of a6fcd70b60 e234978dfd, which fixed SI-5374. The ListBuffer part of the fix remains in place.