summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* SI-9734 Narrow type when import REPL history (#5084)som-snytt2016-04-201-1/+1
| | | | | Under `-Yrepl-class-based`, imports from historical `$read` instances must be singleton-typed so that path-dependent types remain so.
* SI-9735 REPL prefer standard escapes for code text (#5086)som-snytt2016-04-201-4/+12
| | | | | When constructing code text for compilation, the REPL should prefer standard escape sequences, in case unicode escapes are disabled.
* Automate Eclipse settings and update project files: (#5091)Iulian Dragos2016-04-209-27/+101
| | | | | | | | - remove `M2_REPO`. All dependencies are picked up from `build/deps` - add script to update an existing workspace directory with the required path variables - add the default Scala library to several projects for better out-of-the-box experience. This means that changes in the scale-library project may not be visible in the other projects, but makes it way easier to get a working config. If you really need that, you probably know what you’re doing anyway.
* Merge pull request #5054 from lrytz/intellij-2.112.11.xLukas Rytz2016-03-2323-234/+336
|\ | | | | Update IntelliJ build for use with sbt
| * Update IntelliJ build for use with sbtLukas Rytz2016-03-2123-234/+336
| |
* | SI-9488 - adds the same default toString format to Scala Futures as 2.12.xViktor Klang2016-03-221-0/+4
|/ | | | Includes tests to verify the toString representations.
* Merge pull request #5005 from janekdb/2.11.x-man-page-scalacv2.11.8Seth Tisue2016-03-041-25/+26
|\ | | | | Document -Xxml:coalescing in scalac man page
| * Document -Xxml:coalescing in scalac man pageJanek Bogucki2016-03-031-25/+26
| | | | | | | | The formatting style is based on -g and -target.
* | Merge pull request #4994 from dk14/patch-1Seth Tisue2016-03-041-1/+1
|\ \ | | | | | | explicitly specify insertion-order feature in docs
| * | explicitly specify insertion-order feature in docsdk142016-02-231-1/+1
| | |
* | | Typesafe -> Lightbend in more placesSeth Tisue2016-03-042-2/+2
| | |
* | | SI-9425 Fix a residual bug with multi-param-list case classesJason Zaugg2016-03-041-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | During code review for the fix for SI-9546, we found a corner case in the SI-9425 that remained broken. Using `finalResultType` peels off all the constructor param lists, and solves that problem.
* | | SI-9546 Fix regression in rewrite of case apply to constructor callJason Zaugg2016-03-021-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In SI-9425, I disabled the rewrite of `CaseClass.apply(x)` to `new CaseClass(x)` if the constructor was was less accessible than the apply method. This solved a problem with spurious "constructor cannot be accessed" errors during refchecks for case classes with non-public constructors. However, for polymorphic case classes, refchecks was persistent, and even after refusing to transform the `TypeApply` within: CaseClass.apply[String]("") It *would* try again to transform the enclosing `Select`, a code path only intended for monomorphic case classes. The tree has a `PolyType`, which foiled the newly added accessibility check. I've modified the call to `isSimpleCaseApply` from the transform of `Select` nodes to exclude polymorphic apply's from being considered twice.
* | | Refactor transform of case apply in refchecksJason Zaugg2016-03-021-28/+30
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've identified a dead call to `transformCaseApply` that seems to date back to Scala 2.6 vintages, in which case factory methods were a fictional companion method, rather than a real apply method in a companion module. This commit adds an abort in that code path to aide code review (if our test suite still passes, we know that I've removed dead code, rather than silently changing behaviour.) The following commit will remove it altogether I then inlined a slightly clunky abstraction in the two remaining calls to `transformCaseApply`. It was getting in the way of a clean fix to SI-9546, the topic of the next commit.
* | Fix bold text in reflect API for 2.11.xFelix Mulder2016-02-271-1/+1
| | | | | | Same as #4999
* | Merge pull request #4993 from SethTisue/sbt-0.13.11Seth Tisue2016-02-261-46/+46
|\ \ | | | | | | upgrade to sbt 0.13.11
| * | upgrade to sbt 0.13.11Seth Tisue2016-02-221-46/+46
| | | | | | | | | | | | yum! delicious dogfood!
* | | Typesafe is now LightbendSeth Tisue2016-02-249-18/+18
| | |
* | | Remove GIJ memory configuration advice from fsc, scala and scalac man pages.Janek Bogucki2016-02-203-15/+3
| | | | | | | | | | | | | | | | | | | | | GIJ is uncommonly used so general guidance on setting memory configuration in the fsc, scala and scalac man pages would only be of use to a highly select group of individuals. For 99.99999999999999% of users this info would be an historical curio at best and random noise at worst.
* | | fix smhasher urlxuwei-k2016-02-152-2/+2
| | | | | | | | | | | | | | | google code is dead http://google-opensource.blogspot.jp/2015/03/farewell-to-google-code.html
* | | Fix off-by-one documentation error in Product<N>Janek Bogucki2016-02-1123-24/+23
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sanity check: scala> case class P2(i: Int, j: Int) defined class P2 val p2 = P2(1, 3) p2.productElement(0) res0: Any = 1 p2.productElement(1) res1: Any = 3 p2.productElement(2) java.lang.IndexOutOfBoundsException: 2 at P2.productElement(<console>:10)
* | Merge pull request #4954 from retronym/topic/fullnameLukas Rytz2016-02-101-13/+25
|\ \ | | | | | | Micro optimise Symbol#fullName
| * | Micro optimise Symbol#fullNameJason Zaugg2016-02-091-13/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old approach of recursively calling `fullNameAsName` creates a lot of garbage for intermediate results, in addition to needless interning of those results into the name table. This commit instead creates a string buffer of the correct capacity and writes the component names directly into this. I compared old and new approaches and this shows a 2x speedup. ``` scala> val th = ichi.bench.Thyme.warmed(verbose = print) th: ichi.bench.Thyme = ichi.bench.Thyme@1643e817 scala> val w_old = th.Warm(sym.fullNameAsNameOld('.')) w_old: th.Warm[$r.intp.global.Name] = ichi.bench.Thyme$Warm@7a8d001b scala> val w_new = th.Warm(sym.fullNameAsName('.')) w_new: th.Warm[$r.intp.global.Name] = ichi.bench.Thyme$Warm@1ec14586 scala> th.pbenchOffWarm("", x => println(x))(w_old, 10, "old")(w_new, 10, "new") Benchmark comparison (in 4.084 s) old vs new Significantly different (p ~= 0) Time ratio: 0.53572 95% CI 0.51618 - 0.55525 (n=20) old 64.54 ns 95% CI 62.41 ns - 66.67 ns new 34.57 ns 95% CI 34.04 ns - 35.11 ns res3: $r.intp.global.Name = scala.collection.parallel.mutable.ParSeq ``` It is still expensive enough that we should still consider caching. The call to full name in `classBTypeFromSymbol` in the new backed is a prime candidate for optimization.
* | | Merge pull request #4939 from szeiger/issue/9624Lukas Rytz2016-02-103-15/+25
|\ \ \ | | | | | | | | SI-9624 Improve documentation for TraversableOnce
| * | | SI-9624 Improve documentation for TraversableOnceStefan Zeiger2016-02-043-15/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Move the doc comment for `hasDefiniteSize` up from TraversableLike to GenTraversableOnce and improve it. - Add a note to `GenTraversableOnce.isEmpty` that implementations must not consume elements. - Clarify alternatives to subclassing TraversableOnce.
* | | | Merge pull request #4928 from szeiger/wip/document-e-ncLukas Rytz2016-02-102-1/+14
|\ \ \ \ | | | | | | | | | | Document that `scala -e` starts/uses a compilation daemon
| * | | | Document when the `scala` command starts/uses a compilation daemonStefan Zeiger2016-02-012-1/+14
| | | | |
* | | | | Merge pull request #4950 from retronym/topic/sbt-tweaks-3Seth Tisue2016-02-092-1/+111
|\ \ \ \ \ | |_|_|/ / |/| | | | SBT build improvements
| * | | | Enable IntellIJ smarts while editing the buildJason Zaugg2016-02-072-1/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even though our build can't be imported into IntelliJ automatically, we don't need to live in the dark ages of red squigglies when editing build.sbt. This commit hand-crafts the module defintion for the project, which has SBT and its dependendencies on the classpath. A screenshot of the code assist is worth the thousand expletives I uttered while writing the pictured code without this facility: https://www.dropbox.com/s/6mxv0iwxkhvnor7/Screenshot%202016-02-07%2022.09.12.png?dl=0 To download the sources for the SBT JARs that are referenced herein, run sbt> reload plugins sbt> updateClassifiers
* | | | | Merge pull request #4937 from szeiger/issue/9623-2.11Seth Tisue2016-02-081-6/+45
|\ \ \ \ \ | |/ / / / |/| | | | SI-9623 Avoid unnecessary hasNext calls in JoinIterator & ConcatIterator
| * | | | SI-9623 Avoid unnecessary hasNext calls in JoinIterator & ConcatIteratorStefan Zeiger2016-02-011-6/+45
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These iterator implementations are used to concatenate two (JoinIterator) or more (ConcatIterator) other iterators with `++`. They used to perform many unnecessary calls to the child iterators’ `hasNext` methods. This improved state machine-based implementation reduces that number to the bare minimum, i.e. iterating over concatenated iterators with `foreach` calls the children's `hasNext` methods a total of (number of children) + (number of elements) times, the same as when iterating over all children separately.
* | / / bump copyright year to 2016Seth Tisue2016-02-033-3/+3
| |/ / |/| |
* | | Merge pull request #4927 from szeiger/issue/9572Jason Zaugg2016-02-013-35/+58
|\ \ \ | | | | | | | | SI-9572 Check for illegal tuple sizes in the parser
| * | | SI-9572 Check for illegal tuple sizes in the parserStefan Zeiger2016-01-283-35/+58
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds explicit checks with syntax errors for tuple literals and types of more than 22 elements. An alternative approach to fixing SI-9572 would be to revert to the old failure mode of Scala 2.10 where references to arbitrary `scala.TupleXY` would be generated in the parser, which then leads to “type/object not found” errors in the typechecker. This fix here is more intrusive but arguably provides a better user experience. Methods `stripParens` and `makeBinop` are moved from `TreeBuilder` to `Parsers` because they can now generate syntax errors. New methods `makeSafeTupleType` and `makeSafeTupleTerm` implement the error checking on top of `makeTupleType` and `makeTupleTerm`. They are overridden with no-op versions in the quasiquotes parser because it also overrides `makeTupleType` and `makeTupleTerm` in a way that supports arbitrary tuple sizes.
* / / SI-9534 Use BoxedUnit in all cases for creating Array[Unit]Stefan Zeiger2016-01-271-0/+3
|/ / | | | | | | | | | | | | | | Calling `wrap` or one of the higher-dimension Array factory methods on the `Manifest` for `Unit` led to an exception because it tried to use `void` as a primitive type. Unlike all other primitive Scala types, `Unit` needs to be boxed. The basic `newArray` method was not affected by this bug because it was already special-cased. The fix is to also special-case `arrayClass`.
* | Merge pull request #4891 from janekdb/2.11.x-CommentFactoryBase-mix-1Lukas Rytz2016-01-261-18/+16
|\ \ | | | | | | Trim complexity in CommentFactoryBase
| * | Trim complexity in CommentFactoryBaseJanek Bogucki2016-01-251-18/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Replace option handling with library call 2. Remove NumberFormatException catch presumed to be copy/paste legacy 3. It's Scaladoc 4. Parse trailing whitespace regex once instead of per line 5. Use string interpolation where it improves readability 6. Add missed alternative to block grammar production rule 7. Add regression test for tag requirement warnings
* | | Link 'Future' scaladoc to 'Futures and Promises'Arnout Engelen2016-01-251-0/+2
|/ /
* | Merge pull request #4899 from som-snytt/issue/9616Jason Zaugg2016-01-191-12/+15
|\ \ | | | | | | [backport] SI-9616 False positive in unused import warning
| * | [backport] SI-9616 False positive in unused import warningSom Snytt2016-01-071-12/+15
| | | | | | | | | | | | This is a minimal backport of the fix for SI-9383.
* | | Fix some simple extra wordsEitan Adler2016-01-1710-13/+13
| | | | | | | | | | | | The the word 'the' is often used twice. Fix that.
* | | Merge pull request #4886 from janekdb/2.11.x-scaladoc-Duration-linksSeth Tisue2016-01-141-2/+2
|\ \ \ | | | | | | | | Fix Scaladoc overloaded method link to Duration companion object
| * | | Fix Scaladoc overloaded method link to Duration companion objectJanek Bogucki2016-01-041-2/+2
| |/ / | | | | | | | | | | | | | | | The links were being skipped with a warning before this commit. The key change was to remove the result type and add an asterisk.
* | | Merge pull request #4902 from ruippeixotog/issue/9605Seth Tisue2016-01-131-6/+6
|\ \ \ | | | | | | | | SI-9605 Searching does not use binary search for Array
| * | | SI-9605 Searching does not use binary search for ArrayRui Gonçalves2016-01-121-6/+6
| |/ / | | | | | | | | | Binary search should be used for every `IndexedSeqLike` instance and not only for `IndexedSeq`. According the Scaladoc, it is `IndexedSeqLike` that guarantees "constant-time or near constant-time element access and length computation".
* / / SI-8641 Fix right shift docs for integer typesLinas Medziunas2016-01-035-20/+20
|/ / | | | | | | | | Docs for >> operation of integer types (from Byte to Long) had a wrong direction saying that it is bit-shift left.
* | Merge pull request #4862 from retronym/ticket/9567Lukas Rytz2015-12-182-4/+16
|\ \ | | | | | | SI-9567 Fix pattern match on 23+ param, method local case class
| * | SI-9567 Fix pattern match on 23+ param, method local case classJason Zaugg2015-11-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Typechecking constructor patterns of method local case classes was only working because of the existence of the unapply method in the companion, which is used if navigation to the case class companion object fails. We now support defintion of, and pattern matching on, case classes with more than 22 parameters. These have no `unapply` method in the companion, as we don't have a large enough tuple type to return. So for such case classes, the fallback that we inadvertently relied on would no longer save us, and we'd end up with a compile error advising that the identifier in the constructor pattern was neither a case class nor an extractor. This is due to the propensity of `Symbol#companionXxx` to return `NoSymbol` when in the midst of typechecking. That method should only be relied upon after typechecking. During typechecking, `Namers#companionSymbolOf` should be used instead, which looks in the scopes of enclosing contexts for symbol companionship. That's what I've done in this commit.
| * | SI-9567 Fix latent bugs in patmat's reasoning about mutabilityJason Zaugg2015-11-251-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Under -optimize, the pattern matcher tries to avoid local variables in favour of directly accessing to non-var case class accessors. However, the code that analysed the patterns failed to account properly for repeated parameters, which could either lead to a compiler crash (when assuming that the n-th subpattern must have a corresponding param accessor), or could lead to a correctness problem (when failing to eagerly the bound elements from the sequence.) The test case that tried to cover seems only to have been working because of a separate bug (the primary subject of SI-9567) related to method-local case classes: they were treated during typechecking as extractors, rather than native case classes. The subsequent commit will fix that problem, but first we must pave the way with this commit that emits local vals for bound elements of case class repeated params.
* | | Merge pull request #4882 from janekdb/2.11.x-scaladoc-tables-1Lukas Rytz2015-12-182-6/+11
|\ \ \ | | | | | | | | Document JavaConverters conversion from java.util.Properties to Map