summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | Fix typos in spec, docs and commentsMichaƂ Pociecha2015-08-2339-47/+47
|/ / / /
* | | | Merge pull request #4702 from janekdb/2.11.x-CONTRIBUTING-adviceAdriaan Moors2015-08-211-2/+2
|\ \ \ \ | | | | | | | | | | Sync commit advice to README.md and fix Scabot URL
| * | | | Sync commit advice to README.md and fix Scabot URLJanek Bogucki2015-08-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CONTRIBUTING.md offered different advice on commit subject line length to README.md. Align CONTRIBUTING to README. Fix Scabot repo URL
* | | | | Merge pull request #4696 from janekdb/2.11.x-contributingSeth Tisue2015-08-201-0/+1
|\| | | | | |_|/ / |/| | | Extend documentation contacts
| * | | Extend documentation contactsJanek Bogucki2015-08-191-0/+1
| |/ /
* | | Merge pull request #4693 from scala/revert-3791-ticket/8346Seth Tisue2015-08-205-64/+6
|\ \ \ | | | | | | | | Revert "SI-8346 Rebuild invariant sets in #toSet, avoiding CCE"
| * | | Revert "SI-8346 Rebuild invariant sets in #toSet, avoiding CCE"Adriaan Moors2015-08-185-64/+6
| |/ /
* | | Merge pull request #4697 from martijnhoekstra/patch-3Seth Tisue2015-08-191-2/+2
|\ \ \ | | | | | | | | Fix documentation of Stream.filter introduced in 13f30c
| * | | Fix documentation of filter introduced in 13f30cmartijnhoekstra2015-08-191-2/+2
| |/ /
* | | Merge pull request #4695 from janekdb/2.11.x-scaladoc-PredefSeth Tisue2015-08-191-1/+1
|\ \ \ | |/ / |/| | Fix method name reference in Predef documentation
| * | Fix method name reference in Predef documentationJanek Bogucki2015-08-191-1/+1
|/ /
* | Merge pull request #4678 from stusmall/2.11.xLukas Rytz2015-08-101-0/+4
|\ \ | | | | | | Improved error message for "filename too long" build errors
| * | SI-3623 Improved error message for "filename too long" build errorsstusmall2015-08-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | When building on ecryptfs filenames can be limited to ~142 characters. This limit doesn't take long to hit and can leave the the user with a hard to diagnosis error message. Some legacy file systems will have similarly small limits. This just adds a hint that the error might be related to the underlying fs.
* | | Merge pull request #4688 from retronym/topic/typer-debug-implicitsLukas Rytz2015-08-102-3/+5
|\ \ \ | |_|/ |/| | Fix tracing of implicit search under -Ytyper-debug
| * | Fix tracing of implicit search under -Ytyper-debugJason Zaugg2015-08-062-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The log messages intented to chronicle implicit search were always being filtered out by virtue of the fact that the the tree passed to `printTyping` was already typed, (e.g. with an implicit MethodType.) This commit enabled printing in this case, although it still filters out trees that are deemed unfit for typer tracing, such as `()`. In the context of implicit search, this happens to filter out the noise of: ``` | | | [search #2] start `()`, searching for adaptation to pt=Unit => Foo[Int,Int] (silent: value <local Test> in Test) implicits disabled | | | [search #3] start `()`, searching for adaptation to pt=(=> Unit) => Foo[Int,Int] (silent: value <local Test> in Test) implicits disabled | | | \-> <error> ``` ... which I think is desirable. The motivation for this fix was to better display the interaction between implicit search and type inference. For instance: ``` class Foo[A, B] class Test { implicit val f: Foo[Int, String] = ??? def t[A, B](a: A)(implicit f: Foo[A, B]) = ??? t(1) } ``` ```` % scalac -Ytyper-debug sandbox/instantiate.scala ... | |-- t(1) BYVALmode-EXPRmode (site: value <local Test> in Test) | | |-- t BYVALmode-EXPRmode-FUNmode-POLYmode (silent: value <local Test> in Test) | | | [adapt] [A, B](a: A)(implicit f: Foo[A,B])Nothing adapted to [A, B](a: A)(implicit f: Foo[A,B])Nothing | | | \-> (a: A)(implicit f: Foo[A,B])Nothing | | |-- 1 BYVALmode-EXPRmode-POLYmode (site: value <local Test> in Test) | | | \-> Int(1) | | solving for (A: ?A, B: ?B) | | solving for (B: ?B) | | [search #1] start `[A, B](a: A)(implicit f: Foo[A,B])Nothing` inferring type B, searching for adaptation to pt=Foo[Int,B] (silent: value <local Test> in Test) implicits disabled | | [search #1] considering f | | [adapt] f adapted to => Foo[Int,String] based on pt Foo[Int,B] | | [search #1] solve tvars=?B, tvars.constr= >: String <: String | | solving for (B: ?B) | | [search #1] success inferred value of type Foo[Int,=?String] is SearchResult(Test.this.f, TreeTypeSubstituter(List(type B),List(String))) | | |-- [A, B](a: A)(implicit f: Foo[A,B])Nothing BYVALmode-EXPRmode (site: value <local Test> in Test) | | | \-> Nothing | | [adapt] [A, B](a: A)(implicit f: Foo[A,B])Nothing adapted to [A, B](a: A)(implicit f: Foo[A,B])Nothing | | \-> Nothing ```
* | | Merge pull request #4620 from lastland/patch-1Seth Tisue2015-08-071-1/+2
|\ \ \ | | | | | | | | Fix the bug in the example in scala.sys.process
| * | | Wait until the cat process is finished.Li Yao2015-08-071-1/+2
| | | |
| * | | Fix the bug in the example in scala.sys.processLi Yao2015-07-111-1/+1
| | | | | | | | | | | | There's no `!` method with argument type `ProcessIO`. I suppose this is intended to be `run`.
* | | | Merge pull request #4443 from adriaanm/abstractpromise-avoid-unsafeSeth Tisue2015-08-063-30/+25
|\ \ \ \ | | | | | | | | | | SI-8362: AbstractPromise extends AtomicReference, avoids sun.misc.Unsafe
| * | | | SI-8362: AbstractPromise extends AtomicReferenceMariot Chauvin2015-07-293-30/+25
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To avoid `sun.misc.Unsafe`, which is not supported on Google App Engine. Deprecate `AbstractPromise` --> extend `j.u.c.atomic.AtomicReference` directly. `AtomicReference.compareAndSet()` should also provide better performance on HotSpot, which compiles it down to the machine's CAS instruction. The binary incompatible change is ok because it's in an internal package. I can't think of any real issue with adding a superclass (which contributes only final methods) to a class in an implementation package (as long as those methods were not introduced in any illicit subclasses of said class). Instead of changing `DefaultPromise`'s super class, let's be more conservative, and do it closest to the source. This is both clearer and more focussed, leaving those subclasses of AbstractPromise we never heard of unaffected. Genesis of the commit: since the work on `Future` performance, `AbstractPromise` is using `Unsafe`, breaking the ability for `Future` to be executed on GAE. At that time, viktorklang suggested to implement a fallback in case `Unsafe` is not available. carey proposed an implementation, and mchv submitted a patch, which was refined by adriaanm.
* | | | Merge pull request #4554 from som-snytt/issue/1931Seth Tisue2015-08-0624-84/+139
|\ \ \ \ | | | | | | | | | | SI-1931 Hide Predef.any2stringadd in REPL
| * | | | SI-1931 Hide Predef.any2stringadd in REPLSom Snytt2015-07-0624-84/+139
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | User imports that reference Predef are relocated to the top of the wrapping template so that they can hide implicits defined in Predef. Only one import from Predef is retained for special treatment. This is simple and sane. The test shows that `import Predef._` restores Predef implicits even if a user-defined term would normally be in scope. A smart `:import` command to turn off or quarantine imports explicitly would allow fine-grained control.
* | | | Merge pull request #4672 from janekdb/2.11.x-scaladoc-compilerSeth Tisue2015-08-0610-21/+21
|\ \ \ \ | | | | | | | | | | ScalaDoc fixes for compiler
| * | | | ScalaDoc fixes for compilerJanek Bogucki2015-07-2910-21/+21
| | |/ / | |/| |
* | | | Merge pull request #4675 from retronym/ticket/9425Seth Tisue2015-08-062-1/+10
|\ \ \ \ | | | | | | | | | | SI-9425 Leave Companion.apply if constructor is less accessible
| * | | | SI-9425 Leave Companion.apply if constructor is less accessibleJason Zaugg2015-07-312-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calls to synthetic case class apply methods are inlined to the underlying constructor invocation in refchecks. However, this can lead to accessibility errors if the constructor is private. This commit ensures that the constructor is at least as accessible as the apply method before performing this tranform. I've manually checked that other the optimization still works in other cases: scala> class CaseApply { Some(42) } defined class CaseApply scala> :javap -c CaseApply Compiled from "<console>" public class CaseApply { public CaseApply(); Code: 0: aload_0 1: invokespecial #9 // Method java/lang/Object."<init>":()V 4: new #11 // class scala/Some 7: dup 8: bipush 42 10: invokestatic #17 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer; 13: invokespecial #20 // Method scala/Some."<init>":(Ljava/lang/Object;)V 16: pop 17: return }
* | | | | Merge pull request #4684 from janekdb/2.11.x-unit-return-in-mapSeth Tisue2015-08-061-1/+1
|\ \ \ \ \ | | | | | | | | | | | | Stop mapping to Unit when executing finally code.
| * | | | | Stop mapping to Unit when executing finally code.Janek Bogucki2015-08-051-1/+1
| | |_|_|/ | |/| | | | | | | | | | | | | Finally.invoke has result type Unit so foreach is sufficient here.
* | | | | Merge pull request #4685 from janekdb/2.11.x-length-not-sizeSeth Tisue2015-08-061-2/+2
|\ \ \ \ \ | | | | | | | | | | | | Avoid unnecessary implicit view on String
| * | | | | Avoid unnecessary implicit view on StringJanek Bogucki2015-08-051-2/+2
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using length instead of size on String to avoid a conversion call. This dump confirms there is a conversion to StringOps when using size. object StringSize { val s = "hi" println(s.size) } $ scalac -Xprint:typer StringSize.scala [[syntax trees at end of typer]] // StringSize.scala package <empty> { object StringSize extends scala.AnyRef { def <init>(): StringSize.type = { StringSize.super.<init>(); () }; private[this] val s: String = "hi"; <stable> <accessor> def s: String = StringSize.this.s; scala.this.Predef.println(scala.this.Predef.augmentString(StringSize.this.s).size) } }
* | | | | Merge pull request #4682 from adriaanm/jline-quick.binSeth Tisue2015-08-051-1/+1
|\ \ \ \ \ | |/ / / / |/| | | | Include jline on quick.bin tool path
| * | | | Include jline on quick.bin tool pathAdriaan Moors2015-08-041-1/+1
| | |/ / | |/| |
* | | | Merge pull request #4680 from janekdb/2.11.x-optionJason Zaugg2015-08-054-41/+11
|\ \ \ \ | |/ / / |/| | | Delegate null test to Option
| * | | Delegate null test to OptionJanek Bogucki2015-08-044-41/+11
|/ / / | | | | | | | | | | | | Option(null) is None while Option(v) is Some(v) which makes the null test redundant.
* | | Merge pull request #4670 from retronym/ticket/9422Lukas Rytz2015-07-292-3/+16
|\ \ \ | |/ / |/| | SI-9422 Fix incorrect constant propagation
| * | SI-9422 Fix incorrect constant propagationJason Zaugg2015-07-292-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ConstantOptimization phase uses abstract interpretation to track what is known about values, and then to use this information to optimize away tests with a statically known result. Constant propagation was added under -optimize in Scala 2.11.0-M3, in PR #2214. For example, we might know that a variable must hold one of a set of values (`Possible`). Or, we could track that it must *not* be of of a set of value (`Impossible`). The test case in the bug report was enough to create comparison: v1 == v2 // where V1 = Possible(Set(true, false)) // V2 = Possible(Set(true, false)) This test was considered to be always true, due to a bug in `Possible#mightNotEqual`. The only time we can be sure that `Possible(p1) mightNotEquals Possible(p2)` is if `p1` and `p2` are the same singleton set. This commit changes this method to implement this logic. The starting assumption for all values is currently `Impossible(Set())`, although it would also be reasonable to represent an unknown boolean variable as `Possible(Set(true, false))`, given the finite and small domain. I tried to change the starting assumption for boolean locals in exactly this manner, and that brings the bug into sharp focus. Under this patch: https://github.com/retronym/scala/commit/e564fe522d This code: def test(a: Boolean, b: Boolean) = a == b Compiles to: public boolean test(boolean, boolean); Code: 0: iconst_1 1: ireturn Note: the enclosed test case does not list `-optimize` in a `.flags` file, I'm relying on that being passed in by the validation build. I've tested locally with that option, though.
* | | Merge pull request #4669 from janekdb/2.11.x-scaladoc-reflectJason Zaugg2015-07-298-13/+12
|\ \ \ | | | | | | | | ScalaDoc fixes for reflect
| * | | ScalaDoc fixes for reflectJanek Bogucki2015-07-288-13/+12
| | | |
* | | | Merge pull request #4667 from janekdb/2.11.x-scaladoc-library-library-auxJason Zaugg2015-07-298-11/+11
|\ \ \ \ | |/ / / |/| | | ScalaDoc fixes for library and library-aux
| * | | ScalaDoc fixes for library and library-auxJanek Bogucki2015-07-288-11/+11
| | | |
* | | | Merge pull request #4665 from lrytz/asm-504-3Lukas Rytz2015-07-281-1/+1
|\ \ \ \ | | | | | | | | | | Upgrade scala-asm to 5.0.4-scala-3
| * | | | Upgrade scala-asm to 5.0.4-scala-3Lukas Rytz2015-07-281-1/+1
|/ / / / | | | | | | | | | | | | | | | | Fixes a crash in the backend when the bytecode of a method is too large (https://github.com/scala/scala-asm/issues/8).
* | | | Merge pull request #4661 from retronym/ticket/9365Lukas Rytz2015-07-284-1/+69
|\ \ \ \ | | | | | | | | | | SI-9365 Don't null out dependencies of transient lazy vals
| * | | | SI-9365 Don't null out dependencies of transient lazy valsJason Zaugg2015-07-274-1/+69
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As per Iulian's analysis: > When lazy vals are transient, the optimization in SI-720 is invalid, > leading to NPEs. These NPEs appear when recomputing the lazy val when deserializaing the object. This commit disables the field nulling if the lazy val is marked transient. The post-mixin tree in the enclosed test changes as follows: ``` --- sandbox/old.log 2015-07-27 15:48:03.000000000 +1000 +++ sandbox/new.log 2015-07-27 15:47:56.000000000 +1000 @@ -1,61 +1,54 @@ [[syntax trees at end of mixin]] // t9365.scala package <empty> { class Test extends Object with Serializable { @transient @volatile private[this] var bitmap$trans$0: Boolean = false; private def foo$lzycompute(): Object = { { Test.this.synchronized({ if (Test.this.bitmap$trans$0.unary_!()) { Test.this.foo = Test.this.x.apply(); Test.this.bitmap$trans$0 = true; () }; scala.runtime.BoxedUnit.UNIT }); - Test.this.x = null + () }; Test.this.foo }; ``` In addition to the test from the ticket, I've added a reflection based test that directly tests the nulling. This complements the test added in 449f2a7473, the fix for SI-720, which passes by virtue of not exhausting the heap.
* | | | Merge pull request #4662 from janekdb/2.11.x-redundant-val-modifierLukas Rytz2015-07-281-2/+2
|\ \ \ \ | | | | | | | | | | Remove redundant 'val' from case class params.
| * | | | Remove redundant 'val' from case class params.Janek Bogucki2015-07-271-2/+2
| | | | |
* | | | | Merge pull request #4664 from SethTisue/remove-dead-link-in-readmeLukas Rytz2015-07-281-1/+1
|\ \ \ \ \ | |_|_|/ / |/| | | | remove dead link in README.md
| * | | | fix readme for death of typesafe.artifactoryonline.comSeth Tisue2015-07-271-1/+1
| |/ / / | | | | | | | | | | | | there's no need for a link here anyway
* | | | Merge pull request #4636 from SethTisue/contributor-stuff-from-github-wikiSeth Tisue2015-07-272-17/+94
|\ \ \ \ | |/ / / |/| | | salvage text from old GitHub wiki so we can shut it down
| * | | merge two reviewers lists in readmeSeth Tisue2015-07-271-23/+9
| | | |