summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* SI-9375 add synthetic readResolve only for static modulesLukas Rytz2015-07-307-7/+338
| | | | | | | | | For inner modules, the synthetic readResolve method would cause the module constructor to be invoked on de-serialization in certain situations. See the discussion in the ticket. Adds a comprehensive test around serializing and de-serializing modules.
* Cleanup in RefchecksLukas Rytz2015-07-243-17/+8
| | | | | | | | | | | | For historical reasons, when eliminating ModuleDef trees, RefChecks would check if moduleVar field already exists, and only create it if not. In reality, the lookup would always fail. When initially committed, the moduleVar could be created either by the RefChecks transformer or info transformer, see 256aca6. This was later changed (3f1f0a4), after which RefChecks only creates a moduleVar when eliminating a ModuleDef.
* Merge pull request #4647 from Ichoran/issue/8911Lukas Rytz2015-07-233-5/+48
|\ | | | | SI-8911 allow serializing Scala Maps wrapped as Java ones
| * SI-8911 scala.collection.convert.Wrappers$MapWrapper not serializableRex Kerr2015-07-193-5/+48
| | | | | | | | | | | | | | | | Added `with Serializable` to `MapWrapper` and `SetWrapper`. Test verifies that serialization works in the simplest case. Also updated tests in t8549 to check that serialization works and doesn't change.
* | Merge pull request #4652 from retronym/ticket/9408Lukas Rytz2015-07-236-9/+82
|\ \ | | | | | | SI-9408 Avoid capturing outer class in local classes.
| * | SI-9408 Avoid capturing outer class in local classes.Jason Zaugg2015-07-233-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, only local classes declared final would be candidates for outer pointer elision in the constructor phase. This commit infers finality of local classes to expand the scope of this optimization. == Background == This was brought to our attention when shapeless enabled indylambda and found that a hitherto serializable data structure started to capture the enclosing class and hence lost its serializability. class NotSerializable { def test = () => { class C; assertSerializable(new C) } } Under `-Ydelambdafy:inline`, it used to capture the enclosing anon function class as its outer, which, being final, didn't in turn capture the enclosing class. class NotSerializable { def test = new anonFun$1 } class anonFun$1 { def apply = assertSerializable(new C(this)) } class ...$C(outer$: anonFun) indylambda perturbs the enclosing structure of the function body. class NotSerializable { def anonFun$1 = {class C; assertSerializable(new C())) def test = lambdaMetaFactory(<<anonFun$1>>) } Which leads to: class NotSerializable$C(outer$: NotSerializable)
| * | Refactor to avoid duplicated work in ConstructorsJason Zaugg2015-07-231-3/+5
| | | | | | | | | | | | | | | | | | - Check if the clazz that owns all the decls we're filtering is effectively final once, rather than for each decl. - Query the full set of decls once.
| * | SI-9408 Record known subclasses of local classesJason Zaugg2015-07-234-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using the same facility that we use to record subclasses of sealed classes, record the subclasses of term-owned ("local") classes. I have changed existing callers of `children` to use `sealedChildren` so we don't start using this new information in pattern matching and type pattern checkability analysis. The following commit will build on this to infer finality of local classes in the context of outer pointer elision in the constructors phase.
* | | Merge pull request #4655 from retronym/merge/2.11.x-to-2.12.x-20152307Lukas Rytz2015-07-2348-50/+151
|\ \ \ | |/ / |/| | Merge 2.11.x to 2.12.x [ci: last-only]
| * | Merge remote-tracking branch 'origin/2.11.x' into ↵Jason Zaugg2015-07-2348-50/+151
|/| | | | | | | | | | | merge/2.11.x-to-2.12.x-20152307
| * | Merge pull request #4650 from lrytz/t8502-packageJason Zaugg2015-07-216-3/+53
| |\ \ | | | | | | | | SI-8502 create PackageClass instead of Class symbol stubs for pkgs
| | * | SI-8502 create PackageClass instead of Class symbol stubs for pkgsLukas Rytz2015-07-206-3/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://github.com/scala/scala/pull/4111 creates a stub type symbol for missing packages, deferring (or avoiding) a crash if a package is missing. The symbol created was a ClassSymbol, which could lead to an assertion failure in flattten: case TypeRef(pre, sym, args) if isFlattenablePrefix(pre) => assert(args.isEmpty && sym.enclosingTopLevelClass != NoSymbol, sym.ownerChain) `pre` is the stub ClassSymbol, so `isFlattenablePrefix` is true (but it should be false). The assertion then fails because the enclosing class of a top-level class defined in a missing package is NoSymbol. This failed only with GenBCode, which traverses more of the symbol graph while building ClassBTypes: it looks collects the nested classes of `Outer` into a `NestedInfo`.
| * | | Merge pull request #4631 from janekdb/2.11.x-typos-t-vSeth Tisue2015-07-2019-23/+23
| |\ \ \ | | | | | | | | | | Fix 23 typos (t-v)
| | * | | Fix 23 typos (t-v)Janek Bogucki2015-07-1519-23/+23
| | | | |
| * | | | Merge pull request #4642 from janekdb/2.11.x-typos-w-zSeth Tisue2015-07-204-6/+6
| |\ \ \ \ | | | | | | | | | | | | Fix 6 typos (w-z)
| | * | | | Fix 6 typos (w-z)Janek Bogucki2015-07-174-6/+6
| | | |/ / | | |/| |
| * | | | Merge pull request #4643 from janekdb/2.11.x-names-w-zSeth Tisue2015-07-201-2/+2
| |\ \ \ \ | | | | | | | | | | | | Fix typo in val name
| | * | | | Fix typo in val nameJanek Bogucki2015-07-171-2/+2
| | |/ / /
| * | | | Merge pull request #4632 from janekdb/2.11.x-names-t-vSeth Tisue2015-07-203-4/+4
| |\ \ \ \ | | | | | | | | | | | | Improve some names (t-v)
| | * | | | Improve some names (t-v)Janek Bogucki2015-07-153-4/+4
| | | |/ / | | |/| |
| * | | | Merge pull request #4646 from SethTisue/issue/9409Seth Tisue2015-07-181-1/+0
| |\ \ \ \ | | | | | | | | | | | | SI-9409 Scaladoc: remove link to nonexistent diagram doc
| | * | | | SI-9409 Scaladoc: remove link to nonexistent diagram docSeth Tisue2015-07-181-1/+0
| | | |/ / | | |/| |
| * | | | Merge pull request #4645 from SethTisue/issue/9406Seth Tisue2015-07-181-1/+1
| |\ \ \ \ | | |/ / / | |/| | | SI-9406 fix doc for Range.takeRight
| | * | | SI-9406 fix doc for Range.takeRightSeth Tisue2015-07-181-1/+1
| |/ / /
| * | | Merge pull request #4595 from som-snytt/issue/9370Lukas Rytz2015-07-165-2/+45
| |\ \ \ | | | | | | | | | | SI-9370 Xplugin scans plugin path for descriptor
| | * | | SI-9370 Xplugin scans plugin path for descriptorSom Snytt2015-06-305-2/+45
| | | | | | | | | | | | | | | | | | | | | | | | | Keep on scanning if the first entry doesn't yield a plugin.xml descriptor.
| * | | | Merge pull request #4615 from parambirs/patch-1Lukas Rytz2015-07-161-1/+1
| |\ \ \ \ | | | | | | | | | | | | Update scaladoc for Any.scala#equals()
| | * | | | Update scaladoc for Any.scala#equals()Parambir Singh2015-07-091-1/+1
| | | |/ / | | |/| | | | | | | The transitive requirement for `Any` shouldn't mention `AnyRef`
| * | | | Merge pull request #4637 from retronym/ticket/9401Lukas Rytz2015-07-163-1/+9
| |\ \ \ \ | | | | | | | | | | | | SI-9401 Avoid SOE with array + missing classtag
| | * | | | SI-9401 Avoid SOE with array + missing classtagJason Zaugg2015-07-163-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implicit classtags required by the Array constructor are not expressed in the type signature of its constructor, and instead are summoned by a special case in the typechecker. This special case entails replacing the `new Array` tree with `implicitly[T].newArray(size)`, handled in `ArrayInstantiation`. This tree is recursively typechecked. However, if the implicit materialization/search fails, an error is issued to the current reporter and the original tree is marked with an error type. As above, this is recursively typechecked. In the normal course of affairs, the recursive typecheck of the erroneous tree would be a noop (the tree already has a type!). However, if we are both in silent mode (in which errors are buffered) and in retyping mode (in which the typer clears the type and symbols of trees), we were getting into an cycle. In the enclosed test, retyping mode was trying to recover from: Resetting.this.gencastarray_=(new Array[T](0).<ERROR>) By inserting a suitable a view: implicitly[Resetting => { def gencastarray_=(AT)}]( Resetting.this ).gencastarray_=(new Array[T](0)) Where AT is the type found by retypechecking the argument. It is during the argument retypechecking that we fell into cycle. Crazily enough, in 2.11.0, the ensuing `StackOverflowError` was being caught and treated as a failure. We would then back out of the retyping mode, and issue the error from the the very first attempt at the implicit search. This fragile state of affairs was disrupted by a refactoring to the error reporting system in 725c5c9, after which the SOE crashed the compiler. This commit avoids recursively typechecking error typed trees.
| * | | | | Merge pull request #4628 from SethTisue/issue/8744Lukas Rytz2015-07-161-1/+1
| |\ \ \ \ \ | | |/ / / / | |/| | | | SI-8744 fix version.number in scaladoc.properties
| | * | | | SI-8744 fix version.number in scaladoc.propertiesSeth Tisue2015-07-131-1/+1
| | |/ / / | | | | | | | | | | | | | | | the fix is as suggested by Adriaan in the ticket
| * | | | Merge pull request #4633 from SethTisue/upgrade-redcarpetAdriaan Moors2015-07-153-4/+2
| |\ \ \ \ | | | | | | | | | | | | use newer Redcarpet to build spec
| | * | | | use newer Redcarpet to build specSeth Tisue2015-07-153-4/+2
| | |/ / / | | | | | | | | | | | | | | | | | | | | now that https://github.com/vmg/redcarpet/issues/494 is fixed we don't need to stay pinned to an outdated version anymore
| * | | | Merge pull request #4634 from SethTisue/travis-container-infrastructureAdriaan Moors2015-07-151-1/+4
| |\ \ \ \ | | |/ / / | |/| | | opt-in to Travis's newer/faster container-based infrastructure
| | * | | opt-in to Travis's newer/faster container-based infrastructureSeth Tisue2015-07-151-1/+4
| |/ / / | | | | | | | | | | | | this is the way Travis is headed, so let's get on board
* | | | Merge pull request #4640 from SethTisue/remove-old-bincompatSeth Tisue2015-07-213-23/+1
|\ \ \ \ | | | | | | | | | | remove legacy bincompat stuff in two places
| * | | | remove legacy bincompat stuff in Predef.scala, Stream.scalaSeth Tisue2015-07-213-23/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | it was only there to preserve binary compatibility within the 2.11.x series includes updated partest, since the old partest ran afoul of the Stream change
* | | | | Merge pull request #4616 from som-snytt/issue/9383Seth Tisue2015-07-205-37/+111
|\ \ \ \ \ | |/ / / / |/| | | | SI-9383 Improved unused import warning
| * | | | SI-9383 Name the function for implicit importingSom Snytt2015-07-161-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Per review, adds a function that clarifies the purpose of the code path that collects imported implicits, namely, to examine qualifying imported implicits and then collect them. In the context of doing something with the import (besides importing), it's clear why we don't want to record that we used the import, that is, because we might be doing something other than using. That's clear, right?
| * | | | SI-9383 Improved unused import warningSom Snytt2015-07-085-32/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, implicit search would mark every import it touched as a lookup. Instead, let subsequent type check perform the lookup.
* | | | | Merge pull request #4629 from adriaanm/unforkjoinSeth Tisue2015-07-20136-76302/+131
|\ \ \ \ \ | |_|_|_|/ |/| | | | Remove our fork of forkjoin. Java 8 bundles it.
| * | | | Remove further references to forkjoinJason Zaugg2015-07-15115-68894/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use j.u.c.Forkjoin directly in active and disabled tests Remove bitrotted benchmarks code I was going to update these to use `java.util.concurrent.ForkJoin` directly, instead of our deprecated stubs. But most of them don't compile anymore (e.g. scala.testing.Benchmark has been removed, ClassTag imports missing). While I'm all for benchmarks, we should have large swathes of code checked in that isn't at compiled and run automatically. I'm happy to help someone resurrect these in a suitable form.
| * | | | Remove our fork of forkjoin. Java 8 bundles it.Adriaan Moors2015-07-1521-7408/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide deprecated compatibility stubs for the types and static members, which forward as follows: ``` scala.concurrent.forkjoin.ForkJoinPool => java.util.concurrent.ForkJoinPool scala.concurrent.forkjoin.ForkJoinTask => java.util.concurrent.ForkJoinTask scala.concurrent.forkjoin.ForkJoinWorkerThread => java.util.concurrent.ForkJoinWorkerThread scala.concurrent.forkjoin.LinkedTransferQueue => java.util.concurrent.LinkedTransferQueue scala.concurrent.forkjoin.RecursiveAction => java.util.concurrent.RecursiveAction scala.concurrent.forkjoin.RecursiveTask => java.util.concurrent.RecursiveTask scala.concurrent.forkjoin.ThreadLocalRandom => java.util.concurrent.ThreadLocalRandom ``` To prepare for Java 9, the Scala library does not itself use `sun.misc.Unsafe`. However, for now, it provide a convenience accessor for it via `scala.concurrent.util.Unsafe`. This (deprecated) class will be removed as soon as the eco-system drops its use (akka-actor, I'm looking at you).
* | | | | Merge pull request #4639 from lrytz/closure-opt-stabilitySeth Tisue2015-07-161-8/+8
|\ \ \ \ \ | | | | | | | | | | | | Fix bytecode stability when running the closure optimizer
| * | | | | Fix bytecode stability when running the closure optimizerLukas Rytz2015-07-161-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | Fixes the stability regression introduced by #4619.
* | | | | | Merge pull request #4635 from SethTisue/post-m2-version-bumpsSeth Tisue2015-07-161-4/+4
|\ \ \ \ \ \ | | | | | | | | | | | | | | bump versions.properties now that 2.12.0-M2 is out
| * | | | | | bump versions.properties now that 2.12.0-M2 is outSeth Tisue2015-07-161-4/+4
| | |/ / / / | |/| | | |
* | | | | | Merge pull request #4611 from SethTisue/issue/8627Lukas Rytz2015-07-161-1/+3
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | add test coverage for SI-8627 (Stream.filterNot)
| * | | | | add test coverage for SI-8627 (Stream.filterNot)Seth Tisue2015-07-081-1/+3
| | |/ / / | |/| | |