summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* SI-6810 Disallow EOL in char literalSom Snytt2015-06-291-3/+5
| | | | | | | | | | | | | | | | | It's clear that char literals are one-lined like normal string literals. By the same token, pun intended, char literals accept unicode escapes the same as string literals, including `\u000A`. This commit adds the usual exclusions (CR, NL, SU). The spec is outdated in outlawing chars that are not "printable", in particular, the ASCII control codes. The original intention may have been that the ordinary string escapes are required, such as "\b\n". Note that some common escapes are absent, such as "\a".
* SI-6613 fixed in GenBCodeLukas Rytz2015-06-261-1/+2
| | | | It was fixed in GenASM in 44807a7852.
* Default to delambdafy:method and backend:GenBCodeLukas Rytz2015-06-262-4/+6
| | | | | | | | | | | | | | | | | | | | | | Switch the defaults of `-Ydelambdafy` and `-Ybackend`. Rewrite t6288b-jump-position test - no more icode Don't crash GenBCode beyond JVM code size limits A similar patch is in GenASM, see 3fa2c97 Fix check files for GenBCode / delambdafy:method defaults Force copy propagation test to ASM, see SI-9364 Force inline-ex-handlers test to GenASM, see SI-9364 Move t6613 test to pending - still broken in GenBCode Adding a `flags` file with `-Ybackend:GenASM` doesn't seem to have the desired effect. SI-6613 is re-opened. Force a few tests to GenASM, see SI-9364
* Merge pull request #4460 from som-snytt/topic/javap-decomJason Zaugg2015-06-262-476/+129
|\ | | | | SI-9277 Downgrade marginal javap features
| * SI-9277 Downgrade marginal javap featuresSom Snytt2015-06-252-476/+129
| | | | | | | | Drop Java 6 support, -fun, -app, and -raw options.
* | Merge pull request #4504 from ruippeixotog/mutable-treemapAdriaan Moors2015-06-254-0/+792
|\ \ | | | | | | SI-4147 Add an implementation of `mutable.TreeMap`
| * | SI-4147 Add an implementation of `mutable.TreeMap`Rui Gonçalves2015-05-304-0/+792
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit contains an implementation of a mutable red-black tree with focus on performance. It also contains a new `mutable.TreeMap` Scala collection that is backed by the aforementioned tree. The common generic factories and traits related to mutable sorted maps didn't exist yet, so this commit also adds them. Regarding performance, `TreeMap` overrides (from `MapLike` and `SortedMapLike`) all of the most common methods for maps and also those whose default implementations are asymptotically worse than direct red-black tree algorithms (e.g. `last`, `clear`). The `rangeImpl` method of `TreeMap` returns an instance of `TreeMapView`, an inner class of `TreeMap`. This view is backed by the same `RedBlackTree.Tree` instance, and therefore changes to the original map are reflected in the view and vice-versa. The semantics of mutating a view by adding and removing keys outside the view's range are the same of the current `mutable.TreeSet`. A bit less focus was given on the performance of views - in particular, getting the `size` of a `TreeMapView` is O(n) on the number of elements inside the view bounds. That can be improved in the future. In a future commit, `mutable.TreeSet` can be changed to be backed by this red-black tree implementation.
* | | Merge pull request #4514 from martijnhoekstra/patch-2Adriaan Moors2015-06-251-29/+58
|\ \ \ | |_|/ |/| | Documentation for split [ci: last-only]
| * | StringLike.split fixed for surrogates and docmartijnhoekstra2015-05-281-29/+58
| |/ | | | | | | | | | | Reverts to calling String.split(re: String), but change escape to always put us on the JDK7 fast-path if possible, which is for everything but Chars representing surrogate codeunits
* | Merge branch '2.11.x' into merge/2.11.x-to-2.12.x-20150624Jason Zaugg2015-06-24102-1136/+2343
|\ \ | |/ |/|
| * Merge pull request #4574 from janekdb/2.11.x-typos-g-iJason Zaugg2015-06-2310-10/+10
| |\ | | | | | | Fix 25 typos (g-i)
| | * Fix 25 typos (g-i)Janek Bogucki2015-06-2210-10/+10
| | |
| * | Merge pull request #4564 from som-snytt/issue/promptv2.11.7Adriaan Moors2015-06-228-101/+109
| |\ \ | | | | | | | | SI-9206 Fix REPL code indentation
| | * | SI-9206 Local refactor to save eyesightSom Snytt2015-06-212-42/+39
| | | | | | | | | | | | | | | | | | | | | | | | We talk about bit rot but not about how dust accumulates on code that hasn't been swept since the last time the furniture was moved around.
| | * | SI-9206 Accept paste with custom promptSom Snytt2015-06-213-24/+28
| | | | | | | | | | | | | | | | But sans test.
| | * | SI-9206 Verbose REPL prompt for info modeSom Snytt2015-06-191-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | Only for exactly `-Dscala.repl.info`, include the complete version number string in the REPL prompt. One could imagine this is the mode for posting snippets to stackoverflow.
| | * | SI-9206 Fix REPL code indentationSom Snytt2015-06-195-33/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To make code in error messages line up with the original line of code, templated code is indented by the width of the prompt. Use the raw prompt (without ANSI escapes or newlines) to determine the indentation. Also, indent only once per line.
| | * | SI-9206 REPL prompt is more easily configuredSom Snytt2015-06-192-12/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The scala shell prompt can be provided as either a system property or in compiler.properties. The prompt string is taken as a format string with one argument that is the version string. ``` $ scala -Dscala.repl.prompt="%nScala %s> " Welcome to Scala version 2.11.7-20150616-093756-43a56fb5a1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_45). Type in expressions to have them evaluated. Type :help for more information. Scala 2.11.7-20150616-093756-43a56fb5a1> 42 res0: Int = 42 Scala 2.11.7-20150616-093756-43a56fb5a1> :quit ```
| | * | SI-9206 BooleanProp if set and not untrueSom Snytt2015-06-181-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, handy `sys.BooleanProp.keyExists` ignored the property value. While trying not to make any real estate puns, this commit will let it go false if a value is supplied that is not true in the usual Java sense. But what is truth? Allows `scala -Dscala.color=off`, for example.
| * | | Merge pull request #4566 from lrytz/t9359Adriaan Moors2015-06-227-56/+85
| |\ \ \ | | | | | | | | | | SI-9359 Fix InnerClass entry flags for nested Java enums
| | * | | SI-9359 Fix InnerClass entry flags for nested Java enumsLukas Rytz2015-06-197-56/+85
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The access flags in InnerClass entries for nested Java enums were basically completely off. A first step is to use the recently introduced backend method `javaClassfileFlags`, which is now moved to BCodeAsmCommon. See its doc for an explanation. Then the flags of the enum class symbol were off. An enum is - final if none of its values has a class body - abstract if it has an abstract method (https://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#jls-8.9) When using the ClassfileParser: - ENUM was never added. I guess that's just an oversight. - ABSTRACT (together with SEALED) was always added. This is to enable exhaustiveness checking, see 3f7b8b5. This is a hack and we have to go through the class members in the backend to find out if the enum actually has the `ACC_ABSTRACT` flag or not. When using the JavaParser: - FINAL was never added. - ABSTRACT was never added. This commit fixes all of the above and tests cases (Java enum read from the classfile and from source).
| * | / SI-9253 avoid IndexOutOfBoundsException in TypeMaps.correspondingTypeArgumentBruno Bieth2015-06-221-1/+1
| | |/ | |/|
| * | Fix 36 typos (d-f)Janek Bogucki2015-06-2116-18/+18
| | |
| * | Merge pull request #4563 from adriaanm/jline-shadeAdriaan Moors2015-06-1915-273/+334
| |\ \ | | | | | | | | Corral, shade & embed jline.
| | * | SI-9339 Support classpaths with no single compatible jlineAdriaan Moors2015-06-185-11/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As usual, the repl will use whatever jline 2 jar on the classpath, if there is one. Failing that, there's a fallback and an override. If instantiating the standard `jline.InteractiveReader` fails, we fall back to an embedded, shaded, version of jline, provided by `jline_embedded.InteractiveReader`. (Assume `import scala.tools.nsc.interpreter._` for this message.) The instantiation of `InteractiveReader` eagerly exercises jline, so that a linkage error will result if jline is missing or if the provided one is not binary compatible. The property `scala.repl.reader` overrides this behavior, if set to the FQN of a class that looks like `YourInteractiveReader` below. ``` class YourInteractiveReader(completer: () => Completion) extends InteractiveReader ``` The repl logs which classes it tried to instantiate under `-Ydebug`. # Changes to source & build The core of the repl (`src/repl`) no longer depends on jline. The jline interface is now in `src/repl-jline`. The embedded jline + our interface to it are generated by the `quick.repl` target. The build now also enforces that only `src/repl-jline` depends on jline. The sources in `src/repl` are now sure to be independent of it, though they do use reflection to instantiate a suitable subclass of `InteractiveReader`, as explained above. The `quick.repl` target builds the sources in `src/repl` and `src/repl-jline`, producing a jar for the `repl-jline` classes, which is then transformed using jarjar to obtain a shaded copy of the `scala.tools.nsc.interpreter.jline` package. Jarjar is used to combine the `jline` jar and the `repl-jline` into a new jar, rewriting package names as follows: - `org.fusesource` -> `scala.tools.fusesource_embedded` - `jline` -> `scala.tools.jline_embedded` - `scala.tools.nsc.interpreter.jline` -> `scala.tools.nsc.interpreter.jline_embedded` Classes not reachable from `scala.tools.**` are pruned, as well as empty dirs. The classes in the `repl-jline` jar as well as those in the rewritten one are copied to the repl's output directory. PS: The sbt build is not updated, sorry. PPS: A more recent fork of jarjar: https://github.com/shevek/jarjar.
| | * | Centralize dependencies on jlineAdriaan Moors2015-06-1715-273/+314
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Code that depends on jline is now in package `scala.tools.nsc.interpreter.jline`. To make this possible, remove the `entries` functionality from `History`, and add the `historicize` method. Also provide an overload for `asStrings`. Clean up a little along the way in `JLineHistory.scala` and `JLineReader.scala`. Next step: fall back to an embedded jline when the expected jline jar is not on the classpath. The gist of the refactor: https://gist.github.com/adriaanm/02e110d4da0a585480c1
| * | | Merge pull request #4331 from Ichoran/issue/8930Adriaan Moors2015-06-191-5/+12
| |\ \ \ | | |_|/ | |/| | SI-8930 - Vector updated, +:, and :+ slow when typed as Seq[A]
| | * | SI-8930 - Vector updated, +:, and :+ slow when typed as Seq[A]Rex Kerr2015-06-181-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | Vector was intercepting only the IndexedSeq CanBuildFrom to quickly generate new vectors. Now it intercepts immutable.Seq and collection.Seq as well. There are other possibilities (collection.IndexedSeq), but they will probably arise rarely, and to avoid an absurdly long set of checks we would need a marker trait (that is not binary compatible).
| * | | Merge pull request #4559 from janekdb/2.11.x-scaladoc-2Seth Tisue2015-06-1811-17/+17
| |\ \ \ | | | | | | | | | | Fix some typos (a-c)
| | * | | Fix another several typosMichał Pociecha2015-06-185-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I just used text search to check whether there are no more typos like these corrected by janekdb, and by the way fixed also some other ones which I saw.
| | * | | Fix some typos (a-c)Janek Bogucki2015-06-189-10/+10
| | | | |
| * | | | Merge pull request #4529 from lrytz/inlineAccessibilityJason Zaugg2015-06-192-18/+74
| |\ \ \ \ | | | | | | | | | | | | Fix illegal inlining of instructions accessing protected members
| | * | | | Fix illegal inlining of instructions accessing protected membersLukas Rytz2015-05-282-18/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were two issues in the new inliner that would cause a VerifyError and an IllegalAccessError. First, an access to a public member of package protected class C can only be inlined if the destination class can access C. This is tested by t7582b. Second, an access to a protected member requires the receiver object to be a subtype of the class where the instruction is located. So when inlining such an access, we need to know the type of the receiver object - which we don't have. Therefore we don't inline in this case for now. This can be fixed once we have a type propagation analyis. https://github.com/scala-opt/scala/issues/13. This case is tested by t2106. Force kmpSliceSearch test to delambdafy:inline See discussion on https://github.com/scala/scala/pull/4505. The issue will go away when moving to indy-lambda.
| * | | | | Merge pull request #4543 from som-snytt/issue/7773Seth Tisue2015-06-181-10/+12
| |\ \ \ \ \ | | | | | | | | | | | | | | SI-7773 Restore phase id to icode filename
| | * | | | | SI-7773 Restore phase id to icode filenameSom Snytt2015-06-071-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Having icode output files of the form `X-24.icode` went in and out of style using the long-form phase name because it broke the windows nightly build somehow. Here's hoping using just the phase id works on this year's infrastructure. As previously, the long name is still available under `-Ydebug`, because why not debug.
| * | | | | | Merge pull request #4539 from vsalvis/vsalvis-docfixesSeth Tisue2015-06-186-31/+12
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | Doc fixes
| | * | | | | | SI-6131 doc: remove broken show member link from all scaladoc pagesvsalvis2015-06-171-1/+0
| | | | | | | |
| | * | | | | | SI-8543 doc: Move TODO out of NumericRange's scaladocvsalvis2015-06-171-4/+4
| | | | | | | |
| | * | | | | | SI-8858 doc: fix note about PartialFunction in Function0, F1 and F2vsalvis2015-06-174-26/+8
| | |/ / / / /
| * | | | | | Merge pull request #4553 from som-snytt/issue/implicit-docSeth Tisue2015-06-182-2/+12
| |\ \ \ \ \ \ | | |_|_|/ / / | |/| | | | | SI-9354 ScalaDoc members added via by-name view
| | * | | | | SI-9354 ScalaDoc members added via by-name viewSom Snytt2015-06-142-2/+12
| | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Eligible views were looked up by exact from type without including the by-name dodge. By-name views are now included without consideration whether ScalaDoc processes possible duplicates correctly.
| * | | | | Merge pull request #4527 from nicky-zs/fix_BigDecimalLukas Rytz2015-06-181-2/+2
| |\ \ \ \ \ | | |_|_|/ / | |/| | | | fix BigDecimal losing MathContext
| | * | | | fix BigDecimal loosing MathContextZhong Sheng2015-05-271-2/+2
| | | | | |
| * | | | | Merge pull request #4560 from adriaanm/t9356Adriaan Moors2015-06-171-11/+9
| |\ \ \ \ \ | | | | | | | | | | | | | | SI-9356 more careful assertion in back-end
| | * | | | | SI-9356 more careful assertion in back-endAdriaan Moors2015-06-161-11/+9
| | | |_|_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling `exists` on a `Symbol` triggers unpickling, which failed for reasons I did not investigate. Replaced `sym.exists` by `sym != NoSymbol`, which is good enough here. Also replaced assertion by a `devWarning`, since the logic seems too ad-hoc to actually crash the compiler when it's invalidated. Partially reverts b45a91fe22. See also #1532.
| * | | | | Merge pull request #4558 from janekdb/2.11.x-scaladoc-1-list-buffer-tryAdriaan Moors2015-06-172-2/+2
| |\ \ \ \ \ | | | | | | | | | | | | | | Improve API documentation for ListBuffer and Try
| | * | | | | Improve API documentation for ListBuffer and TryJanek Bogucki2015-06-162-2/+2
| | | | | | |
| * | | | | | Merge pull request #4541 from vuakko/SI-9348_2.11.xAdriaan Moors2015-06-171-3/+3
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-9348 Fix missing last element in exclusive floating point ranges
| | * | | | | | SI-9348 Fix missing last element in exclusive floating point rangesNiko Vuokko2015-06-171-3/+3
| | | |/ / / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | Fix exclusive floating point ranges to contain also the last element when the end-start difference is not an integer multiple of step.
| * | | | | | Merge pull request #4545 from retronym/topic/constr-varargs-toolboxAdriaan Moors2015-06-171-0/+1
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | Fix toolbox with varargs constructors