summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #4357 from retronym/merge/2.10.x-to-2.11.x-20150224v2.11.6Adriaan Moors2015-02-243-8/+81
|\ | | | | Merge 2.10.x to 2.11.x
| * Merge commit 'ad845ff' into merge/2.10.x-to-2.11.x-20150224Jason Zaugg2015-02-243-8/+81
| |\ | | | | | | | | | | | | | | | Conflicts: src/library/scala/concurrent/Promise.scala test/files/jvm/future-spec/PromiseTests.scala
| | * Merge pull request #4289 from retronym/ticket/8689Grzegorz Kossakowski2015-02-153-9/+82
| | |\ | | | | | | | | SI-8689 Avoid internal error in Promise after sequence of completions
| | | * SI-8689 Avoid internal error in Promise after sequence of completionsViktor Klang2015-02-043-9/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling `completeWith` when the `DefaultPromise` is already completed, leads to callbacks not being properly executed. This happened because `Future.InternalCallbackExecutor` extends `BatchingExecutor`[1] which assumes `unbatchedExecute` to be async, when in this case it is sync, and if there is an exception thrown by executing the batch, it creates a new batch with the remaining items from the current batch and submits that to `unbatchedExecute` and then rethrows, but if you have a sync `unbatchedExecute`, it will fail since it is not reentrant, as witnessed by the failed `require` as reported in this issue. This commit avoids problem by delegating `completeWith` to `tryComplete`, which has the effect of using `onComplete` + `tryComplete` i.s.o. `complete`, which means that when it fails (because of a benign race condition between completers) it won't throw an exception. It has been tested by the minimized reproducer. [1] Actually, in the 2.10.x branch where this patch is starting out, "The BatchingExecutor trait had to be inlined into InternalCallbackExecutor for binary compatibility.". This comment will be more literally correct in the context of 2.11.x and beyond
| | * | Backported fix for SI-7753 to 2.10.x.Miles Sabin2015-02-094-3/+68
| | |/
| | * Merge pull request #3998 from retronym/backport/7756Grzegorz Kossakowski2014-09-247-0/+42
| | |\ | | | | | | | | [backport] SI-7756 Uncripple refchecks in case bodies
| | | * [backport] SI-7756 Uncripple refchecks in case bodiesJason Zaugg2014-09-237-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 65340ed4ad2e, parts of RefChecks were disabled when we traversed into the results of the new pattern matcher. Similar logic existed for the old pattern matcher, but in that case the Match / CaseDef nodes still existed in the tree. The new approach was too broad: important checks no longer scrutinized the body of cases. This commit turns the checks back on when it finds the remnants of a case body, which appears as an application to a label def. Conflicts: src/compiler/scala/tools/nsc/typechecker/RefChecks.scala Cherry pick of 3df1d77fc984b976efa68098206e801cf3b83a9e
| | * | Merge pull request #3859 from xeno-by/topic/fundep-materialization-210xGrzegorz Kossakowski2014-09-1117-0/+185
| | |\ \ | | | | | | | | | | [backport] SI-7470 implements fundep materialization
| | | * | -Xfundep-materialization => -Yfundep-materializationEugene Burmako2014-09-092-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To quote gkossakowski: Thinking about it more, could we hide this behind 'Y' flag instead? We have lesser obligation to keep around Y flags and this is something we should remove from 2.11/2.12.
| | | * | [backport] SI-7470 implements fundep materializationEugene Burmako2014-07-0217-0/+185
| | | | | | | | | | | | | | | | | | | | | | | | | Backports 21a8c6c from the 2.11.x branch under -Xfundep-materialization as per Miles Sabin's request. Thanks Miles!
| | * | | Merge pull request #3865 from xeno-by/topic/extractor-macros-210xGrzegorz Kossakowski2014-08-193-0/+50
| | |\ \ \ | | | | | | | | | | | | [backport] transformers no longer ignore UnApply.fun
| | | * | | [backport] transformers no longer ignore UnApply.funEugene Burmako2014-07-033-0/+50
| | | |/ / | | | | | | | | | | | | | | | Backports 7122560063 and 4133eb8454 from the 2.11.x branch
* | | | | fixes pluginsEnterStatsEugene Burmako2015-02-222-0/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Initial implementation of pluginsEnterStats was incorrect, because I got the foldLeft wrong, making it perpetuate the initial value of stats. This worked fine if zero or one macro plugins were active at a time, but broke down if there were multiple of such plugins (concretely, I discovered this issue when trying to marry macro paradise with scalahost).
* | | | | SI-9126 Missing .seqs causes problems with parallel GenXsRex Kerr2015-02-202-20/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added `.seq` in two essential places so that a parallel collection passed as an argument won't mess up side-effecting sequential computations in `List.flatMap` and `GenericTraversableTemplate.transpose` (thanks to retronym for finding the danger spots). Tests that `.seq` is called by constructing a `GenSeq` whose `.seq` disagrees with anything non-`.seq` (idea & working implementation from retronym). Also updates the `.seq` test for `Vector#++` to use the new more efficient method.
* | | | | Merge pull request #4347 from retronym/ticket/8801Adriaan Moors2015-02-191-0/+21
|\ \ \ \ \ | |/ / / / |/| | | | SI-8801 Another test for fixed exponential-time compilation
| * | | | SI-8801 Another test for fixed exponential-time compilationJason Zaugg2015-02-201-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Turns out that SI-9157 was a duplicate of SI-8801. This commit adds Paul's test, whose compile time is now back in the troposphere. % time qscalac test/files/pos/t8801.scala real 0m1.294s user 0m3.978s sys 0m0.240s
* | | | | Merge pull request #4340 from retronym/topic/infix-completionAdriaan Moors2015-02-196-0/+412
|\ \ \ \ \ | | | | | | | | | | | | SI-9153 More complete and stable results for completions
| * | | | | Remove incorrect completions: implicits can't add type membersJason Zaugg2015-02-172-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The checkfile of the tests added in the last commit offered a type member from `RichInt` in the completions for the type `Int`. However, only term members can be extension methods; type members cannot.
| * | | | | SI-9153 More complete and stable results for completionsJason Zaugg2015-02-176-0/+414
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Three items of background are needed to understand this bug. 1. When typechecking an application like `qual.m({stats; expr})`, the argument is typechecked using the formal parameter type of `m` as the expected type. If this fails with a type error located within in `expr`, the typer instead re-typechecks under `ContextMode.ReTyping` without an expected type, and then searches for an implicit adaptation to enable `view(qual).m(args)`. Under this mode, `Typer#typed1` clears the type of incoming trees. 2. The presentation compiler performs targetted operations like type completions by: - typechecking the enclosing tree, registering all typechecker `Context`s created in the process (`registerContext`) - finding the smallest enclosing `Context` around the target position (`doLocateContext`) - Using this context to perform implicit search, which can contribute members to the completion. (`applicableViews` within `interactive.Global#typeMembers`) 3. When verifiying whether or not a candidate implicit is applicable as a view from `F => T`, implicit search typechecks a dummy call of the form `q"candiate(${Ident("<argument>").setType(typeOf[F])})". Now, picture yourself at the nexus of these three storms. In the enclosed test case, we search for completions at: x + 1.<caret> 1. Because the code is incomplete, the application of `Int#+` doesn't typecheck, and the typer also tries to adapt `x` to a method applicable to the re-typechecked argument. 2. This process registers a context with `retypechecking` set to true. (If multiple contexts at the same position are registered, the last one wins.) 3. Implicit search uses this context to typecheck `Predef.Ensuring(<argument>.setType(Int))`, but the argument is promptly stripped of its type and retypechecking fails as there is no definition named `<argument>` in scope. As such, we missed out on extension methods, like `ensuring` in the list of completions. This commit changes the presentation compiler to turn off retyping mode in the context before starting to work with it. (Are the other modes that might cause similar bugs?) Once I made that change, I noticed that the results the enclosed test was not stable. I tracked this down to the use of a `HashMap` to carry the applicable implicit views, together with the way that the presentation compiler removes duplicates. This commit switched to a `LinkedHashMap`.
* | | | | | Merge pull request #4330 from Ichoran/issue/8917Adriaan Moors2015-02-191-0/+9
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-8917 collection.mutable.BitSet's &= operator doesn't clear end
| * | | | | | SI-8917 collection.mutable.BitSet's &= operator doesn't clear endRex Kerr2015-02-131-0/+9
| |/ / / / / | | | | | | | | | | | | | | | | | | Made &= run to the end of its own bitset, ignoring the size of what it's &-ing with (which is exactly what you want for &=).
* | | | | | Merge pull request #4319 from axel22/fix-si-7943Adriaan Moors2015-02-191-0/+19
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fix SI-7943 -- make `TrieMap.getOrElseUpdate` atomic.
| * | | | | | Fix SI-7943 -- make `TrieMap.getOrElseUpdate` atomic.Aleksandar Prokopec2015-02-181-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Override `getOrElseUpdate` method in `TrieMap`. The signature and contract of this method corresponds closely to the `computeIfAbsent` from `java.util.concurrent.ConcurrentMap`. Eventually, `computeIfAbsent` should be added to `scala.collection.concurrent.Map`. Add tests. Review by @Ichoran
* | | | | | | Fix the Scaladoc tests under Java 8Jason Zaugg2015-02-191-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Partest seems to require a second copy of the `filters` find in the root of the Scaladoc tests. This file ignores JVM-specific console output, like everone's favourite nag: Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256M; support was removed in 8.0 Not sure what changed to make this necessary, maybe a partest upgrade? The first failing build was on Feb 14: https://scala-webapps.epfl.ch/jenkins/view/2.N.x/job/scala-nightly-auxjvm-2.11.x/287/
* | | | | | | Merge pull request #4329 from adriaanm/followup-4235Adriaan Moors2015-02-181-0/+29
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Simpler & Scala.js-friendly `ClassTag.unapply`
| * | | | | | | Use if/then/else to avoid box(unbox(_))Adriaan Moors2015-02-181-0/+29
| | | | | | | |
* | | | | | | | Merge pull request #4309 from som-snytt/issue/9116-bAdriaan Moors2015-02-182-3/+9
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-9116 Set.subsets has a param list
| * | | | | | | | SI-9116 Set.subsets has a param listSom Snytt2015-02-092-3/+9
| | |/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now both of the overloaded variants have a parameter list. This seems to make type inference happier. Or it makes someone happier. The user is unaware whether `subsets()` takes a default arg. But happily, empty application still kicks in.
* | | | | | | | Merge pull request #4341 from retronym/ticket/9157Adriaan Moors2015-02-181-0/+13
|\ \ \ \ \ \ \ \ | | |_|_|/ / / / | |/| | | | | | SI-9157 Avoid exponential blowup with chained type projections
| * | | | | | | SI-9157 Avoid exponential blowup with chained type projectionsJason Zaugg2015-02-181-0/+13
| | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling `findMember` in the enclosed test was calling into `NonClassTypeRef#relativeInfo` an exponentially-increasing number of times, with respect to the length of the chained type projections. The numbers of calls increased as: 26, 326, 3336, 33446, 334556. Can any pattern spotters in the crowd that can identify the sequence? (I can't.) Tracing the calls saw we were computing the same `memberType` repeatedly. This part of the method was not guarded by the cache. I have changed the method to use the standard idiom of using the current period for cache invalidation. The enclosed test now compiles promptly, rather than in geological time.
* | | | | | | Merge pull request #4328 from adriaanm/rework-4230Adriaan Moors2015-02-171-0/+15
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | SI-9059 Random.alphanumeric is inefficient
| * | | | | | SI-9059 Random.alphanumeric is inefficientDenton Cockburn2015-02-131-0/+15
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generate alphanumeric values by taking random element of string containing all alphanumerics. Instead of generating nextPrintableChar then filtering for alphanumerics, we can just take from a string containing all alphanumerics. This provides a significant performance improvement.
* | | | | | Merge pull request #4296 from lrytz/t9105Adriaan Moors2015-02-137-27/+483
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fixes and tests for InnerClass / EnclsoingMethod classfile attributes
| * | | | | | Test java reflection on scala library / reflect / compiler jarsLukas Rytz2015-02-071-0/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Run a number of Java reflection operations on all classes in scala library / reflect / compiler. The test is based on a draft by Jason.
| * | | | | | Fix InnerClass / EnclosingMethod for closures nested in value classesLukas Rytz2015-02-074-13/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Members of value classes are moved over to the companion object early. This change ensures that closure classes nested in value classes appear that way to Java reflection. This commit also changes the EnclosingMethod attribute for classes (and anonymous functions) nested in anonymous function bodies. Before, the enclosing method was in some cases the function's apply method. Not always though: () => { class C ... val a = { class D ...} } The class C used to be nested in the function's apply method, but not D, because the value definition for a was lifted out of the apply. After this commit, we uniformly set the enclosing method of classes nested in function bodies to `null`. This is consistent with the source-level view of the code. Note that under delambdafy:method, closures never appear as enclosing classes (this didn't change in this commit).
| * | | | | | Fix InnerClass/EnclosingMethod for trait impl and specialized classesLukas Rytz2015-02-072-2/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Trait implementation classes and specialized classes are always considered top-level in terms of the InnerClass / EnclosingMethod attributes. These attributes describe source-level properties, and such classes are a compilation artifact. Note that the same is true for delambdafy:method closure classes (they are always top-level).
| * | | | | | SI-9124 fix EnclosingMethod of classes nested in implOnly trait defsLukas Rytz2015-02-072-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Private trait methods are not added to the generated interface, they end up only in the implementation class. For classes nested in such methods, the EnclosingMethod attribute was incorrect. Since the EnclosingMethod attribute expresses a source-level property, but the actual enclosing method does not exist in the bytecode, we set the enclosing method to null.
| * | | | | | SI-9105 Fix EnclosingMethod for classes defined in lambdasLukas Rytz2015-02-075-19/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change fixes both GenASM and GenBCode, except for the change to renaming in LamdaLift mentioned below. The reason for an inconsistent EnclosingMethod attribute was the symbol owner chain. Initially, closure class symbols don't exist, they are only created in UnCurry (delambdafy:inline). So walking the originalOwner of a definition does not yield closure classes. The commit also fixes uses of isAnonymousClass, isAnonymousFunction and isDelambdafyFunction in two ways: 1. by phase-travelling to an early phase. after flatten, the name includes the name of outer classes, so the properties may become accidentally true (they check for a substring in the name) 2. by ensuring that the (destructive) renames during LambdaLift don't make the above properties accidentally true. This was in fact the cause for SI-8900.
* | | | | | | Merge pull request #4304 from adriaanm/rebase-4219Adriaan Moors2015-02-132-17/+16
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | SI-8818 FreshName extractor forgives suffix
| * | | | | | SI-8818 FreshName extractor forgives suffixSom Snytt2015-02-092-17/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test is corrected (inverted) and the extractor is made more succinct. Succinctness isn't enforced by the test, but I checked it manually.
* | | | | | | Merge pull request #4195 from lrytz/t8841Adriaan Moors2015-02-136-11/+52
|\ \ \ \ \ \ \ | |_|_|/ / / / |/| | | | | | SI-8841 report named arg / assignment ambiguity also in silent mode.
| * | | | | | SI-8841 report named arg / assignment ambiguity also in silent mode.Lukas Rytz2014-12-126-11/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For local definitions (eg. in a block that is an argument of a method call), the type completer may have a silent context. A CyclicReference is then not thrown but transformed into a NormalTypeError. When deciding if 'x = e' is an assignment or a named arg, we need to report cyclic references, but not other type errors. In the above case, the cyclic reference was not reported. Also makes sure that warnings are printed after typing argument expressions.
* | | | | | | Merge pull request #4263 from lrytz/t9097Adriaan Moors2015-02-091-0/+34
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-9097 Remove spurious warning about conflicting filenames
| * | | | | | | SI-9097 Consolidate testSom Snytt2015-01-203-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `pos` test is subsumed by `run`.
| * | | | | | | SI-9097 Remove spurious warning about conflicting filenamesLukas Rytz2015-01-203-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using delambdafy:method, closure classes are generated late. The class is added to a map and integrated into the PackageDef in transformStats. When declaring a package object, there are potentially multiple PackageDefs for the same package. In this case, the closure class was added to all of them. As a result, GenASM / GenBCode would run multiple times on the closure class. In GenBCode this would trigger a warning about conflicting filenames.
* | | | | | | | Merge pull request #4280 from kanielc/SI-9095Adriaan Moors2015-02-092-0/+50
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-9095 Memory leak in LinkedHasMap and LinkedHashSet
| * | | | | | | | SI-9095 Memory leak in LinkedHasMap and LinkedHashSetDenton Cockburn2015-01-312-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The clear() method in scala.collection.mutable.LinkedHashSet and scala.collection.mutable.LinkedHashMap does not set lastEntry to null. In result it holds a reference to an object that was removed from the collection.
* | | | | | | | | Merge pull request #4209 from kanielc/SI-8988Adriaan Moors2015-02-091-0/+37
|\ \ \ \ \ \ \ \ \ | |_|_|_|/ / / / / |/| | | | | | | | SI-8988 Escaping character in StringLike.split(c) is slow
| * | | | | | | | SI-8988 Escaping character in StringLike.split(c) prevents usage of ↵Denton Cockburn2015-01-091-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | optimized String.split code path Escaping a char when calling split is slow. We end up compiling a Pattern to simply match a character literal. Instead, we just use an loop with indexOf to construct our resulting Array. Current speed up over old behaviour is about 12-1
* | | | | | | | | Merge pull request #4288 from adriaanm/retronym-ticket/9041Adriaan Moors2015-02-092-0/+21
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-9041 Avoid unreported type error with overloading, implicits