summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | | Merge pull request #4309 from som-snytt/issue/9116-bAdriaan Moors2015-02-183-4/+10
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-9116 Set.subsets has a param list
| * | | | | | | SI-9116 Set.subsets has a param listSom Snytt2015-02-093-4/+10
| | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now both of the overloaded variants have a parameter list. This seems to make type inference happier. Or it makes someone happier. The user is unaware whether `subsets()` takes a default arg. But happily, empty application still kicks in.
* | | | | | | Merge pull request #4299 from michaelpigg/si-7660Adriaan Moors2015-02-181-7/+21
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-7660: Document behaviour of Set#++ for duplicate elements
| * | | | | | | SI-7660: Document behaviour of Set#++ for duplicate elementsMichael Pigg2015-02-101-7/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Updated documentation of + and ++ in SetLike to explicitly state that duplicate elements are not added to the set.
* | | | | | | | Merge pull request #4341 from retronym/ticket/9157Adriaan Moors2015-02-183-6/+18
|\ \ \ \ \ \ \ \ | | |_|_|_|_|/ / | |/| | | | | | SI-9157 Avoid exponential blowup with chained type projections
| * | | | | | | SI-9157 Avoid exponential blowup with chained type projectionsJason Zaugg2015-02-183-6/+18
| | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling `findMember` in the enclosed test was calling into `NonClassTypeRef#relativeInfo` an exponentially-increasing number of times, with respect to the length of the chained type projections. The numbers of calls increased as: 26, 326, 3336, 33446, 334556. Can any pattern spotters in the crowd that can identify the sequence? (I can't.) Tracing the calls saw we were computing the same `memberType` repeatedly. This part of the method was not guarded by the cache. I have changed the method to use the standard idiom of using the current period for cache invalidation. The enclosed test now compiles promptly, rather than in geological time.
* | | | | | | Merge pull request #4328 from adriaanm/rework-4230Adriaan Moors2015-02-173-2/+28
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | SI-9059 Random.alphanumeric is inefficient
| * | | | | | SI-9059 Random.alphanumeric is inefficientDenton Cockburn2015-02-133-2/+28
| | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generate alphanumeric values by taking random element of string containing all alphanumerics. Instead of generating nextPrintableChar then filtering for alphanumerics, we can just take from a string containing all alphanumerics. This provides a significant performance improvement.
* | | | | | Merge pull request #4296 from lrytz/t9105Adriaan Moors2015-02-1321-104/+791
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fixes and tests for InnerClass / EnclsoingMethod classfile attributes
| * | | | | | Test java reflection on scala library / reflect / compiler jarsLukas Rytz2015-02-073-1/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Run a number of Java reflection operations on all classes in scala library / reflect / compiler. The test is based on a draft by Jason.
| * | | | | | IntelliJ project file fixLukas Rytz2015-02-071-0/+1
| | | | | | |
| * | | | | | Fix InnerClass / EnclosingMethod for closures nested in value classesLukas Rytz2015-02-0710-38/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Members of value classes are moved over to the companion object early. This change ensures that closure classes nested in value classes appear that way to Java reflection. This commit also changes the EnclosingMethod attribute for classes (and anonymous functions) nested in anonymous function bodies. Before, the enclosing method was in some cases the function's apply method. Not always though: () => { class C ... val a = { class D ...} } The class C used to be nested in the function's apply method, but not D, because the value definition for a was lifted out of the apply. After this commit, we uniformly set the enclosing method of classes nested in function bodies to `null`. This is consistent with the source-level view of the code. Note that under delambdafy:method, closures never appear as enclosing classes (this didn't change in this commit).
| * | | | | | Fix InnerClass/EnclosingMethod for trait impl and specialized classesLukas Rytz2015-02-077-41/+214
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Trait implementation classes and specialized classes are always considered top-level in terms of the InnerClass / EnclosingMethod attributes. These attributes describe source-level properties, and such classes are a compilation artifact. Note that the same is true for delambdafy:method closure classes (they are always top-level).
| * | | | | | SI-9124 fix EnclosingMethod of classes nested in implOnly trait defsLukas Rytz2015-02-073-1/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Private trait methods are not added to the generated interface, they end up only in the implementation class. For classes nested in such methods, the EnclosingMethod attribute was incorrect. Since the EnclosingMethod attribute expresses a source-level property, but the actual enclosing method does not exist in the bytecode, we set the enclosing method to null.
| * | | | | | SI-9105 Fix EnclosingMethod for classes defined in lambdasLukas Rytz2015-02-0712-43/+286
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change fixes both GenASM and GenBCode, except for the change to renaming in LamdaLift mentioned below. The reason for an inconsistent EnclosingMethod attribute was the symbol owner chain. Initially, closure class symbols don't exist, they are only created in UnCurry (delambdafy:inline). So walking the originalOwner of a definition does not yield closure classes. The commit also fixes uses of isAnonymousClass, isAnonymousFunction and isDelambdafyFunction in two ways: 1. by phase-travelling to an early phase. after flatten, the name includes the name of outer classes, so the properties may become accidentally true (they check for a substring in the name) 2. by ensuring that the (destructive) renames during LambdaLift don't make the above properties accidentally true. This was in fact the cause for SI-8900.
* | | | | | | Merge pull request #4304 from adriaanm/rebase-4219Adriaan Moors2015-02-133-27/+30
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | SI-8818 FreshName extractor forgives suffix
| * | | | | | SI-8818 FreshName extractor forgives suffixSom Snytt2015-02-093-27/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test is corrected (inverted) and the extractor is made more succinct. Succinctness isn't enforced by the test, but I checked it manually.
* | | | | | | Merge pull request #4195 from lrytz/t8841Adriaan Moors2015-02-139-22/+95
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-8841 report named arg / assignment ambiguity also in silent mode.
| * | | | | | | SI-8841 report named arg / assignment ambiguity also in silent mode.Lukas Rytz2014-12-129-22/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For local definitions (eg. in a block that is an argument of a method call), the type completer may have a silent context. A CyclicReference is then not thrown but transformed into a NormalTypeError. When deciding if 'x = e' is an assignment or a named arg, we need to report cyclic references, but not other type errors. In the above case, the cyclic reference was not reported. Also makes sure that warnings are printed after typing argument expressions.
* | | | | | | | 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 ... ```