summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* 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.
| * Refining the reflection api.Paul Phillips2012-02-052-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the pursuit of simplicity and consistency. - Method names like getType, getClass, and getValue are far too ambiguous, both internally and especially with java reflection names. Methods which accept or return scala symbols should not refer to them as "classes" in the reflection library. (We can live with the FooClass convention for naming the well-known symbols, it's names like "getClass" and "classToType" which are needlessly conflationary.) - Meaningless names like "subst" have to be expanded. - We should hew closely to the terms which are used by scala programmers wherever possible, thus using "thisType" to mean "C.this" can only beget confusion, given that "thisType" doesn't mean "this.type" but what is normally called the "self type." - It's either "enclosing" or "encl", not both, and similar consistency issues. - Eliminated getAnnotations. - Removed what I could get away with from the API; would like to push those which are presently justified as being "required for LiftCode" out of the core. - Changed a number of AnyRefs to Any both on general principles and because before long it may actually matter. - There are !!!s scattered all over this commit, mostly where I think the name could be better. - I think we should standardize on method names like "vmSignature, vmClass" etc. when we are talking about jvm (and ostensibly other vm) things. There are a bunch more places to make this distinction clear (e.g. Symbol's javaBinaryName, etc.) - There is a lot more I want to do on this and I don't know where the time will come from to do it. Review by @odersky, @scalamacros.
| *-----. Merge remote-tracking branches 'VladUreche/feature/compiler-rootdoc', ↵Paul Phillips2012-02-0512-39/+281
| |\ \ \ \ | | | | | | | | | | | | | | | | | | 'scalamacros/pullrequest/5334', 'scalamacros/pullrequest/5272' and 'VladUreche/issue/5287-cleanup' into develop
| | | | | * Scaladoc @usecase annotation overriding / SI-5287Vlad Ureche2012-02-053-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.
| | | | * Fixes https://issues.scala-lang.org/browse/SI-5272Eugene Burmako2012-02-055-1/+18
| | |_|/ | |/| |
| | | * Fixes https://issues.scala-lang.org/browse/SI-5334Eugene Burmako2012-02-054-4/+10
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | New version of reification isn't susceptible to this bug. The problem was with Code.lift generating not only a tree, but also a manifest with the type of that tree. That led to an issue in the case of the type of the manifest depending on a class declared inside the quasiquote. Now manifests in reification are gone, so is the problem.
| * | Replaced LiftCode with a function in MacroContextEugene Burmako2012-02-0520-171/+46
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Major cleanup of reification: * LiftCode phase has been removed * Code has been deprecated and will be removed as we roll a new starr * Logic related to type-directed lifting has been purged scala.reflect.macro.Context#reify now provides the same services as LiftCode provided (except that it returns Tree, not Code). For testing purposes, I've retained the oh-so-convenient automagic lift. test/files/codelib/code.jar now hosts Code.lift reimplemented in a macro, so that the tests can continue working as if nothing has happened.
| * Updated Flags toString/documentation.Paul Phillips2012-02-028-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | In a stunningly unusual demonstration of farsightedness, I was able to generate these changes only by running: scala scala.tools.nsc.util.FlagsUtilCompiler With this much time in between runs: -// Generated by mkFlagsTable() at Mon Oct 11 10:01:09 PDT 2010 +// Generated by mkFlagsTable() at Thu Feb 02 20:31:52 PST 2012
| * Merge commit 'c58b240' into developPaul Phillips2012-02-023-0/+54
| |\
| | * [vpm] __match determines match semantics; virtualizationAdriaan Moors2012-02-023-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | determine match strategy by typing `__match` factored out the interface to generate code in this monad, cleaned up codegen a bit no longer solving a context bound to determine the match strategy and the monad's type constructor it's too expensive don't consider implicits looking for __match implicit search causes HUGE slowdowns -- now the overhead is about 4% compared to just assuming there's no __match in scope to support virtualization&staging, we use the type of `__match.one` as the prototype for how to wrap "pure" types and types "in the monad" pure types T are wrapped as P[T], and T goes into the monad as M[T], if one is defined as: def one[T](x: P[T]): M[T] for staging, P will typically be the Rep type constructor, and type M[T] = Rep[Option[T]] furthermore, naive codegen no longer supplies type information -- type inference will have to work it out optimized codegen still does, of course, and that's enough since we only bootstrap that way TODO: improve the test (currently the condition is not represented)
| * | Fixes reifyThisEugene Burmako2012-02-0230-2/+2
| | |
| * | Miscellaneous fixes to reificationEugene Burmako2012-02-0243-2/+269
| |/ | | | | | | | | | | | | | | More specifically: * Importers now preserve wasEmpty and original * ToolBoxes no longer auto-evaluate nullary functions returned by runExpr * All local symbols from previous typechecks are now correctly erased by ResetAttrs * Originals are now reified
| *-. Merge remote-tracking branches 'scalamacros/pullrequest/5258' and ↵Paul Phillips2012-02-0122-0/+169
| |\ \ | | | | | | | | | | | | 'scalamacros/pullrequest/5256' into develop
| | | * Hardens classToType logicEugene Burmako2012-02-0116-0/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reflection now correctly processes classes, objects and inner classes that are declared in classes and objects. However classToType still crashes on compound types and local classes. For more information on those, follow the links: * Compound types: https://issues.scala-lang.org/browse/SI-5430 * Local classes: https://issues.scala-lang.org/browse/SI-5431 Fixes https://issues.scala-lang.org/browse/SI-5256. Review by @paulp, @odersky.
| | * | Hardens reification against rare kinds of ConstantsEugene Burmako2012-02-016-0/+47
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | Importers now correctly process constants that carry types and symbols. However, it is still impossible to reify classOf for a class/trait that is defined inside a quasiquote. Theoretically, this can be implemented, but will require attaching original trees to classOf constants, which needs much more effort.
| * / Fix for parser OOM.Paul Phillips2012-02-012-0/+6
| |/ | | | | | | | | | | | | | | | | | | | | | | The scanner performs some sketchy heuristics when it sees an ascii 1A since it may be EOF or it may be part of a literal. Due to this, it failed to detect an unterminated string literal if the opening quote was unicode-escaped, leading to memory exhaustion as it read SUs until the universe ended. We're parsing a fixed input with known length! There's no reason to be guessing about whether a char is EOF. If we're at the end of the file, it's the end of file. Otherwise, it is not the end of the file.
| *---. Merge remote-tracking branches 'gkossakowski/virtpatmat-switch', ↵Paul Phillips2012-02-0113-0/+102
| |\ \ \ | | | | | | | | | | | | | | | 'scalamacros/pullrequest/5427' and 'scalamacros/pullrequest/5423' into develop
| | | | * Introduce getAnnotations that triggers symbol completionEugene Burmako2012-01-312-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Default getter for annotations doesn't perform initialization, hence we've faced the following bug: https://issues.scala-lang.org/browse/SI-5423. One of the approaches to fixing it would be to auto-complete on getter, but according to Martin we'd better not do that because of cycles. That's why I'm just introducing a new, eager, variation of `annotations' and redirecting public API to it. Review by @odersky.
| | | * | Tests for https://issues.scala-lang.org/browse/SI-5427Eugene Burmako2012-02-018-0/+49
| | | |/
| | * | Added a test-case for switches with Yvirtpatmat.Grzegorz Kossakowski2012-02-013-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added a bunch of tests that cover changes related to switches that were applied to Yvirtpatmat implementation. Note: I didn't add those tests progressively because my changes fix trees after typer phase but do not affect resulting bytecode. How come? It's because -Yvirtpatmat will emit pattern for switches and then the old pattern matcher implementation would transform them in the old fashion in explicitouter. We cannot disable the old pattern matcher in explicitouter yet because it doesn't handle patterns used for catching exceptions. Thus, consider this as a sign of the fact that Yvirtpatmat is still work in progress.
| * | | Fix for slice boundary condition.Paul Phillips2012-02-012-0/+6
| |/ / | | | | | | | | | | | | Negative "to" index should be normalized to 0 before using it in a difference operation.
* | | Add tests for parallel Ctrie.Aleksandar Prokopec2012-02-036-16/+126
| | | | | | | | | | | | Changed parameters in some tests to speed them up.
* | | Fix some issues in parallel Ctrie.Aleksandar Prokopec2012-02-032-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change resolves some issues with ParCtrie splitters and their `remaining` method, which currently evaluates the size of the Ctrie. Since this is still not done lazily, nor in parallel, it has a certain cost, which is unacceptable. Change #1: The `shouldSplitFurther` method is by default implemented by calling the `remaining` method. This method now forwards the call to the same method in the splitter which is by default implemented in the same way as before, but can be overridden by custom collections such as the ParCtrie. Change #2: ParCtrie splitter now has a `level` member which just counts how many times the method has been split. This information is used to override the default `shouldSplitFurther` implementation. Change #3: The tasks and splitters rely heavily on the `remaining` method in the splitter for most operations. There is an additional method called `isRemainingCheap` which returns true by default, but can be overridden by custom collections such as the `Ctrie`.
* | | Incorporate Ctrie into standard library.Aleksandar Prokopec2012-02-023-2/+14
| | | | | | | | | | | | Implemented Ctrie serialization. Improved hashcode computation.
* | | Add the Ctrie concurrent map implementation.Aleksandar Prokopec2012-02-018-0/+1040
|/ / | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Test case closes SI-5352.Paul Phillips2012-01-313-0/+29
| |
* | Improved warning for insensible comparisons.Paul Phillips2012-01-314-1/+28
|/ | | | | Utilize knowledge of case class synthetic equals to rule out some comparisons statically. Closes SI-5426.
*-. Merge remote-tracking branches 'axel22/issue/4147', 'axel22/issue/5374' and ↵Paul Phillips2012-01-301-0/+19
|\ \ | | | | | | | | | 'hubertp/ticket/4336' into develop
| | * Closes #4336.Hubert Plociniczak2012-01-301-0/+19
| |/ | | | | | | Some of the type params might already be instantiated if explicit type application is done. Review by @adriaanm
* | Fixed the benchmarks a bit.aleksandar2012-01-303-18/+27
| |
* | Merge pull request #1 from lpereir4/avlAleksandar Prokopec2012-01-306-0/+442
|\ \ | |/ |/| AvlTree performance improvements
| * Scalacheck test in order to ensure AVL invariants are respected.Lucien Pereira2012-01-281-0/+114
| |
| * Added benchmarking files, in order to easily compare variousLucien Pereira2012-01-285-0/+328
| | | | | | | | implementations performances.
| |
| \
*-. \ Merge remote-tracking branches 'scalamacros/topic/yshowsymkinds' and ↵Paul Phillips2012-01-292-0/+14
|\ \ \ | | | | | | | | | | | | 'scalamacros/ticket/5418' into develop
| | * | Test for https://issues.scala-lang.org/browse/SI-5418Eugene Burmako2012-01-292-0/+14
| |/ /
* | | Test case closes SI-4515.Paul Phillips2012-01-292-0/+47
| | |
* | | Bonus test case for SI-3999.Paul Phillips2012-01-281-0/+20
| | |
* | | Test case closes SI-3854.Paul Phillips2012-01-272-0/+20
| | |
| | |
| \ \
*-. \ \ Merge remote-tracking branches 'scalamacros/topic/yshowsymkinds' and ↵Paul Phillips2012-01-271-15/+15
|\ \ \ \ | | |/ / | |/| | | | | | 'axel22/feature/immutable-thread-safe' into develop
| | * | Set fields in immutable hash maps and hash sets to vals.aleksandar2012-01-261-15/+15
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Disabled "not found" suggestions.Paul Phillips2012-01-263-5/+5
| | | | | | | | | | | | | | | The benchmarks charts are confusing me and I want to rule it out as a problem by not having it exist for a while.
* | | Fix for recently induced -optimise crasher.Paul Phillips2012-01-262-0/+19
|/ / | | | | | | | | | | "Induced" but not in my estimation "caused". Would like to understand why the enclosed test case crashes under -optimise without this change to AddInterfaces.
| |
| \
*-. \ Merge remote-tracking branches 'axel22/issue/5374' and 'axel22/issue/5375' ↵Paul Phillips2012-01-254-10/+67
|\ \ \ | | | | | | | | | | | | into develop
| | * | Fix for SI-5375.aleksandar2012-01-252-0/+20
| | | | | | | | | | | | | | | | | | | | Changed CompositeThrowable to inherit Exception instead of Throwable. A few minor fixes for the jdk1.5 parallel collection tasks.
| * | | Refine fix for SI-5374 - make list deserialization backward-compatible.aleksandar2012-01-252-10/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is done by structurally serializing list nodes, but prepending a special `ListSerializationStart` symbol ahead of the list. If this symbol is not in the object input stream, the deserialization reverts to the old mode. Note there is not much to be done for list buffers - their serialization was broken before, so legacy serialized list buffers are no longer deserializable. However, their serialVersionUID was changed to reflect this, so deserializing a legacy list buffer should fail fast.
* | | | Merge remote-tracking branch 'odersky/topic/reflect' into developPaul Phillips2012-01-251-8/+8
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/compiler/scala/reflect/internal/Symbols.scala src/compiler/scala/reflect/internal/Types.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala src/library/scala/reflect/api/Trees.scala