summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'erikrozendaal/SI-5331' into developPaul Phillips2012-02-154-32/+554
|\
| * Custom implementations of drop/take/slice.Erik Rozendaal2012-01-232-5/+31
| | | | | | | | This mainly helps performance when comparing keys is expensive.
| * Custom coded version of range/from/to/until.Erik Rozendaal2012-01-211-16/+10
| | | | | | | | | | This avoids unnecessary allocation of Option and Function objects, mostly helping performance of small trees.
| * Optimized implementation of TreeMap/TreeSet#to method.Erik Rozendaal2012-01-153-13/+54
| | | | | | | | Performance of `to` and `until` is now the same.
| * Test for maximum height of red-black tree.Erik Rozendaal2012-01-081-0/+5
| |
| * Fix silly copy-paste error.Erik Rozendaal2012-01-071-9/+9
| |
| * Tests for takeWhile/dropWhile/span.Erik Rozendaal2012-01-072-0/+30
| | | | | | | | Also simplified implementation of span to just use splitAt.
| * Renamed object RedBlack to RedBlackTree.Erik Rozendaal2012-01-072-56/+269
| | | | | | | | | | | | This more clearly separates the new implementation from the now deprecated abstract class RedBlack and avoids naming conflicts for the member classes.
| * Restore old RedBlack class to maintain backwards compatibility.Erik Rozendaal2012-01-061-28/+28
| | | | | | | | | | | | | | | | | | 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.
| * Optimize foreach and iterators.Erik Rozendaal2012-01-042-0/+32
| |
| * Use null to represent empty trees. Removed Empty/NonEmpty classes.Erik Rozendaal2012-01-031-56/+56
| |
| * Added some tests for TreeMap/TreeSet.Erik Rozendaal2011-12-282-0/+182
| |
| * Made RedBlack private to the scala.collection.immutable package.Erik Rozendaal2011-12-281-6/+9
| | | | | | | | | | Use ArrayStack instead of Stack in TreeIterator for slightly increased performance.
| * Make sure the redblack test compiles and runs.Erik Rozendaal2011-12-281-40/+36
| |
| |
| \
| \
| \
*---. \ Merge remote-tracking branches 'axel22/issue/5293', ↵Paul Phillips2012-02-157-4/+726
|\ \ \ \ | | | | | | | | | | | | | | | 'szabolcsberecz/synchronized-test' and 'non/si-5005-2' into develop
| | | * | Added test files to verify previous commit.Erik Osheim2012-02-152-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tests scalac -optimize -Xprint:specialize -Ylog:inliner output to verify that final/@inline + specialization are being handled correctly (that is, the original class' specialized methods should not be final/@inline, but its specialized subclass' should be). This test was written by Vlad Ureche based on the bug report in SI-5005.
| | * | | test to check for proper synchronization in generated codeSzabolcs Berecz2012-02-153-0/+578
| |/ / / |/| | |
| * | | Apply the fix for si-5293 to hash maps.Aleksandar Prokopec2012-02-152-4/+92
| |/ / | | | | | | | | | This fix was previously only applied to hash sets.
* | | Merge branch 'develop'Paul Phillips2012-02-15116-168/+371
|\ \ \
| | \ \
| | \ \
| *-. \ \ Merge remote-tracking branches 'scalamacros/pullrequest/preprocessreifees' ↵Paul Phillips2012-02-15116-168/+371
| |\ \ \ \ | | | | | | | | | | | | | | | | | | and 'scalamacros/pullrequest/multilineinterpolation' into develop
| | | * | | Makes multiline interpolation work finelyEugene Burmako2012-02-156-0/+101
| | | | | |
| | * | | | Disables typechecking that precedes reflective compilationEugene Burmako2012-02-14103-181/+180
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously toolboxes used to typecheck their inputs before compiling. Actually, the initial demo by Martin first typechecked the reified tree, then ran it, which typechecked it again, and only then launched the reflective compiler. However, as observed in https://issues.scala-lang.org/browse/SI-5464 current implementation of typechecking is not always idempotent. That's why we cannot allow inputs of toolboxes to be typechecked, at least not until the aforementioned issue is closed. This is not only a convention but also a check inside compileExpr.
| | * | | | Preprocessing for reifeesEugene Burmako2012-02-1423-2/+105
| | |/ / /
* | | | | Test cases which motivated preceding reversions.Paul Phillips2012-02-153-0/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See t5452 for disabled/neg/t5452 and disabled/pos/spurious-overload I give up, review by @hubertp.
* | | | | Revert "Fix for SI-5452."Paul Phillips2012-02-152-35/+0
| | | | | | | | | | | | | | | | | | | | This reverts commit 2b731911e97a281e324060099631e2374b2144ec.
* | | | | Revert "Make fix for SI-5452 not break other things."Paul Phillips2012-02-151-3/+1
|/ / / / | | | | | | | | | | | | This reverts commit a725bf982c06e16c5d533ea6b2227b726db4f7e4.
* | | | Add parallel size computation for ParCtrie.Aleksandar Prokopec2012-02-151-0/+19
| | | | | | | | | | | | | | | | | | | | Also modified size computation for Ctrie so that concurrent `size` invocations can be parallelized more efficiently.
* | | | Add lazy size evaluation to Ctries.Aleksandar Prokopec2012-02-151-0/+34
| | | | | | | | | | | | | | | | | | | | Size of the Ctrie is now cached and only recomputed for those parts of the Ctrie that changed since the last snapshot.
* | | | Add `dup` method to ParCtrie iterators.Aleksandar Prokopec2012-02-151-0/+10
| |/ / |/| |
* | | Merge remote-tracking branch 'paulp/objects-and-overrides'Paul Phillips2012-02-152-0/+225
|\ \ \
| * | | Fix for bad bug with accidental overrides.Paul Phillips2012-02-012-0/+225
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An object in a subclass would silently override an inherited method, then throw a CCE at runtime. I blamed this on matchesType and altered it accordingly. There's a pretty extensive test case which reflects my expectations. Review by @odersky please. Closes SI-5429.
* | | | Specialization action.Paul Phillips2012-02-1419-25/+202
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The crickets at http://www.scala-lang.org/node/11901 were in unanimous agreement that I should proceed as suggested. - No arguments to @specialize gets you 10/10, not 9/10 - Fixed bugs in AnyRef specialization revealed by trying to use it - Specialized Function1 on AnyRef. - Changed AnyRef specialization to use OBJECT_TAG, not TVAR_TAG. - Deprecated SpecializableCompanion in favor of Specializable, which has the virtue of being public so it can be referenced from outside the library. - Cooked up mechanism to group specializable types so we don't have to repeat ourselves quite so much, and create a few groups for illustrative purposes. I'm not too serious about those names but I used up all my name-thinking-up brain for the day. - Updated genprod and friends since I had to regenerate Function1. - Put tests for a bunch of remaining specialization bugs in pending. Closes SI-4740, SI-4770, SI-5267.
* | | | Made speclib less of a maintenance headache.Paul Phillips2012-02-147-196/+326
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now it copies in the current versions of BoxesRunTime and ScalaRunTime and applies patches to them, and the whole build is automated. # This is the only thing I actually typed, the rest is fancy echo. $ test/instrumented/mkinstrumented.sh build % rm -rf /scratch/trunk1/test/instrumented/classes % cp /scratch/trunk1/test/instrumented/../../src/library/scala/runtime/BoxesRunTime.java /scratch/trunk1/test/instrumented/../../src/library/scala/runtime/ScalaRunTime.scala /scratch/trunk1/test/instrumented/library/scala/runtime % patch BoxesRunTime.java /scratch/trunk1/test/instrumented/boxes.patch patching file BoxesRunTime.java % patch ScalaRunTime.scala /scratch/trunk1/test/instrumented/srt.patch patching file ScalaRunTime.scala Hunk #3 succeeded at 63 (offset 23 lines). Hunk #4 succeeded at 78 (offset 23 lines). Hunk #5 succeeded at 81 (offset 23 lines). Hunk #6 succeeded at 96 (offset 23 lines). % /scratch/trunk1/test/instrumented/../../build/pack/bin/scalac -d /scratch/trunk1/test/instrumented/classes /scratch/trunk1/test/instrumented/library/scala/runtime/BoxesRunTime.java /scratch/trunk1/test/instrumented/library/scala/runtime/ScalaRunTime.scala % javac -cp /scratch/trunk1/test/instrumented/../../build/pack/lib/scala-library.jar -d /scratch/trunk1/test/instrumented/classes /scratch/trunk1/test/instrumented/library/scala/runtime/BoxesRunTime.java % cd /scratch/trunk1/test/instrumented/classes % jar cf instrumented.jar . % mv -f instrumented.jar /scratch/trunk1/test/instrumented/../../test/files/speclib /scratch/trunk1/test/files/speclib/instrumented.jar has been created.
* | | Make fix for SI-5452 not break other things.Paul Phillips2012-02-141-1/+3
| | | | | | | | | | | | If this looks hacky, that's because it is.
* | | Fix for SI-5452.Paul Phillips2012-02-132-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why is calling the error function not enough to register the error, why does "setError(tree)" have to be called as well? That was the cause of this particular stackoverflow. In ContextErrors I see lots of methods which call setError and lots more which do not, and frankly it's all pretty terrifying. There is zero documentation attached to setError. Maybe there's an explanation somewhere I'm not seeing. Review by @hubertp.
* | | Fix for SI-5444.Paul Phillips2012-02-131-0/+42
| | | | | | | | | | | | | | | Fix for trait/impl renaming in 5cbd7d06eb was incomplete. Looks more complete now.
* | | Merge branch 'master' into developPaul Phillips2012-02-132-0/+239
|\ \ \
| * | | Existential printing, plus more compiler testing infrastructure.Paul Phillips2012-02-132-0/+239
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Direct compiler internals testing. It's really easy, you should probably use it about 1000 times each. Look at the test: run/existentials-in-compiler.scala The checkfile contains the (string representations of the) actual existentials from the compiler to make sure they correspond properly to the ones in the source. Existentials were being printed with wildcards too freely; this has been tightened up.
* | | | Merge remote-tracking branches 'scalamacros/pullrequest/5453' and ↵Paul Phillips2012-02-1315-1/+92
|\ \ \ \ | | | | | | | | | | | | | | | 'scalamacros/pullrequest/5229' into develop
| * | | | Fixes https://issues.scala-lang.org/browse/SI-5229Eugene Burmako2012-02-1415-1/+92
| |/ / /
* / / / Fixes https://issues.scala-lang.org/browse/SI-5453Eugene Burmako2012-02-131-1/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally we thought that macros declared inside objects should not provide _this to their bodies. However, it: 1) contradicts vanilla Scala rules, according to which both class and object methods can use this, 2) imposes unnecessary burden on macro developers without providing any conveniences to us. Review by @odersky.
* | | reifyAnnotationsEugene Burmako2012-02-1225-34/+304
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Annotations are now supported by the reifier: * AnnotationInfos from symbols get transformed back into mods. * AnnotatedTypes are retained and are reified along with AnnotationInfos. Reification is no magic, and reification of annotations especially: * Annotations cannot refer to symbols defined inside the quasiquote. This restriction is due to the fact that we need to erase locally defined symbols before reifying to make subsequent reflective compilations succeed. However, while doing that, we also need to make sure that we don't make resulting ASTs non-compilable by removing essential information. This is tricky, and it more or less works for TypeTrees, but not for annotations that can contain arbitrary ASTs. For more details look into the comments to Reifiers.scala. * Classfile annotations that contain array arguments and are applied to types, i.e. the ones that generate AnnotatedTypes, cannot be reified. This is because of limitations of manifest infrastructure. Typechecking "Array(mirror.LiteralAnnotArg(...))" would require the compiler to produce a manifest for a path-dependent type, which cannot be done now. Review by @odersky.
* | | Updated existentials test with non-working parts.Paul Phillips2012-02-121-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lazy accessors have the same essential problem as described in recent commit messages, so this still doesn't work: def f() = { case class Bob(); Bob } ; lazy val g = f On the whole I'm trying to solve this at the wrong level. The derived accessor methods and fields of a declaration should not ever wander far enough apart that there is any challenge in reconciling them. (The same is true for case classes/objects.) They're dependent synthetics who know about one another from the beginning, all we have to do is not forget. In the meantime, test case.
* | | Fix for overly suppressive repl.Paul Phillips2012-02-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | At some point in the past, trying to prevent deprection warnings from being issue in triplicate in the repl, I suppressed too much output, leading to a class of breakdowns where the failure would be swallowed completely. This went on for far too long. The deprecation warnings are back in triplicate for the moment, but the repl should now be less "strong, silent type" and more emo.
* | | Another existential problem down.Paul Phillips2012-02-119-95/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a window of danger when multiple related elements are being typed where something which is conceptually one thing can slip into two things, and those two things can be incompatible with one another. Less mysteriously, c478eb770d fixed this: def f = { object Bob ; Bob } ; val g = f But, it did not fix this: def f = { case class Bob() ; Bob } ; val g = f See test case pos/existentials-harmful.scala for an "in the wild" code example fixed by this commit. The root of the problem was that the getter and the field would each independently derive the same existential type to describe Bob, but those existentials were not the same as one another. This has been the most elusive bug I have ever fixed. I want to cry when I think of how much time I've put into it over the past half decade or so. Unfortunately the way the repl works it is particularly good at eliciting those grotesque found/required error messages and so I was never able to let the thing go. There is still a cosmetic issue (from the last commit really) where compound types wind up with repeated parents. Closes SI-1195, SI-1201.
* | | Overcame long-maddening existential issue.Paul Phillips2012-02-104-0/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When performing an existential transform, the bounds produced by the hidden symbols may contain references to the hidden symbols, but these references were not accounted for. This was at the root of some bad behavior with existentials. If you've ever seen a message like this: <console>:8: error: type mismatch; found : B(in value res0) where type B(in value res0) <: A with ScalaObject required: B(in value res0) forSome { type B(in value res0) <: A with ScalaObject; type A <: Object with ScalaObject } ...then you know what I mean. Closes SI-4171, not quite yet on SI-1195, SI-1201.
* | | Failing tests for pending.Paul Phillips2012-02-103-0/+43
| | |
* | | Scaladoc @usecase annotation overriding / SI-5287Vlad Ureche2012-02-063-34/+253
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From now on, the usecases inherit the comments from their parents, such as the explanation and the annotations: @param, @tparam, @return, etc. An example of usecase comment inheritance is: /** * The test function tests the parameter param for ... * * @param theParam the implicit parameter to be tested for ... * @return the result of the test * * * * @usecase def test(): Bool * * The test function tests the parameter taken implicitly from scope. * Example: `test()` * * @return the result of the test for the current scope * * * * @usecase def test(theParam: SomeType): Bool * * This takes the explicit value passed. * Example: `test(3)` * * @param theParam the explicit parameter to be tested for ... */ def test(implicit theParam: SomeType): Bool Notice both usecases override the explanation with their own examples. The first usecase also overrides the "@return" annotation while the 2nd usecase overrides the "@param theParam" annotation. If they didn't override the explanations and annotations, they would inherit the values from the actual implementation, def test(implicit ...) This will be followed by @inheritdoc, which enables more fine-grained control over comment inheritance. The full explanation of using comment inheritance and @inheritdoc and their interaction with variables is given at https://wiki.scala-lang.org/display/SW/Tags+and+Annotations in the "Comment inheritance" and "Inheritance Example" sections.
* | | Merge branch 'master' into feature/pc-ctrieAleksandar Prokopec2012-02-06133-197/+699
|\ \ \
| * | | Revert "Scaladoc @usecase annotation overriding / SI-5287"Paul Phillips2012-02-053-253/+34
| | | | | | | | | | | | | | | | This reverts commit 7946ac410ad74894cd0eb6dfd29447f173911b99.