summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Some notes on reviewing.Adriaan Moors2015-02-131-2/+17
|
* Merge pull request #4324 from adriaanm/jline-2.12.1Adriaan Moors2015-02-131-1/+1
|\ | | | | SI-8759 bump jline: support alt-gr-based keyboards
| * SI-8759 bump jline: support alt-gr-based keyboardsAdriaan Moors2015-02-121-1/+1
|/ | | | | | | Users of German & Swedish keyboards can again type `]` in the REPL without crazy acrobatics. Fixed upstream in https://github.com/jline/jline2/pull/175
* Merge pull request #4315 from adriaanm/talk-to-usAdriaan Moors2015-02-101-0/+17
|\ | | | | The talk-to-a-human option.
| * The talk-to-a-human optionAdriaan Moors2015-02-101-0/+17
| |
* | Merge pull request #4263 from lrytz/t9097Adriaan Moors2015-02-094-5/+40
|\ \ | |/ |/| SI-9097 Remove spurious warning about conflicting filenames
| * Refactor transformStats impls for consistencyJason Zaugg2015-02-032-4/+3
| | | | | | | | | | | | Uses the same idiom in `Flatten` and `LambdaLift` as is established in `Extender` and (recently) `Delambdafy`. This avoids any possibility of adding a member to a package twice, as used to happen in SI-9097.
| * 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-204-1/+39
| | | | | | | | | | | | | | | | | | | | | | | | 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-094-0/+52
|\ \ | | | | | | SI-9095 Memory leak in LinkedHasMap and LinkedHashSet
| * | SI-9095 Memory leak in LinkedHasMap and LinkedHashSetDenton Cockburn2015-01-314-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | 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-092-3/+65
|\ \ \ | | | | | | | | SI-8988 Escaping character in StringLike.split(c) is slow
| * | | SI-8988 Escaping character in StringLike.split(c) prevents usage of ↵Denton Cockburn2015-01-092-3/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-093-0/+31
|\ \ \ \ | | | | | | | | | | SI-9041 Avoid unreported type error with overloading, implicits
| * | | | SI-9041 Avoid unreported type error with overloading, implicitsJason Zaugg2015-02-023-0/+31
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If `qual.foo(args)` fails to typecheck, we fall back to `ImplicitView(qual).foo(args)`. However, if the original type error stemmed from an overload ambiguity, the tree `Select(qual, 'foo')` holds onto an error symbol. The fall back attempt just returns an `Apply` tree containing the erroneous qualifier, as it does not want to issue cascading type errors. This commit replaces the error symbol with a `NoSymbol`, which triggers the second try typechecking to perform overload resolution again. A more principled fix might be to more pervasively duplicate trees before mutating their types and symbols, that this is beyond the scope of this bug fix.
* | | | Merge pull request #4274 from retronym/ticket/9123Adriaan Moors2015-02-093-0/+16
|\ \ \ \ | | | | | | | | | | SI-9123 More coherent trees with patmat, dependent types
| * | | | SI-9123 More coherent trees with patmat, dependent typesJason Zaugg2015-01-293-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pattern matcher needs to substitute references to bound variables with references to either a) synthetic temporary vals, or to b) selections. The latter occurs under -optimize to avoid to be frugal with local variable slots. For instance: ``` def test(s: Some[String]) = s match { case Some(elem) => elem.length } ``` Is translated to: ``` def test(s: Some[String]): Int = { case <synthetic> val x1: Some[String] = s; case4(){ if (x1.ne(null)) matchEnd3(x1.x.length()) else case5() }; case5(){ matchEnd3(throw new MatchError(x1)) }; matchEnd3(x: Int){ x } } ``` However, for a long time this translation failed to consider references to the binder in types. #4122 tried to address this by either using standard substitution facilities where available (references to temp vals), and by expanding the patmat's home grown substitution to handle the more complex case of referencing a selection. However, this left the tree in an incoherent state; while it patched up the `.tpe` field of `Tree`s, it failed to modify the info of `Symbol`-s. This led to a crash in the later uncurry phase under `-Ydelambdafy:method`. This commit modifies the info of such symbols to get rid of stray refeferences to the pattern binder symbols.
* | | | | Merge pull request #4298 from adriaanm/contribAdriaan Moors2015-02-063-71/+187
|\ \ \ \ \ | | | | | | | | | | | | Rewrite contrib guidelines: shorter & friendlier
| * | | | | IDE setup sectionAdriaan Moors2015-02-063-23/+27
| | | | | |
| * | | | | Load balance across CONTRIBUTING/READMEAdriaan Moors2015-02-062-37/+139
| | | | | | | | | | | | | | | | | | | | | | | | Lower friction some more (submit PR first, ask questions later!)
| * | | | | Rewrite contrib guidelines: shorter & friendlierAdriaan Moors2015-02-051-42/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactored to be less "just do it this way", and more "here's how you can contribute more effectively". Tried to motivate requirements, strike lighter tone in general.
* | | | | | Merge pull request #4213 from soc/topic/scala-partest-1.0.3Adriaan Moors2015-02-051-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | Update scala-partest dependency to 1.0.3
| * | | | | | Update scala-partest dependency to 1.0.3Simon Ochsenreither2014-12-161-1/+1
| | |_|_|/ / | |/| | | |
* | | | | | Merge pull request #4293 from BartoszJanota/patch-1Lukas Rytz2015-02-051-1/+2
|\ \ \ \ \ \ | | | | | | | | | | | | | | Patch 1 - Scala doc improved
| * | | | | | Scala doc update (sliding method). Added info about default step set to 1. ↵BartekJanota2015-02-041-1/+2
| | |_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reading this doc (having no code) can be ambiguous. updated scala doc (overloaded sliding method) Step is a method parameter and must be always given explicit, so info about default value is wrong.
* | | | | | Merge pull request #4295 from retronym/ticket/9135Grzegorz Kossakowski2015-02-052-1/+17
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-9135 Fix NPE, a regression in the pattern matcher
| * | | | | | SI-9135 Fix NPE, a regression in the pattern matcherJason Zaugg2015-02-052-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The community build discovered that #4252 introduced the possibility for a NullPointerException. The tree with a null type was a synthetic `Apply(<<matchEnd>>)` created by the pattern matcher. This commit adds a null check.
* | | | | | | Merge pull request #4251 from retronym/ticket/6502Jason Zaugg2015-02-054-39/+64
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-6502 More robust REPL :require
| * \ \ \ \ \ \ Merge pull request #9 from som-snytt/review/6502Jason Zaugg2015-01-212-29/+25
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-6502 Convert test to asserts
| | * | | | | | | SI-6502 Convert test to assertsSom Snytt2015-01-202-29/+25
| |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | This saves a check file in the crowded test directory.
| * | | | | | | REPL: Tread EOF a "no" in the "yes"/"no" prompt.Jason Zaugg2015-01-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before, we got in an endless loop if using ^D to try to end the session. When piping commands into the REPL, this was rather annoying! ``` scala-hash v2.11.5 Welcome to Scala version 2.11.5-20150101-184742-3fafbc204f (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_25). Type in expressions to have them evaluated. Type :help for more information. scala> :require xxx java.lang.NullPointerException at scala.tools.nsc.interpreter.ILoop.scala$tools$nsc$interpreter$ILoop$$flatten$1(ILoop.scala:651) at scala.tools.nsc.interpreter.ILoop.require(ILoop.scala:654) That entry seems to have slain the compiler. Shall I replay your session? I can re-run each line except the last one. [y/n]^D You must enter y or n. That entry seems to have slain the compiler. Shall I replay your session? I can re-run each line except the last one. [y/n]^D ... ```
| * | | | | | | SI-6502 More robust REPL :requireJason Zaugg2015-01-162-11/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - handle missing files gracefully (rather than NPE) - read the class name with ASM, rather than with a dummy classloader. The dummy classloader is prone to throwing `LinkageError`s, as reported in the comments of SI-6502. Manual test of the original report: ``` % qscala Welcome to Scala version 2.11.5-20150115-183424-155dbf3fdf (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_25). Type in expressions to have them evaluated. Type :help for more information. scala> :require does/not/exist Cannot read: does/not/exist scala> classOf[org.junit.Test] <console>:8: error: object junit is not a member of package org classOf[org.junit.Test] ^ scala> :require /Users/jason/.m2/repository/junit/junit/4.11/junit-4.11.jar Added '/Users/jason/.m2/repository/junit/junit/4.11/junit-4.11.jar' to classpath. scala> classOf[org.junit.Test] res1: Class[org.junit.Test] = interface org.junit.Test ``` I have commited an automated test that is a minimization of this one.
* | | | | | | | Merge pull request #4248 from retronym/ticket/9086Jason Zaugg2015-02-052-1/+13
|\ \ \ \ \ \ \ \ | |_|/ / / / / / |/| | | | | | | SI-9086 Fix regression in implicit search
| * | | | | | | SI-9086 Fix regression in implicit searchJason Zaugg2015-01-292-1/+13
| | |_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implicit search declines to force the info of candidate implicits that either a) are defined beyond the position of the implicit search site, or b) enclose the implicit search site. The second criterion used to prevent consideration of `O` in the super constructor call: implicit object O extends C( { implicitly[X] }) However, after https://github.com/scala/scala/pull/4043, the block containing the implicit search is typechecked in a context owned by a local dummy symbol rather than by `O`. (The dummy and `O` share an owner.) This led to `O` being considered as a candidate for this implicit search. This search is undertaken during completion of the info of `O`, which leads to it being excluded on account of the LOCKED flag. Unfortunately, this also excludes it from use in implicit search sites subsequent to `O`, as `ImplicitInfo` caches `isCyclicOrErroneous`. This commit adjusts the position of the local dummy to be identical to that of the object. This serves to exclude `O` as a candidate during the super call on account of criterion a).
* | | | | | | Merge pull request #4133 from som-snytt/issue/8976Ichoran2015-02-045-9/+127
|\ \ \ \ \ \ \ | |_|_|_|_|/ / |/| | | | | | SI-8976 MutableList.tail.iterator.size is length
| * | | | | | SI-8976 MutableList.tail.iterator.size is lengthSom Snytt2014-12-065-9/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous behavior was to iterate over the mutated list of arbitrary length. The previous iteration of the iterator would also iterate the terminal element of the list without halting. This is fixed by capping the length of iterator. That is OK because mutating the list by adding to it during iteration is not recommended. For good measure, the exhausted iterator does not hold a reference to any remaining tail. A test is added that will no doubt be superseded by the QCC tests. (Quasi-Comprehensive Collections.) The test just checks that the extra tail is not strongly reachable from the iterator. If the garbage collector happens to kick in and determine that the object is weakly reachable, then the check terminates early.
* | | | | | | Merge pull request #4204 from mpociecha/correct-decimal-marks-in-testsGrzegorz Kossakowski2015-02-031-3/+12
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Fix problems with a locale-dependent decimal mark in StringContextTest
| * | | | | | | Fix problems with a locale-dependent decimal mark in StringContextTestmpociecha2014-12-141-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit corrects three tests which were failing for certain locale due to the different decimal marks in the expected value and the result (e.g. 2.50 and 2,50). From now also the expected value is formatted in accordance with the current locale.
* | | | | | | | Merge pull request #4233 from kanielc/SI-7770Lukas Rytz2015-02-034-2/+6
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-7770 mutable.BitSet.toImmutable isn't immutable
| * | | | | | | | SI-7770 mutable.BitSet.toImmutable isn't immutableDenton Cockburn2015-01-074-2/+6
| | |_|_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mark method as deprecated due to it not providing the expected result, while fixing it will break existing code.
* | | | | | | | Merge pull request #4260 from retronym/ticket/9093Lukas Rytz2015-02-033-1/+12
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-9093 Fix value discarding / multiple param list crasher
| * | | | | | | | SI-9093 Fix value discarding / multiple param list crasherJason Zaugg2015-01-203-1/+12
| | |_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The type error stemming from missing argument list was being swallowed when the expected type was `Unit` and there were undetermined type parameters in the expression. This commit modifies `adapt` to avoid using `instantiateExpectingUnit` when the tree is typed with `MethodType`.
* | | | | | | | Merge pull request #4252 from retronym/ticket/9050Lukas Rytz2015-02-032-1/+32
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-9050 Fix crasher with value classes, recursion
| * | | | | | | | SI-9050 Fix crasher with value classes, recursionJason Zaugg2015-01-162-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From the "Substitution is hard to do" department. In 7babdab9a, TreeSymSubstitutor was modified to mutate the info of symbols defined in the tree, if that symbol's info referred to one of the `from` symbols in the substitution. It would have been more principled to create a cloned symbol with the updated info, and add that to the substitution. But I wasn't able implement that correctly (let alone efficiently.) The in-place mutation of the info of a symbol led to the crasher in this bug: a singleton type over that symbol ends up with a stale cached value of 'underlying'. In the enclosed test case, this leads to a type error in the `SubstituteRecursion` of the extension methods phase. This commit performs a cleanup job at the end of `substituteSymbols` by invalidating the cache of any `SingleType`-s in the tree that refer to one of the mutated symbols.
* | | | | | | | | Merge pull request #4245 from dickwall/doc/scaladoc-concurrent-packageLukas Rytz2015-02-031-0/+74
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Document concurrent package object
| * | | | | | | | | Added package scaladoc for the concurrent package.dickwall2015-01-121-0/+74
| | |_|_|_|_|_|/ / | |/| | | | | | |
* | | | | | | | | Merge pull request #4292 from retronym/ticket/9133Grzegorz Kossakowski2015-02-033-1/+11
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-9133 Harden against infinite loop in NoSymbol.owner
| * | | | | | | | | Silence a feature warning in JUnit test code.Jason Zaugg2015-02-031-0/+1
| | | | | | | | | |
| * | | | | | | | | SI-9133 Harden against infinite loop in NoSymbol.ownerJason Zaugg2015-02-032-1/+10
| | |_|_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The available evidence gathered in an IDE hang suggests that while editing erronenous code, a call to `Erasure#javaSig` by the IDE's structure builder triggered the `ExplicitOuter` info transformer on a symbol with some sort of incoherent owner chain, which led to an infinite loop in `NoSymbol#outerClass`. This commit hardens that method to work in the same manner as a call to `NoSymbol.owner`: log the error under -Xdev or -Ydebug and return return `NoSymbol` to soldier on without crashing / hanging. I haven't formulated a theory about how we might have ended up with the corrupt owner chain.
* | | | | | | | | Merge pull request #4216 from som-snytt/issue/7623Lukas Rytz2015-02-035-6/+71
|\ \ \ \ \ \ \ \ \ | |/ / / / / / / / |/| | | | | | | | SI-7623 Trailing sequence wildcard warning