summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* SI-7591 Move command-line spec usage demo to testsSimon Ochsenreither2013-07-011-3/+1
|
* Merge pull request #2681 from soc/SI-7590Adriaan Moors2013-06-284-12/+24
|\ | | | | SI-7590 TreeSet should fail fast if Ordering is null
| * SI-7590 TreeSet should fail fast if Ordering is nullSimon Ochsenreither2013-06-254-12/+24
| | | | | | | | | | | | | | | | | | | | While migrating scala.tools.nsc.util.TreeSet to scala.collection.mutable.TreeSet, I messed up initialization order and realized that TreeSet accepts null as an Ordering and only fails much later. This change makes mutable.TreeSet and immutable.TreeSet fail immediately.
* | Merge pull request #2676 from soc/SI-7511Adriaan Moors2013-06-289-68/+147
|\ \ | | | | | | SI-7511 Remove indirection of numeric methods
| * | SI-7511 Remove indirection of numeric methodsSimon Ochsenreither2013-06-239-68/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Methods on `Rich<AnyVal>`s like `abs`, `doubleValue`, `floatValue`, `longValue`, `intValue`, `byteValue`, `shortValue`, `min`, `max`, `signum` are slow because they go through multiple indirections including typeclasses and boxing. For instance, take `1L.abs`: Instead of just computing and returning the result (like it is done in `RichInt`), this is what happens: - `RichLong` inherits `abs` by extending `ScalaNumberProxy[T]` - `ScalaNumberProxy[T]` has an abstract `protected implicit def num: Numeric[T]` - This method is implemented in `RichLong` and points to `scala.math.Numeric.LongIsIntegral` - The actual method `abs` now calls `num.abs(self)`
* | | Merge pull request #2673 from greenrd/patch-1Adriaan Moors2013-06-281-1/+1
|\ \ \ | | | | | | | | Fix typo in Scaladoc
| * | | Fix typo in ScaladocRobin Green2013-06-231-1/+1
| |/ /
* | | Merge pull request #2683 from VladUreche/issue/7344-masterAdriaan Moors2013-06-282-23/+144
|\ \ \ | | | | | | | | SI-7344 Specialize methods in private scopes
| * | | SI-7344 Specialize methods in private scopesVlad Ureche2013-06-282-23/+144
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This performs method specialization inside a scope other than a {class, trait, object}: could be another method or a value. This specialization is much simpler, since there is no need to record the new members in the class signature, their signatures are only visible locally. It works according to the usual logic: - we use normalizeMember to create the specialized symbols - we leave DefDef stubs in the tree that are later filled in by tree duplication and adaptation The solution is limited by SI-7579: since the duplicator loses the sym annotations when duplicating, this expansion and rewiring can only take place in code that has not been subject to duplication. You can see the test case for an example. Review by @dragos, @paulp or @axel22.
* | | Merge pull request #2679 from soc/topic/java-rawtype-cleanupAdriaan Moors2013-06-273-5/+6
|\ \ \ | | | | | | | | Get rid of raw types which cause unnecessary warnings
| * | | Get rid of raw types which cause unnecessary warningsSimon Ochsenreither2013-06-233-5/+6
| |/ /
* | | Merge pull request #2678 from soc/SI-7600Adriaan Moors2013-06-273-2/+16
|\ \ \ | | | | | | | | SI-7600 [Avian] Skip tests r/stream_length and r/t4294
| * | | SI-7600 [Avian] Skip tests r/stream_length and r/t4294Simon Ochsenreither2013-06-233-2/+16
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The issue is that Avian's GC is currently not precise enough to determine the exact lifetime of each local/stack reference, and therefore considers the this reference to be reachable in situations where it could have been collected. This can cause issues (as seen in run/stream_length and run/t4294: `java.lang.OutOfMemoryError`) if code relies on the garbage collection of these values to keep memory consumption constant. This commit simply skips these two tests on Avian until the GC implementation is fixed.
* | | Merge pull request #2677 from jannic/SI-3936Adriaan Moors2013-06-273-0/+9
|\ \ \ | | | | | | | | SI-3936 - add test case to show that SI-3936 is already fixed
| * | | SI-3936 - add test case to show that SI-3936 is already fixedJan Niehusmann2013-06-233-0/+9
| |/ / | | | | | | | | | | | | These are exactly the examples given by Lukas Rytz in SI-3936. They fail with 2.10.1 and compile with 2.10.2 as well as current master.
* | | Merge pull request #2669 from adriaanm/modularize-parsingAdriaan Moors2013-06-2715-110/+90
|\ \ \ | | | | | | | | Modularize parsing
| * | | Remove dependency on combinators from CommandLinerParser.Adriaan Moors2013-06-2515-110/+90
| | |/ | |/| | | | | | | | | | | | | | | | tools.cmd.CommandLineParser uses a small hand-rolled parser TODO: replace partest's usage of scala.tools.nsc.util.CommandLine by scala.tools.cmd.CommandLine
* | | Merge pull request #2675 from soc/SI-7599Adriaan Moors2013-06-261-8/+12
|\ \ \ | | | | | | | | SI-7599 Modify methods to be non-tail-callable ...
| * | | SI-7599 [Avian] Prevent TCO in test to inspect stackSimon Ochsenreither2013-06-261-8/+12
| | |/ | |/| | | | | | | | | | This commit modifies methods in the test to be non-tail-callable to prevent Avian from eliding the stack frames we want to inspect.
* | | Merge pull request #2672 from som-snytt/issue/6855-repl-pasted-braceAdriaan Moors2013-06-251-2/+14
|\ \ \ | | | | | | | | SI-6855: REPL emits error on partial pastie
| * | | SI-6855: REPL emits error on partial pastieSom Snytt2013-06-221-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If pasted code is interpreted with an incomplete result, attempt to compile it to display an error. Unfancily, the code is wrapped in an object for compilation.
* | | | Merge pull request #2659 from retronym/ticket/7584Adriaan Moors2013-06-255-2/+41
|\ \ \ \ | |_|_|/ |/| | | SI-7584 Fix typer regression with by-name parameter types
| * | | SI-7584 Test and spurious warning fix for by-name closuresJason Zaugg2013-06-164-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | The enclosed test case exercises by-name closures, which were the subject of the previous commit. In the process, a spurious warning was eliminated.
| * | | SI-7584 Fix typer regression with by-name parameter typesJason Zaugg2013-06-162-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It regressed in fada1ef6b#L4L614. Partially reverting just this change restores the correct behaviour: ``` - if (sym.isStable && pre.isStable && !isByNameParamType(tree.tpe) && + if (treeInfo.admitsTypeSelection(tree) && ``` This patch embeds the check for by-name parameter types into `TreeInfo.isStableIdentifier`. That code already checks for `Symbol#isStable`, which exludes direct references to by-name parameters. But the additional check is required to deal with by-name parameters in function types, e.g `(=> Int) => Any`. Open question: should we go further and embed this check in `isStable`? Currently: final def isStable = isTerm && !isMutable && !(hasFlag(BYNAMEPARAM)) && (!isMethod || hasStableFlag) Such function types are an underspecified corner of the language, albeit one that is pretty useful writing, for example, in the signature of a lazy foldRight that can operate over infinite structures: def foldRight[A, B](fa: F[A], z: => B)(f: (A, => B) => B): B The next commit subjects them to a little testing.
* | | | Merge pull request #2667 from adriaanm/modularize-xmlAdriaan Moors2013-06-2420-97/+593
|\ \ \ \ | | | | | | | | | | Spin off xml library as scala-library-xml.
| * | | | Set scene for Predef.$scope's demise.Jason Zaugg2013-06-209-13/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When there's no Predef.$scope but xml is being used, the compiler aliases scala.xml.TopScope to $scope. There must be a scala.xml package when xml literals were parsed. For compatibility with the old library, which relied on $scope being in scope, synthesize a `import scala.xml.{TopScope => $scope}` when xml is needed, but there's no Predef.$scope and the old library is detected (scala.xml.TopScope exists).
| * | | | Remove dependency on xml in ast.parserAdriaan Moors2013-06-205-14/+441
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Copied the following files from scala.xml to ast.parser.xml: - MarkupParsers differs from scala.xml.MarkupParsers only in the first 17 lines - Utility.scala was refactored and reduced (also includes TokenTests)
| * | | | Remove dependency on xml in MarkupParsersAdriaan Moors2013-06-201-6/+14
| | | | | | | | | | | | | | | | | | | | Inlined TextBuffer.
| * | | | Remove dependency on xml in plugin loading.Adriaan Moors2013-06-202-39/+31
| | | | |
| * | | | Remove dependency on xml in ScalaRunTime.Adriaan Moors2013-06-201-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | runtime.ScalaRunTime.stringOf's behavior has changed slightly: Call the object's `toString` for all classes in `scala.xml._`, instead of only for `Node` and `MetaData` (old behavior).
| * | | | Remove dependency on xml in sys.process.Adriaan Moors2013-06-203-21/+24
| | | | | | | | | | | | | | | | | | | | Added deprecated conversions in xml.Elem to preserve source compatibility.
* | | | | Merge pull request #2671 from huitseeker/issue/SI-7569Jason Zaugg2013-06-243-1/+32
|\ \ \ \ \ | | | | | | | | | | | | SI-7569 Fix end position in PostfixSelect tree
| * | | | | SI-7569 Fix end position in PostfixSelect treeFrançois Garillot2013-06-243-1/+32
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | introduced in 5b54681: the end position of Postfix operators should take the operator length into account. review by @som-snytt
* | | | | Merge pull request #2653 from retronym/ticket/7433Grzegorz Kossakowski2013-06-234-1/+24
|\ \ \ \ \ | | | | | | | | | | | | SI-7433 Fix spurious warning about catching control throwable
| * | | | | SI-7433 Fix spurious warning about catching control throwableJason Zaugg2013-06-234-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the same vein as SI-6994, we have to be careful not to warn about synthetic code. In that case, the spurious warnings came because we warned in the typechecker, which was also called in erasure. In this case, we are issuing the warning in Uncurry, so we must be mindful of the pattern matchers translations of non-trivial catch patterns, which look like: case (ex8 @ _) => { <synthetic> val x5: Throwable = ex8; case11(){ if ({ case14(){ if (x5.$isInstanceOf[NullPointerException]()) matchEnd13(true) else case15() }; case15(){ if (x5.$isInstanceOf[RuntimeException]()) matchEnd13(true) else case16() }; case16(){ matchEnd13(false) }; matchEnd13(x: Boolean){ x } }) This commit detects that `ex8` is synthetic and disables the warning.
* | | | | | Merge pull request #2637 from retronym/ticket/7439Paul Phillips2013-06-235-1/+43
|\ \ \ \ \ \ | |_|_|_|_|/ |/| | | | | SI-7439 Avoid NPE in `isMonomorphicType` with stub symbols. …
| * | | | | SI-7439 Avoid NPE in `isMonomorphicType` with stub symbols.Jason Zaugg2013-06-135-1/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `originalInfo` can return null for stub symbols; deal with that as we used to before a regression in 016bc3db. After this change, we can once again delete A_1.class and still compile code instantiating B_1. (A_1 is only referred to in a method signature of B_1 which is not called from our code.) scala> new B_1 warning: Class A_1 not found - continuing with a stub. res0: B_1 = B_1@5284b8f9 In practice, this situation arises when someone uses a third party class that was compiled against other libraries not avaialable on the current compilation classpath.
* | | | | | Merge pull request #2668 from soc/SI-7292-fixAdriaan Moors2013-06-214-13/+14
|\ \ \ \ \ \ | |_|_|_|_|/ |/| | | | | SI-7292 Fixes test failures by updating *.check files
| * | | | | SI-7292 Fixes test failures by updating *.check filesSimon Ochsenreither2013-06-214-13/+14
|/ / / / / | | | | | | | | | | | | | | | | | | | | Looks like partest's confusion about / vs. \ was fixed between the original Jenkins run of the fix for SI-7292 and its merge.
* | | | | Merge pull request #2342 from soc/SI-7292Adriaan Moors2013-06-207-0/+41
|\ \ \ \ \ | |_|_|/ / |/| | | | SI-7292 Deprecate octal escape literals
| * | | | SI-7292 Deprecate octal escape literalsSimon Ochsenreither2013-04-047-0/+41
| | | | |
* | | | | Merge pull request #2625 from paulp/pr/no-useless-implicitsGrzegorz Kossakowski2013-06-198-66/+54
|\ \ \ \ \ | | | | | | | | | | | | SI-6899, prohibit dangerous, useless implicit conversions.
| * | | | | SI-6899, prohibit dangerous, useless implicit conversions.Paul Phillips2013-06-048-66/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Increase eligibility requirements for implicit conversions, such that T => U is ineligible if T <: Null <or> AnyRef <: U This has the salutary effect of allowing us to ditch 16 ridiculous implicits from Predef, since they existed solely to work around the absence of this restriction. There was one tiny impact on actual source code (one line in one file) shown here, necessitated because the literal null is not eligible to be implicitly converted to A via <:<. def f[A](implicit ev: Null <:< A): A = null // before def f[A](implicit ev: Null <:< A): A = ev(null) // after As impositions go it's on the tame side.
* | | | | | Merge pull request #2628 from retronym/ticket/7364Eugene Burmako2013-06-195-5/+23
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-7364 Allow raw types in parent position in Java sources
| * | | | | | SI-7364 Allow raw types in parent position in Java sourcesJason Zaugg2013-06-095-5/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To make this work, this commit simply restricts parent type argument inference to Scala source files. The surrounding code has also been refactored to avoid a var.
* | | | | | | Merge pull request #2635 from retronym/ticket/7151Grzegorz Kossakowski2013-06-193-2/+33
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-7151 Emit final in bytecode for final inner classes.
| * | | | | | | SI-7151 Emit final in bytecode for final inner classes.Jason Zaugg2013-06-073-2/+33
| | |_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As we did before a regression in 18efdedfb / SI-5676. This commit tightens up the condition in which the FINAL modifier is omitted; it now *only* does this for the module classes of nested objects.
* | | | | | | Merge pull request #2631 from retronym/ticket/5022Grzegorz Kossakowski2013-06-194-4/+42
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-5022 Retain precise existentials through pattern matching
| * | | | | | | SI-5022 Retain precise existentials through pattern matchingJason Zaugg2013-06-054-4/+42
| | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From the dawn of scalac's existentials, the typer widens existentials pt-s by substituting wildcard types in places of existential quantifiers. In this example: class ForSomeVsUnapply { def test { def makeWrap: Wrap = ??? def useRep[e](rep: (e, X[e])) = () val rep = makeWrap match { case Wrap(r) => r }; useRep(rep) // error } } the type of `r` is the result of typechecking: Apply( fun = TypeTree( tpe = (rep#12037: (e#12038, X#7041[e#12038]) forSome { type e#12038 }) args = Bind(r @ _) :: Nil } This descends to type the `Bind` with: pt = (e#12038, X#7041[e#12038]) forSome { type e#12038 } `dropExistential` clobbers that type to `Tuple2#1540[?, X#7041[?]]`, which doesn't express any relationship between the two instances of the wildcard type. `typedIdent` sort of reverses this with a call to `makeFullyDefined`, but only ends up with: pt = (Any#3330, X#7041[_1#12227]) forSome { type _1#12227; type e#12038 } I suspect that this existential dropping only makes sense outside of typechecking patterns. In pattern mode, type information flows from the expected type onwards to the body of the case; we must not lose precision in the types. For SIP-18 friendly existentials, one `dropExistential` is invertable with `makeFullyDefined`, so this hasn't been such a big problem. The error message improvement conferred by SI-4515 took a hit. That might be a good example to consider when reviewing this change: Does it tell us anything interesting about this `dropExistential` business?
* | | | | | | Merge pull request #2657 from gkossakowski/junit-masterGrzegorz Kossakowski2013-06-197-176/+296
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Merge JUnit support into master