summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* SI-8689 Avoid internal error in Promise after sequence of completionsViktor Klang2015-02-044-14/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Merge pull request #4290 from adriaanm/2.10.xJason Zaugg2015-02-047-0/+856
|\ | | | | New CI validation scripts
| * New CI validation scriptsAdriaan Moors2015-02-037-0/+856
|/ | | | | | | | | | Currently not validating the IDE, pending fix for https://github.com/scala-ide/uber-build/issues/48. The new infrastructure is documented over at: - https://github.com/scala/scabot - https://github.com/scala/scala-jenkins-infra - [jenkins jobs definitions](https://github.com/scala/scala-jenkins-infra/tree/master/templates/default/jobs/validate)
* Merge pull request #4186 from som-snytt/issue/9027-backportGrzegorz Kossakowski2014-12-083-6/+16
|\ | | | | SI-9027 Backport xml parser fix
| * SI-9027 Backport xml parser fixSom Snytt2014-12-043-6/+16
|/ | | | | | Fingers crossed, I have no local java 6 here to test. No test because no q"" on 2.10.
* Merge pull request #3998 from retronym/backport/7756Grzegorz Kossakowski2014-09-248-8/+69
|\ | | | | [backport] SI-7756 Uncripple refchecks in case bodies
| * [backport] SI-7756 Uncripple refchecks in case bodiesJason Zaugg2014-09-238-8/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1119-4/+215
|\ \ | | | | | | [backport] SI-7470 implements fundep materialization
| * | -Xfundep-materialization => -Yfundep-materializationEugene Burmako2014-09-094-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | pull request feedbackEugene Burmako2014-07-031-0/+1
| | |
| * | [backport] SI-7470 implements fundep materializationEugene Burmako2014-07-0219-4/+214
| | | | | | | | | | | | | | | Backports 21a8c6c from the 2.11.x branch under -Xfundep-materialization as per Miles Sabin's request. Thanks Miles!
* | | Merge pull request #3937 from som-snytt/issue/8787-doc-backportGrzegorz Kossakowski2014-09-021-186/+291
|\ \ \ | | | | | | | | [backport] SI-8787 Backport Regex doc
| * | | [backport] SI-8787 Backport Regex docSom Snytt2014-08-261-186/+291
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport the doc with two material changes: 1. need to use Groups to extract from Match, so say that in lieu of the 2.11 advice that the Regex instance can be used without recomputing the match; 2. and relatedly, in 2.10 there is no secondary constructor, so the doc for group names is moved back up to the class doc. Original doc update on PR #3923 was: 0e26910372d349c6ff7bbaa17fc8fe0bf568c5fe f98c53cb03f800b3d790f3866ab90f827fd131f5
* | | Merge pull request #3865 from xeno-by/topic/extractor-macros-210xGrzegorz Kossakowski2014-08-195-42/+114
|\ \ \ | | | | | | | | [backport] transformers no longer ignore UnApply.fun
| * | | [backport] transformers no longer ignore UnApply.funEugene Burmako2014-07-035-42/+114
| |/ / | | | | | | | | | Backports 7122560063 and 4133eb8454 from the 2.11.x branch
* | | Merge pull request #3860 from gourlaysama/wip/t7710-backportGrzegorz Kossakowski2014-08-193-3/+39
|\ \ \ | | | | | | | | [backport] SI-7710 fix memory performance of RegexParsers in jdk7u6+
| * | | [backport] SI-7710 fix memory performance of RegexParsers in jdk7u6+Antoine Gourlay2014-08-123-3/+39
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport of scala/scala-parser-combinators@91584dc. --- Starting with 1.7.0_06 [1], String.substring no longer reuses the internal char array of the String but make a copy instead. Since we call subSequence twice for *every* input character, this results in horrible parse performance and GC. With the benchmark from the (duplicate) ticket SI-8542, I get: BEFORE: parseAll(new StringReader(String)) For 100 items: 49 ms For 500 items: 97 ms For 1000 items: 155 ms For 5000 items: 113 ms For 10000 items: 188 ms For 50000 items: 1437 ms === parseAll(String) For 100 items: 4 ms For 500 items: 67 ms For 1000 items: 372 ms For 5000 items: 5693 ms For 10000 items: 23126 ms For 50000 items: 657665 ms AFTER: parseAll(new StringReader(String)) For 100 items: 43 ms For 500 items: 118 ms For 1000 items: 217 ms For 5000 items: 192 ms For 10000 items: 196 ms For 50000 items: 1424 ms === parseAll(String) For 100 items: 2 ms For 500 items: 8 ms For 1000 items: 16 ms For 5000 items: 79 ms For 10000 items: 161 ms For 50000 items: 636 ms [1] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6924259
* | | Merge pull request #3904 from kzys/jira-8314-2.10.xGrzegorz Kossakowski2014-08-072-0/+19
|\ \ \ | | | | | | | | Prevent SI-8314 by adding a test
| * | | Prevent SI-8314 by adding a testKato Kazuyoshi2014-07-312-0/+19
|/ / / | | | | | | | | | The original issue was fixed already. This test is just for make sure.
* | | Merge pull request #3752 from jeroentervoorde/SI_8589Adriaan Moors2014-07-041-1/+6
|\ \ \ | |/ / |/| | SI-8589 Performance improvement for ArrayCharSequence.toString
| * | SI-8589 Performance improvement for ArrayCharSequence.toStringJeroen ter Voorde2014-06-191-1/+6
|/ /
* | Merge pull request #3799 from retronym/topic/8596-2.10Jason Zaugg2014-06-025-4/+34
|\ \ | | | | | | SI-8596 Fix rangepos crasher with defaults, poly methods
| * | SI-8596 Fix rangepos crasher with defaults, poly methodsJason Zaugg2014-05-295-4/+34
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Regressed in SI-7915 / 3009a525b5 We should be deriving the position of the synthetic `Select` from `basefun1`, rather than `basefun`. In the new, enclosed test, the difference amounts to: new Container().typeParamAndDefaultArg[Any]() `------------ basefun1 --------------' `----------------- basefun ---------------' For monomorphic methods, these are one and the same, which is why `presentation/t7915` was working. I've extended that test to a polymorphic method to check that hyperlink resolution works.
* | Merge pull request #3678 from retronym/ticket/8479Jason Zaugg2014-04-075-4/+49
|\ \ | | | | | | SI-8479 Fix constructor default args under scaladoc
| * | SI-8479 Fix constructor default args under scaladocJason Zaugg2014-04-075-4/+49
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `DocDef` node hid the `DefDef` constructor from the scrutinee of the namer when determining if the class had constructor defaults or not. The current pattern for fixing these bugs is to delegate the check to `TreeInfo`, and account for the wrapper `DocDef` node. I've followed that pattern, but expressed my feelings about this approach in a TODO comment. Before this patch, the enclosed test failed with: error: not enough arguments for constructor SparkContext: (master: String, appName: String)SparkContext
* | Merge pull request #3655 from retronym/ticket/8442Grzegorz Kossakowski2014-03-267-4/+50
|\ \ | | | | | | SI-8442 Ignore stub annotation symbols in `AnnotationInfo#matches`
| * | SI-8442 Ignore stub annotation symbols in `AnnotationInfo#matches`Jason Zaugg2014-03-257-4/+50
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And update the java `ClassFileParser` to create distinguished `StubClassSymbol`s, rather that a regular `ClassSymbol`s, when encountering a deficient classpath. This brings it into line with `Unpickler`, which has done as much since a55788e275f. This stops the enclosed test case from crashing when determining if the absent symbol, `A_1`, is a subclass of `@deprecated`. This is ostensibly fixes a regression, although it only worked in `2.10.[0-3]` by a fluke: the class file parser's promiscious exception handling caught and recovered from the NPE introduced in SI-7439! % javac -d /tmp test/files/run/t8442/{A,B}_1.java && qbin/scalac -classpath /tmp -d /tmp test/files/run/t8442/C_2.scala && (rm /tmp/A_1.class; true) && scalac-hash v2.10.0 -classpath /tmp -d /tmp test/files/run/t8442/C_2.scala warning: Class A_1 not found - continuing with a stub. warning: Caught: java.lang.NullPointerException while parsing annotations in /tmp/B_1.class two warnings found
* | Merge pull request #3551 from xeno-by/topic/typecheck-member-defJason Zaugg2014-03-256-62/+100
|\ \ | | | | | | [nomaster] backports 609047ba37
| * | [nomaster] typecheck(q"class C") no longer crashesEugene Burmako2014-03-236-62/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MemberDefs alone can't be typechecked as is, because namer only names contents of PackageDefs, Templates and Blocks. And, if not named, a tree can't be typed. This commit solves this problem by wrapping typecheckees in a trivial block and then unwrapping the result when it returns back from the typechecker. (cherry picked from commit 609047ba372ceaf06916d3361954bc949a6906ee)
* | | Merge pull request #3614 from retronym/ticket/8196Jason Zaugg2014-03-254-4/+66
|\ \ \ | | | | | | | | SI-8196 Runtime reflection robustness for STATIC impl details
| * | | SI-8195 Test case to show this is a dup of SI-8196Jason Zaugg2014-03-111-2/+23
| | | | | | | | | | | | | | | | Which was fixed in the previous commit.
| * | | SI-8196 Runtime reflection robustness for STATIC impl detailsJason Zaugg2014-03-114-4/+45
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Scala's runtime reflection works in few modes. The primary mode reads reads out the pickled signatures from ScalaSig annotations, if avaialable. However, these aren't available for Java-defined classes (obviously) nor for local Scala-defined classes (less obviously.), and the Scala `Symbol`s and `Types` must be reconstructed from the Java generic reflection metadata. This bug occurs in the last case, and is centered in `FromJavaClassCompleter`. In that completer, member fields and methods are given an owner based on the STATIC modifier. That makes sense for Java defined classes. I'm not 100% if it makes sense for Scala defined classes; maybe we should just skip them entirely? This patch still includes them, but makes the ownership-assignment more robust in the face of STATIC members emitted by the Scala compiler backend, such as the cache fields for structural calls. (It's reflection all the way down!). We might not have a companion module at all, so before we ended up owning those by `NoSymbol`, and before too long hit the dreaded NSDHNAO crash. That crash doesn't exist any more on 2.11 (it is demoted to a -Xdev warning), but this patch still makes sense on that branch. This commit makes `followStatic` and `enter` more robust when finding a suitable owner for static members. I've also factored out the duplicated logic between the two.
* | | Merge pull request #3602 from xeno-by/topic/backport-vampire-warningJason Zaugg2014-03-225-1/+62
|\ \ \ | | | | | | | | [backport] no longer warns on calls to vampire macros
| * | | [backport] no longer warns on calls to vampire macrosEugene Burmako2014-03-055-1/+62
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As eloquently elaborated and cleverly named by Travis Brown, macros defined in structural types are useful: http://meta.plasm.us/posts/2013/07/12/vampire-methods-for-structural-types/. However, since such macros are on the intersection of a number of language features, as usual, there are bugs. This commit fixes an unwanted interaction of macros defined in structural types with the scala.language.reflectiveCalls guard. Since macro calls aren't going to be carried to runtime, there's no need to warn about them.
* | | Merge pull request #3643 from gkossakowski/2.10.5-nightliesGrzegorz Kossakowski2014-03-191-1/+1
|\ \ \ | |/ / |/| | Bump version to 2.10.5 for nightly builds.
| * | Bump version to 2.10.5 for nightly builds.Grzegorz Kossakowski2014-03-191-1/+1
|/ /
* | Merge pull request #3491 from retronym/backport/7902v2.10.4-RC3v2.10.4Grzegorz Kossakowski2014-02-092-1/+19
|\ \ | |/ |/| [backport] SI-7902 Fix spurious kind error due to an unitialized symbol
| * [backport] SI-7902 Fix spurious kind error due to an unitialized symbolJason Zaugg2014-02-092-1/+19
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tracked down this error: <none> is invariant, but type Y2 is declared covariant <none>'s bounds<notype> are stricter than type X2's declared bounds >: Nothing <: Any, <none>'s bounds<notype> are stricter than type Y2's declared bounds >: Nothing <: Any to `Symbol#typeParams` returning `List(NoSymbol)` if the symbol was not initialized. This happends in the enclosed test for: // checkKindBoundsHK() hkArgs = List(type M3) hkParams = List(type M2) This commit forces the symbol of the higher-kinded type argument before checking kind conformance. A little backstory: The `List(NoSymbol)` arises from: class PolyTypeCompleter... { // @M. If `owner` is an abstract type member, `typeParams` are all NoSymbol (see comment in `completerOf`), // otherwise, the non-skolemized (external) type parameter symbols override val typeParams = tparams map (_.symbol) The variation that triggers this problem gets into the kind conformance checks quite early on, during naming of: private[this] val x = ofType[InSeq] The inferred type of which is forced during: def addDerivedTrees(typer: Typer, stat: Tree): List[Tree] = stat match { case vd @ ValDef(mods, name, tpt, rhs) if !noFinishGetterSetter(vd) => // If we don't save the annotations, they seem to wander off. val annotations = stat.symbol.initialize.annotations (cherry picked from commit 03a06e02483eaf442158339c2edd6bcfd99847a3)
* Merge pull request #3430 from som-snytt/issue/8205-backportJason Zaugg2014-01-291-0/+58
|\ | | | | SI-8205 [nomaster] backport test pos.lineContent
| * SI-8205 [nomaster] backport test pos.lineContentSom Snytt2014-01-291-0/+58
| | | | | | | | Verifies previous behavior.
* | Merge pull request #3415 from xeno-by/topic/reify210xEugene Burmako2014-01-271-5/+5
|\ \ | | | | | | [nomaster] corrects an error in reify’s documentation
| * | [nomaster] corrects an error in reify’s documentationEugene Burmako2014-01-261-5/+5
|/ /
* | Merge pull request #3359 from huitseeker/issue/VarianceAdaptationsJason Zaugg2014-01-216-6/+6
|\ \ | | | | | | [backport] Backports library changes related to SI-6566 from a419799
| * | Backports library changes related to SI-6566 from a419799François Garillot2014-01-136-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | The idea of backporting this occured while developing the -source flag for SI-8126 : withouth this the library breaks at refchecks for a Scala compiler that checks type aliases variance. This shoudl be BC and promote good hygiene.
* | | Merge pull request #3367 from retronym/backport/3363Jason Zaugg2014-01-2010-1506/+137
|\ \ \ | | | | | | | | [nomaster] Fix non-deterministic <:< for deeply nested types
| * | | [nomaster] SI-8146 Fix non-deterministic <:< for deeply nested typesJason Zaugg2014-01-157-25/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backported from master. This is a squashed commmit comprising: SI-8146 Pending test, diagnosis for bug in decidability of <:< (cherry picked from commit 8beeef339ad65f3308ece6fb0440cdb31b1ad404) SI-8146 Test cases for typechecking decidability Taken from "On Decidability of Nominal Subtyping with Variance" (Pierce, Kennedy), which was implemented in 152563b. Part of the implementation (SubTypePair) will be changed in the following commit to fix the non-deterministic errors typechecking heavily nested types involving aliases or annotations. (cherry picked from commit 2e28cf7f76c3d5fd0c2df4274f1af9acb42de699) SI-8146 Fix non-deterministic <:< for deeply nested types In the interests of keeping subtyping decidable [1], 152563b added some bookkeeping to `isSubType` to detect cycles. However, this was based on a hash set containing instances of `SubTypePair`, and that class had inconsistencies between its `hashCode` (in terms of `Type#hashCode`) and `equals` (in terms of `=:=`). This inconsistency can be seen in: scala> trait C { def apply: (Int @unchecked) } defined trait C scala> val intUnchecked = typeOf[C].decls.head.info.finalResultType intUnchecked: $r.intp.global.Type = Int @unchecked scala> val p1 = new SubTypePair(intUnchecked, intUnchecked) p1: $r.intp.global.SubTypePair = Int @unchecked <:<? Int @unchecked scala> val p2 = new SubTypePair(intUnchecked.withoutAnnotations, intUnchecked.withoutAnnotations) p2: $r.intp.global.SubTypePair = Int <:<? Int scala> p1 == p2 res0: Boolean = true scala> p1.hashCode == p2.hashCode res1: Boolean = false This commit switches to using `Type#==`, by way of the standard case class equality. The risk here is that you could find a subtyping computation that progresses in such a manner that we don't detect the cycle. It would need to produce an infinite stream of representations for types that were `=:=` but not `==`. If that happened, we'd fail to terminate, rather than judging the relationship as `false`. [1] http://research.microsoft.com/pubs/64041/fool2007.pdf (cherry picked from commit a09e143b7fd1c6b433386d45e9c5ae3548819b59) Conflicts: src/reflect/scala/reflect/internal/tpe/TypeComparers.scala src/reflect/scala/reflect/runtime/JavaUniverseForce.scala
| * | | [nomaster] Update MiMa and use new wildcard filterJason Zaugg2014-01-153-1481/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | scala.reflect.internal._ now gets a free pass from binary compatibility checking. Previously, we had to excrutiatingly exclude violations individually.
* | | | Merge pull request #3356 from retronym/ticket/8138Jason Zaugg2014-01-182-5/+31
|\ \ \ \ | | | | | | | | | | Fix bug with super-accessors / dependent types
| * | | | SI-8143 Fix bug with super-accessors / dependent typesJason Zaugg2014-01-122-5/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Super-accessors are generated as `DefDef`'s with `EmptyTree` as a placeholder for the RHS. This is filled in later in `Mixin` in `completeSuperAccessor`. A change in `Uncurry` (SI-6443 / 493197f), however, converted this to a `{ EmptyTree }`, which evaded the pattern match in mixin. This commit adds a special case to the dependent method treatment in Uncurry to avoid generating redundant blocks.
* | | | | Merge pull request #3364 from retronym/ticket/8152Jason Zaugg2014-01-152-3/+18
|\ \ \ \ \ | |_|/ / / |/| | | | [nomaster] Backport variance validator performance fix